/* ═══════════════════════════════════════════════════════════════════
   TOKENS — single source of truth for the shared admin look
   Loaded first, before every other theme file.
   Never hardcode a brand colour, radius, shadow or duration again:
   reference the variables below instead.
   ═══════════════════════════════════════════════════════════════════ */

:root {

	/* ── Brand (teal) ───────────────────────────────────────────────── */
	--brand-50:   #eef6f7;
	--brand-100:  #d3e8ea;
	--brand-200:  #a7d1d5;
	--brand-300:  #6fb0b7;
	--brand-400:  #4f9aa3;
	--brand-500:  #408892;   /* primary */
	--brand-600:  #2d6068;   /* primary dark */
	--brand-700:  #234e56;
	--brand-800:  #1b3c42;

	--brand-hover: #357882;  /* between 500 and 600: hover on filled controls */

	/* Fill behind white text (buttons, active pills, total bars). A hair
	   deeper than --brand-500: white on #408892 is 4.07:1, just under the
	   4.5:1 WCAG asks for normal text; #3c8089 is 4.52:1 and reads the same. */
	--brand-solid: #3c8089;

	/* Brand fills — solid.
	   These replaced the old diagonal teal gradient (259.74deg, #408892 →
	   #2d6068). They are written as single-colour gradients on purpose: a
	   gradient is an <image>, so the same token works in both
	   `background` and `background-image`, which is how the old gradient
	   was used across the codebase. Visually they are flat colour. */
	--brand-fill:       linear-gradient(var(--brand-solid), var(--brand-solid));
	--brand-fill-hover: linear-gradient(var(--brand-hover), var(--brand-hover));
	--brand-fill-soft:  linear-gradient(rgba(64,136,146,.14), rgba(64,136,146,.14));

	/* Coloured shadow for elevated brand surfaces */
	--brand-glow:   0 6px 16px -6px rgba(64,136,146,.6);

	/* Mint accent — used by live/positive indicators (caja, bottom nav) */
	--accent-mint:  #7ee8a2;

	/* ── Navy (sidebar / dark surfaces) ─────────────────────────────── */
	--nav-900:  #0b1b2b;
	--nav-800:  #13293d;
	--nav-700:  #1c3a53;
	--nav-ink:        #e8f1f3;               /* text on navy */
	--nav-ink-soft:   rgba(232,241,243,.72);
	--nav-ink-mute:   rgba(232,241,243,.56);   /* section labels: ~5:1 on navy (was 4.1:1 at .46) */
	--nav-line:       rgba(255,255,255,.08);
	--nav-hover:      rgba(255,255,255,.07);
	--nav-w:          230px;                 /* sidebar width */
	--bnav-h:         58px;                  /* mobile bottom nav, without the safe-area inset */

	/* ── Neutrals / surfaces ────────────────────────────────────────── */
	/* Page ground: the warm cream the app has always had (#f6f3ee), which
	   users know and asked to keep. White cards still separate from it
	   through their border and shadow. */
	--bg:           #f6f3ee;
	--bg-sunken:    #eef1f5;
	--surface:      #ffffff;
	--surface-alt:  #fafbfc;
	--row-alt:      #f1f4f7;   /* table zebra that is still visible on a bright screen */
	--table-align:  center;    /* headers and cells of every data table (left/right per app via /custom) */

	--ink:        #1b2733;   /* primary text */
	--ink-soft:   #52627a;   /* secondary text */
	/* Contrast (WCAG AA = 4.5:1 for normal text). The old greys failed on
	   exactly the smallest text: labels, hints, KPI captions, placeholders. */
	--ink-mute:   #607187;   /* tertiary / hints: 4.65:1 even on --field-bg (was 3.1:1) */
	--ink-faint:  #8596ad;   /* NON-text only (decorative icons, dividers): 3:1 */

	--line:         #e3e8ee;
	--line-strong:  #cfd8e3;

	/* Form fields: a soft grey well at rest that turns white on focus, so
	   fields stand apart from the white card they sit on. */
	--field-bg:     #f5f7fa;
	--field-border: #dfe5ec;

	/* ── Status ─────────────────────────────────────────────────────── */
	--ok:          #1f9254;
	--ok-soft:     #e6f5ec;
	--ok-border:   #b7e2c8;

	--warn:        #b26a00;
	--warn-soft:   #fdf3e3;
	--warn-border: #f3d9a8;

	--danger:        #c8372f;
	--danger-soft:   #fdecea;
	--danger-border: #f3c2bd;

	--info:        #1f6fb2;
	--info-soft:   #e9f2fa;
	--info-border: #b9d6ef;

	/* ── Shape ──────────────────────────────────────────────────────── */
	--r-xs:    4px;
	--r-sm:    6px;
	--r-md:   10px;
	--r-lg:   14px;
	--r-xl:   20px;
	--r-pill: 999px;

	/* ── Elevation — layered and soft, never a single hard blur ─────── */
	--sh-1: 0 1px 2px rgba(19,41,61,.06), 0 1px 3px rgba(19,41,61,.04);
	--sh-2: 0 2px 4px rgba(19,41,61,.06), 0 4px 10px -2px rgba(19,41,61,.08);
	--sh-3: 0 4px 8px rgba(19,41,61,.07), 0 12px 24px -6px rgba(19,41,61,.12);
	--sh-4: 0 8px 16px rgba(19,41,61,.08), 0 24px 48px -12px rgba(19,41,61,.18);

	/* ── Motion ─────────────────────────────────────────────────────── */
	--dur-1: 120ms;   /* hover, colour, press */
	--dur-2: 200ms;   /* small reveals */
	--dur-3: 320ms;   /* panels, page enter */
	--dur-4: 520ms;   /* larger choreography */

	--ease-out:    cubic-bezier(.2, .8, .2, 1);
	--ease-in-out: cubic-bezier(.4, 0, .2, 1);
	--ease-spring: cubic-bezier(.34, 1.56, .64, 1);

	/* ── Type ───────────────────────────────────────────────────────── */
	--font-sans: 'Nunito Sans', 'Inter', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

	/* Legibility scale. 12px is the floor for any text in the UI: nothing
	   reads below it. Every step is +1px over the first redesign pass,
	   which had gone too small (field labels at 12px, the old UI had 15). */
	--fs-xs:  12px;   /* uppercase captions, chips, column titles */
	--fs-sm:  13px;   /* field labels, hints, secondary menu items */
	--fs-md:  14px;   /* table cells, buttons, main menu */
	--fs-base:15px;   /* inputs, running text */
	--fs-lg:  17px;
	--fs-xl:  21px;
	--fs-2xl: 27px;

	/* Icons and hit areas scale with the text */
	--icon-sm: 14px;
	--icon-md: 16px;
	--icon-lg: 20px;
	--hit:     36px;  /* minimum side of an icon-only button */

	/* ── Focus ring (replaces the blanket outline:none) ─────────────── */
	--focus-ring: 0 0 0 3px rgba(64,136,146,.35);
}


/* ── "Texto grande" ─────────────────────────────────────────────────────
   Personal preference, toggled from the sidebar (ui-motion.js) and stored
   per browser. The class is set on <html> by a tiny script in each
   layout's <head>, before first paint, so there is no size jump on load.
   Everything that reads these tokens scales; nothing else has to know. */
html.text-lg {
	--fs-xs:  14px;
	--fs-sm:  15px;
	--fs-md:  16px;
	--fs-base:17px;
	--fs-lg:  19px;
	--fs-xl:  23px;
	--fs-2xl: 29px;

	--icon-sm: 16px;
	--icon-md: 18px;
	--icon-lg: 22px;
	--hit:     40px;
}
