/* ─── DESIGN TOKENS ─── */
/* The one place colors, type, spacing and the card / badge / column values
   live for Dev Updates, the admin and the Issue Tracker. Load it before
   styles.css on every page. Values match what the pages already used, so
   moving a rule onto a token never changes how it looks. */

:root {
    /* ── Brand palette ── (the original names, still used everywhere) */
    --dark: #212121;
    --light: #F7FAFD;
    --light-blue: #2098D0;
    --light-blue-hover: #1a86b8;
    --dark-blue: #12355A;
    --purple: #9C27B0;
    --red: #CE2E2F;
    --green: #2E7D32;
    --green-hover: #256929;
    --orange: #E65100;
    --indigo: #3949AB;
    --teal: #00897B;
    --magenta: #C2185B;
    --amber: #FFB300;
    --mid-grey: #E4E5E9;
    --light-grey: #FAFAFA;
    --line-soft: #F0F1F4;          /* row dividers inside tables and lists */
    --white: #FFFFFF;

    /* ── Text ── */
    --text: var(--dark);
    --text-heading: var(--dark-blue);
    --text-secondary: #555;
    --text-meta: #666;             /* card meta lines, hints under headings */
    --text-sub: #777;
    --text-hint: #888;
    --text-faint: #999;            /* item counts, small caps labels */
    --text-cool: #9AA1AB;          /* optional field markers, GitHub logins */
    --text-body: #444;             /* body copy on tracker cards */
    --text-on-dark: #FFFFFF;
    --text-on-dark-muted: rgba(247, 250, 253, 0.72);
    --text-on-ink: var(--text-on-dark);  /* on a fill colored with an *-ink token (count bubbles) */
    --link: var(--light-blue);
    --link-strong: #1B76A6;        /* tracker links: darker for contrast on white */
    --btn-primary: var(--link-strong);
    --btn-border: #C9CDD4;         /* secondary buttons */
    --line-dash: #B9C3CF;          /* "Goes with" chips */

    /* ── Surfaces ── */
    --header-bg: var(--dark-blue); /* the suite header bar */
    --fill-strong: var(--dark-blue);   /* selected chips and segments, primary button hover */
    --field-bg: var(--white);      /* inputs, selects, textareas */
    --hover-bg: #EEF5FA;           /* type-ahead row hover */

    /* ── Status tones ── */
    --success: var(--green);
    --success-bg: #EEF7EF;
    --success-bg-soft: #F4FAF4;
    --success-border: #CBE5CD;
    --success-ink: #23602A;
    --error: var(--red);
    --error-ink: #B4232A;
    --error-bg: #FDE7E7;
    --error-border: #F5C2C2;
    --warn: var(--orange);
    --warn-ink: #A53C06;           /* "waiting" and warning text */
    --info-bg: #EAF4FB;            /* Zoho feature-request pill */
    --info-ink: #1B5E86;
    --zoho: #B4232A;               /* Zoho escalation edge */
    --zoho-ink: #8E1B21;
    /* Two warm notice boxes that differ by a few points; kept apart so nothing shifts. */
    --notice-bg: #FFF6E5;          /* tracker sandbox + "gaps" boxes */
    --notice-border: #F5D49A;
    --notice-ink: #7A4B00;
    --caution-bg: #FEF3E2;         /* admin date / tense / omitted warnings */
    --caution-border: #F5D9A8;
    --caution-ink: #8A5300;
    --caution-ink-strong: #6B4200;

    /* ── Stale states (tracker "Needs attention") ──
       Set in admin-tracker.js attention(): no comment or Zenhub move for
       3 days = quiet, 7 = stale while someone outside dev is waiting
       (7 / 14 for internal work). "You" is your own step: confirm live
       after 2 days closed, reply 1 day after live. Each pill also carries
       an icon and words (⏳ Quiet, ⚠ Stale, 👉) so color is never alone. */
    --attention-quiet-bg: #FFF3DC;
    --attention-quiet-fg: #8A5300;
    --attention-stale-bg: #FDE7E7;
    --attention-stale-fg: #A61E25;
    --attention-you-bg: #E3F1FA;
    --attention-you-fg: #12355A;

    /* ── Tracker stages ── (left to right through the pipeline) */
    --stage-inbox: var(--purple);
    --stage-assigned: var(--indigo);
    --stage-progress: var(--light-blue);
    --stage-release: var(--magenta);   /* Ready for Release */
    --stage-qa: var(--teal);
    --stage-closed: var(--orange);
    --stage-live: var(--green);
    --stage-fallback: #999;

    /* ── Dev Updates sections ── */
    --section-released: var(--green);
    --section-qa: var(--light-blue);
    --section-next: var(--dark-blue);
    --section-upcoming: var(--purple);

    /* ── Categories (tags + stat chips) ── */
    --cat-fix: var(--red);
    --cat-enhancement: var(--green);
    --cat-ui: var(--dark-blue);
    --cat-ai: var(--purple);
    --cat-infra: var(--light-blue);
    --cat-request: var(--orange);
    --cat-docs: var(--indigo);
    --kow-forward: #1E78C8;
    --kow-forward-ink: #155A99;
    --kow-upkeep: #3C9A78;
    --kow-upkeep-ink: #24694F;
    --kow-rework: var(--orange);

    /* ── Repos ── lsvt-prod stays white; lsvt-angular is lavender */
    --repo-angular: #7E6BD6;
    --repo-angular-bg: #F6F4FD;
    --repo-angular-border: #DCD5F5;
    --repo-angular-ink: #5E4BB8;
    --repo-angular-chip-border: #B8ACE8;

    /* ── Type ── */
    --font-display: 'Montserrat', Helvetica, sans-serif;
    --font-body: 'Public Sans', Helvetica, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fs-tag: 10px;                /* uppercase category tags */
    --fs-caps: 11px;               /* small caps labels, counts */
    --fs-badge: 11.5px;            /* labels, attention pills */
    --fs-small: 12px;
    --fs-meta: 12.5px;             /* card meta, tabs, header pills */
    --fs-ui: 13px;                 /* section titles, form help */
    --fs-ui-lg: 13.5px;
    --fs-body: 14px;               /* card titles, inputs */
    --fs-stage: 15.5px;            /* stage band titles */
    --fs-entry: 15.5px;            /* Dev Updates list lines */
    --fs-h2: 16px;
    --fs-h1: 18px;
    --fs-stat: 22px;               /* summary tile numbers */
    --lh-tight: 1.3;
    --lh-snug: 1.5;
    --lh-body: 1.6;
    --ls-caps: 0.5px;

    /* ── Spacing ── */
    --space-2xs: 2px;
    --space-xs: 4px;
    --space-sm: 6px;
    --space-md: 8px;
    --space-10: 10px;
    --space-12: 12px;
    --space-14: 14px;
    --space-16: 16px;
    --space-20: 20px;
    --space-24: 24px;
    --space-28: 28px;
    --space-32: 32px;
    --space-40: 40px;

    /* ── Radius ── */
    --radius-xs: 3px;              /* tags */
    --radius-sm: 4px;              /* labels, badges */
    --radius-md: 6px;              /* inputs, buttons, notice boxes */
    --radius-lg: 8px;              /* cards, panels, stage bands */
    --radius-xl: 10px;             /* dialogs */
    --radius-count: 9px;           /* count bubbles */
    --radius-pill: 999px;

    /* ── Elevation ── */
    --shadow-sm: 0 1px 3px rgba(18, 53, 90, 0.08);
    --shadow-md: 0 4px 12px rgba(18, 53, 90, 0.1);
    --shadow-lg: 0 8px 30px rgba(18, 53, 90, 0.12);
    --backdrop: rgba(18, 53, 90, 0.35);

    /* ── Column ──
       Every page and its header use this column, the same as the Roadmap's:
       1200px with 40px sides, so the content is 1120px wide. (The Roadmap
       says max-width 1120px without border-box, which comes to the same.) */
    --page-width: 1200px;
    --page-pad: 40px;
    --page-pad-mobile: 16px;
    /* Tracker stage columns: a full-width band in the stage color, then its cards. */
    --stage-gap: 34px;             /* between stages */
    --stage-head-tint: 9%;         /* band background: stage color mixed into white */
    --stage-head-edge: 25%;        /* band border */
    --stage-head-ink: 70%;         /* title: stage color mixed into navy */
    --stage-head-accent: 6px;      /* left bar */
    --stage-head-pad: 11px 16px;
    --stage-head-radius: var(--radius-lg);
    --summary-columns: 7;          /* one tile per stage */

    /* ── Card ── */
    --card-bg: var(--white);
    --card-border: var(--mid-grey);
    --card-radius: var(--radius-lg);
    --card-shadow: var(--shadow-sm);
    --card-shadow-hover: var(--shadow-md);
    --card-pad: 14px 18px;         /* tracker issue card */
    --card-pad-panel: 28px 32px;   /* admin form card */
    --card-pad-entry: 32px 36px;   /* Dev Updates week entry */
    --card-gap: 10px;
    --card-accent: 4px;            /* left bar: latest entry, angular repo, summary tile */
    --card-done-opacity: 0.8;

    /* ── Badge ── */
    --tag-pad: 2px 7px;            /* .tag: uppercase category */
    --tag-radius: var(--radius-xs);
    --badge-pad: 1px 7px;          /* .trk-label, .trk-internal */
    --badge-radius: var(--radius-sm);
    --badge-bg: rgba(18, 53, 90, 0.07);
    --pill-pad: 1px 9px;           /* .trk-att */
    --pill-radius: var(--radius-pill);
    --count-pad: 1px 8px;          /* number bubble next to a stage title */
    --count-radius: var(--radius-count);
}

