/* ==========================================================================
   Celita — design tokens
   The single source for colour, spacing, radius and type. Every rule in
   site.css consumes var(--…) from here; nothing else declares a raw value.
   ========================================================================== */

:root {
    /* ---------- surfaces ---------- */
    --bg: #FAFAFA;          /* page background */
    --surface: #FFFFFF;     /* cards, tables, panels */

    /* A tinted face for anything that has to read as an object sitting on a white
       panel rather than as part of it - the org chart's nodes, and a popover that
       opens over a card. On --surface a white panel is held apart by its 1px edge
       alone, which at --border is 1.2:1 and reads as merged with what is behind it.
       Cool rather than warm so it sits apart from --bg without carrying any of the
       accent, and light enough that --text-mid still clears 4.5:1 on it (7.1:1).
       Neutral: it is not a second brand colour. */
    --surface-cool: #F3F5F9;
    --border: #E8E8EA;      /* 1px dividers, card and panel edges */

    /* The edge of anything you can type in or press. Deliberately darker than
       --border: at #E8E8EA an input outline is 1.2:1 on --surface, which reads as
       barely-there and fails the 3:1 WCAG 1.4.11 asks of a control's boundary.
       This clears it at 3.26:1 on --surface and 3.12:1 on --bg. Dividers stay on
       --border — a table rule wants to be quiet, an input does not. */
    --border-control: #8E8E96;

    /* ---------- text ----------
       --text-dim is used only where WCAG exempts it: placeholders, disabled
       controls and decorative icons. Readable labels take --text-mid, which
       clears 4.5:1 on --surface (7.7:1) where --text-dim does not (2.6:1). */
    --text: #18181B;        /* primary text */
    --text-mid: #52525B;    /* secondary text, table cells, labels */
    --text-dim: #A1A1AA;    /* placeholders, inactive icons */

    /* ---------- accent ----------
       Permitted in exactly four places: the primary button, the active nav
       indicator, the focus ring, and links. Nowhere else. */
    --accent: #5B3FBF;
    --accent-bg: #F2EFFC;
    --accent-hover: #4A32A0;                /* primary button, pressed */
    --accent-ring: rgba(91, 63, 191, .12);  /* the 3px focus ring, 12% alpha */

    /* Dialog backdrop and the mobile rail scrim — --text at low alpha. */
    --backdrop: rgba(24, 24, 27, .45);
    --scrim: rgba(24, 24, 27, .35);

    /* ---------- status ---------- */
    --ok: #15803D;
    --ok-bg: #F0FDF4;
    --warn: #B45309;
    --warn-bg: #FFFBEB;
    --danger: #B91C1C;
    --danger-bg: #FEF2F2;

    /* Neutral fill behind avatar initials — never the accent. */
    --neutral: #E4E4E7;

    /* An unselected tab, recessed against --surface so the selected one reads as
       the sheet in front. Sits between --bg and --border on purpose: any lighter
       and the tab body disappears into the strip behind it. */
    --tab-idle: #E8E8EC;

    /* The tab outline and its 2px rail. Well clear of --border: a tab's edge has
       to separate two tones that are already close — the idle fill in front and
       the strip behind it — where a divider only ever sits on one flat surface. */
    --tab-border: #C6C6CE;

    /* ---------- navigation palette ----------
       One hue per destination, so the rail is scannable by colour. These are NOT
       the accent and never stand in for it: they tint the 16px glyph only, never
       a tile or circle behind it, and never a label or a surface. Every one is a
       600–800 weight, clearing 3:1 on --bg for non-text contrast. */
    --nav-individuals: #0E7C86;   /* teal   */
    --nav-companies:   #0369A1;   /* sky    */
    --nav-hr:          #BE185D;   /* rose   */
    --nav-home:        #B45309;   /* amber  */
    --nav-tickets:     #B91C1C;   /* red    */
    --nav-recurring:   #4D7C0F;   /* lime   */
    --nav-assets:      #047857;   /* green  */
    --nav-reminders:   #A21CAF;   /* fuchsia*/
    --nav-processes:   #4338CA;   /* indigo */
    --nav-users:       #2563EB;   /* blue   */
    --nav-lookups:     #C2410C;   /* orange */
    --nav-logs:        #475569;   /* slate  */

    /* A tinted panel behind a chart: a cool grey a step darker than --border, so it reads on
       the white card where --bg barely does. Charts only. */
    --panel: #E8ECF3;

    /* Categorical series for charts where every slice is a different person. Only the
       charts read these; they are not navigation and not the accent. */
    --chart-1: #0E7C86;
    --chart-2: #0369A1;
    --chart-3: #BE185D;
    --chart-4: #B45309;
    --chart-5: #047857;
    --chart-6: #A21CAF;
    --chart-7: #4338CA;
    --chart-8: #C2410C;
    --chart-9: #4D7C0F;
    --chart-10: #475569;

    /* Warm grey, and the last hue in the set. Every chromatic band is taken by a
       destination somebody reaches for daily, and the one still free — violet — is
       the accent's, which this palette may never stand in for. So Settings pairs
       with Logs: the two destinations you visit to configure rather than to work,
       told apart by slate being cool and this warm. 8.2:1 on --bg. */
    --nav-settings:    #57534E;   /* stone  */

    /* Activity shares the Users hue rather than taking a fourteenth.
       The set is full — see the note above — and inventing a band would either
       crowd one of the twelve or reach for the accent's violet. Sharing is already
       how this palette handles a family: Users and Roles are both blue, and the
       three HR destinations are all rose. Activity belongs to that family by every
       reading — it is the users module's record of itself, it sits in the same
       Administration group, and it is opened from a user's own record. Declared as
       its own name so the rail's mapping reads like every other line, and so it can
       be given a hue of its own the day the palette has one to give. */
    --nav-activity:    var(--nav-users);

    /* Search shares Logs' slate for the same reason Activity shares Users' blue: the set is
       full, and search is a utility you open to find something rather than a place of
       work. */
    --nav-search:      var(--nav-logs);

    /* ---------- raised surface ----------
       The one place the app is allowed a gradient and a shadow: the rail's module
       buttons. Scoped deliberately — see the Sidebar note in CLAUDE.md. Nothing
       else in the app may consume these. */
    --raise-top: #FFFFFF;
    --raise-bottom: #F0F0F2;
    --raise-shadow: 0 1px 2px rgba(24, 24, 27, .07);
    --raise-highlight: inset 0 1px 0 rgba(255, 255, 255, .9);
    --press-shadow: inset 0 1px 3px rgba(24, 24, 27, .13);

    /* The accent's light variants: --accent-bg-deep is the selected module button,
       deepened enough to read as pressed in; --accent-border edges anything the
       accent owns — that button, and the selected tab beneath its lit rail. */
    --accent-bg-deep: #E7E1F9;
    --accent-border: #C9BCEE;

    /* ---------- radius ---------- */
    --r: 6px;
    --r-full: 9999px;       /* status badges only */

    /* ---------- spacing scale — 4 / 8 / 12 / 16 / 24 / 32 / 48, nothing between ---------- */
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 24px;
    --s-6: 32px;
    --s-7: 48px;

    /* ---------- type ----------
       Inter, self-hosted. Scale: 12 / 13 / 14 / 16 / 20 / 24, body 14.
       11px exists for exactly two things: section labels and badges. */
    --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

    --t-label: 11px;
    --t-sm: 12px;
    --t-ui: 13px;
    --t-body: 14px;
    --t-lg: 16px;
    --t-title: 20px;
    --t-xl: 24px;

    --w-normal: 400;
    --w-medium: 500;
    --w-semi: 600;

    --tracking-tight: -0.011em;   /* headings */

    /* ---------- chrome dimensions ---------- */
    --bar-h: 52px;
    --rail-w: 240px;
    --rail-w-collapsed: 48px;
    --control-h: 32px;            /* buttons and inputs */
    --action-rail-w: 48px;        /* the record screen's action bar */
    --row-h: 44px;                /* table rows */
    --row-h-stacked: 72px;        /* rows whose first cell stacks three lines - name, email, links */
    --avatar: 28px;
}

/* Self-hosted Inter (v4, SIL Open Font License - see fonts/LICENSE-Inter.txt). No Google
   Fonts CDN call: the file lives in wwwroot/fonts. One variable file covers every weight
   the app uses (400, 500, 600). If it ever fails to load, the stack falls through to system-ui. */
@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("../fonts/inter-variable.woff2") format("woff2-variations");
}