/* ─── DARK THEME ───
   Applies when <html data-theme="dark"> is set. Only the Issue Tracker and
   Costs pages set it (theme.js: the system setting until someone flips the
   header toggle), so every other page stays light. Near-black and warm grey,
   from the People tab's original design. --dark-blue turns light because
   it's the heading color nearly everywhere; anything that used it as a
   fill uses --header-bg or --fill-strong instead. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --dark: #F2F1EE;
    --light: #0D0D0D;              /* page */
    --white: #1B1B1B;              /* cards */
    --light-grey: #232322;         /* insets inside cards */
    --mid-grey: #2E2E2C;           /* borders */
    --line-soft: #2A2A28;
    --dark-blue: #F2F1EE;          /* headings */
    --light-blue: #4FB3E3;
    --light-blue-hover: #6CC1EA;
    --purple: #C77DD6;
    --red: #F26D6D;
    --green: #6FCF97;
    --green-hover: #8ADBAB;
    --orange: #F5A35C;
    --indigo: #8C97E8;
    --teal: #4CC2B4;
    --magenta: #E86A9A;
    --amber: #F2A93B;

    --text-secondary: #C4C2BD;
    --text-meta: #A3A19C;
    --text-sub: #9A9893;
    --text-hint: #8C8A85;
    --text-faint: #7D7B77;
    --text-cool: #8A9099;
    --text-body: #D6D4CF;
    --text-on-ink: #111111;
    --link-strong: #6CB6EA;
    --btn-primary: #1B76A6;        /* white text still needs a dark fill */
    --btn-border: #3A3A38;
    --line-dash: #55534F;

    --header-bg: #161616;
    --fill-strong: #2D5F8A;
    --field-bg: #121212;
    --hover-bg: #26303A;

    --success-bg: rgba(111, 207, 151, 0.12);
    --success-bg-soft: rgba(111, 207, 151, 0.07);
    --success-border: rgba(111, 207, 151, 0.30);
    --success-ink: #6FCF97;
    --error-ink: #F28B82;
    --error-bg: rgba(242, 109, 109, 0.14);
    --error-border: rgba(242, 109, 109, 0.35);
    --notice-bg: rgba(242, 169, 59, 0.10);
    --notice-border: rgba(242, 169, 59, 0.35);
    --notice-ink: #F2A93B;
    --caution-bg: rgba(242, 169, 59, 0.10);
    --caution-border: rgba(242, 169, 59, 0.35);
    --caution-ink: #F2A93B;
    --caution-ink-strong: #F5BD6A;
    --warn-ink: #F5A35C;
    --info-bg: rgba(108, 182, 234, 0.14);
    --info-ink: #8CC6EE;
    --zoho: #F26D6D;
    --zoho-ink: #F28B82;

    --attention-quiet-bg: rgba(242, 169, 59, 0.14);
    --attention-quiet-fg: #F2A93B;
    --attention-stale-bg: rgba(242, 109, 109, 0.16);
    --attention-stale-fg: #F28B82;
    --attention-you-bg: rgba(108, 156, 245, 0.16);
    --attention-you-fg: #A9C4F8;

    --stage-fallback: #7D7B77;
    --kow-forward: #6C9CF5;
    --kow-forward-ink: #A9C4F8;
    --kow-upkeep: #4CC2B4;
    --kow-upkeep-ink: #7FD6CB;

    --repo-angular: #9585E6;
    --repo-angular-bg: rgba(126, 107, 214, 0.10);
    --repo-angular-border: rgba(126, 107, 214, 0.35);
    --repo-angular-ink: #B3A6F0;
    --repo-angular-chip-border: rgba(126, 107, 214, 0.55);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.6);
    --badge-bg: rgba(255, 255, 255, 0.07);
}
