/* ════════════════════════════════════════════════════════════════════
   KIC DESIGN SYSTEM — "Threefold"
   Kingdom International Consortium · Digital Headquarters

   Concept: the three strands of the KIC mark — Ecumenical, Entrepreneurial,
   Economical — braided into one cord (Ecclesiastes 4:12). Blue is the
   institution; fine braided lines are the signature; the logo's prism
   gradient appears only as a hairline of identity, never as decoration.

   Layers:  1 Fonts · 2 Tokens · 3 Reset · 4 Typography · 5 Layout
            6 Components · 7 Utilities · 8 Motion & a11y · 9 Print
   Environments add: site.css (public) · portal.css · admin.css
   ════════════════════════════════════════════════════════════════════ */

/* 1 ─ FONTS (self-hosted, OFL) ─────────────────────────────────────── */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/Inter-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(../fonts/Inter-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400 600; font-display: swap;
  src: url(../fonts/Inter-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/Newsreader-normal-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Newsreader'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url(../fonts/Newsreader-normal-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Newsreader'; font-style: italic; font-weight: 300 600; font-display: swap;
  src: url(../fonts/Newsreader-italic-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url(../fonts/JetBrainsMono-normal-latin.woff2) format('woff2'); }

/* 2 ─ TOKENS ───────────────────────────────────────────────────────── */
:root {
  /* Blue family — the institution */
  --navy-975: #040B1D;   /* deepest ground: footer, executive canvas */
  --navy-950: #061131;
  --navy-900: #0A1A3D;   /* Institutional Navy — primary dark surface, headings */
  --navy-800: #0F2552;
  --navy-700: #15326B;
  --blue-700: #1A3FA8;   /* pressed / hover of primary */
  --blue-600: #1F4FD6;   /* KIC Blue — primary actions & links (6.1:1 on white) */
  --blue-500: #3A6BF0;   /* Medium Blue — accents, charts, focus */
  --blue-400: #6C92F5;
  --blue-300: #A3BBF9;   /* Light Blue — on-dark text accents, rules */
  --blue-200: #CCDAFC;
  --blue-100: #E6EDFE;   /* Very Light Blue — selected rows, soft fills */
  --blue-50:  #F3F6FF;

  /* Neutrals — cool porcelain, never pure grey */
  --white: #FFFFFF;
  --paper: #F6F8FC;      /* page background (portal/admin) */
  --mist:  #EDF1F8;      /* alternate section background */
  --linen: #F7F6F2;      /* warm editorial background (story sections) */
  --line:  #DCE3EF;      /* borders */
  --line-soft: #E9EEF6;  /* dividers inside cards */
  --ink-900: #0B1426;    /* body text */
  --ink-800: #1C2640;
  --ink-700: #2F3A56;    /* secondary headings */
  --ink-600: #4A5573;
  --ink-500: #5E6883;    /* secondary text (4.9:1) */
  --ink-400: #8792AA;    /* placeholder, disabled text */
  --ink-300: #B5BDCD;

  /* Status language — meaning only, never decoration */
  --success-700: #0E6B4F; --success-600: #12795A; --success-100: #E1F3EC; --success-50: #F1FAF6;
  --warning-700: #8A5306; --warning-600: #A8660A; --warning-100: #FCEFD6; --warning-50: #FEF8EC;
  --danger-700:  #A12A21; --danger-600:  #C0362C; --danger-100:  #FBE4E1; --danger-50:  #FDF3F2;
  --neutral-700: #4A5266; --neutral-600: #5E6778; --neutral-100: #ECEFF4; --neutral-50: #F5F7FA;
  --info-700: var(--blue-700); --info-600: var(--blue-600); --info-100: var(--blue-100);

  /* Signature — the logo's prism, used as a hairline only */
  --prism: linear-gradient(90deg, #1F4FD6 0%, #5B33E6 26%, #D52BD0 52%, #FF5A2E 78%, #FFC54A 100%);

  /* Typography */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --fs-display: clamp(2.75rem, 1.6rem + 4.6vw, 5.75rem);
  --fs-h1: clamp(2.25rem, 1.55rem + 2.8vw, 4rem);
  --fs-h2: clamp(1.875rem, 1.45rem + 1.7vw, 3rem);
  --fs-h3: clamp(1.375rem, 1.2rem + 0.7vw, 1.75rem);
  --fs-h4: 1.25rem;
  --fs-h5: 1.0625rem;
  --fs-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --fs-body: 1.0625rem;  /* 17px public reading size */
  --fs-ui: 0.9375rem;    /* 15px application UI */
  --fs-sm: 0.875rem;
  --fs-xs: 0.8125rem;
  --fs-2xs: 0.75rem;
  --fs-eyebrow: 0.75rem;

  --lh-tight: 1.08;
  --lh-snug: 1.25;
  --lh-body: 1.65;
  --lh-ui: 1.5;
  --tracking-display: -0.022em;
  --tracking-eyebrow: 0.18em;

  /* Spacing — 4px base */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;
  --s-10: 40px; --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px; --s-32: 128px;
  --section-y: clamp(72px, 5rem + 4vw, 144px);

  /* Content widths */
  --w-read: 44rem;      /* ~ 704px — long-form reading */
  --w-narrow: 52rem;    /* 832px — forms, articles */
  --w-content: 72rem;   /* 1152px — standard pages */
  --w-wide: 84rem;      /* 1344px — homepage, dashboards */
  --w-full: 100rem;     /* 1600px — admin canvas max */
  --gutter: clamp(16px, 4vw, 40px);

  /* Shape */
  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;

  /* Elevation — navy-tinted, layered */
  --sh-1: 0 1px 2px rgba(10, 26, 61, .06), 0 1px 1px rgba(10, 26, 61, .04);
  --sh-2: 0 6px 16px -4px rgba(10, 26, 61, .10), 0 2px 4px rgba(10, 26, 61, .04);
  --sh-3: 0 20px 44px -14px rgba(10, 26, 61, .22), 0 4px 10px rgba(10, 26, 61, .05);
  --sh-4: 0 40px 80px -24px rgba(6, 17, 49, .40);
  --ring: 0 0 0 3px rgba(58, 107, 240, .35);
  --ring-danger: 0 0 0 3px rgba(192, 54, 44, .25);

  /* Motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 120ms; --t-base: 200ms; --t-slow: 420ms;

  /* Layers */
  --z-sticky: 20; --z-header: 40; --z-dropdown: 60; --z-drawer: 80; --z-modal: 90; --z-toast: 100;

  color-scheme: light;
}

/* 3 ─ RESET ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; font-family: var(--font-sans); font-size: var(--fs-ui); line-height: var(--lh-ui); color: var(--ink-900);
  background: var(--white); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01'; font-optical-sizing: auto; }
img, svg, video, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd { margin: 0; }
ul[role='list'], ol[role='list'] { list-style: none; margin: 0; padding: 0; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s-8) 0; }
[hidden] { display: none !important; }
::selection { background: var(--blue-200); color: var(--navy-900); }

/* 4 ─ TYPOGRAPHY ───────────────────────────────────────────────────── */
.display, h1.display { font-family: var(--font-serif); font-size: var(--fs-display); font-weight: 400; line-height: 1.02; letter-spacing: var(--tracking-display); font-variation-settings: 'opsz' 72; }
.h1, h1 { font-family: var(--font-serif); font-size: var(--fs-h1); font-weight: 400; line-height: var(--lh-tight); letter-spacing: -0.018em; color: var(--navy-900); font-variation-settings: 'opsz' 60; }
.h2, h2 { font-family: var(--font-serif); font-size: var(--fs-h2); font-weight: 400; line-height: 1.12; letter-spacing: -0.014em; color: var(--navy-900); font-variation-settings: 'opsz' 48; }
.h3, h3 { font-family: var(--font-sans); font-size: var(--fs-h3); font-weight: 600; line-height: var(--lh-snug); letter-spacing: -0.012em; color: var(--navy-900); }
.h4, h4 { font-family: var(--font-sans); font-size: var(--fs-h4); font-weight: 600; line-height: 1.35; letter-spacing: -0.008em; color: var(--navy-900); }
.h5, h5 { font-family: var(--font-sans); font-size: var(--fs-h5); font-weight: 600; line-height: 1.4; color: var(--navy-900); }
.serif { font-family: var(--font-serif); }
.italic-accent, h1 em, h2 em, .display em { font-style: italic; font-weight: 300; color: var(--blue-600); }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--ink-600); }
.prose { font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-800); max-width: var(--w-read); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(1.625rem, 1.4rem + 0.9vw, 2.125rem); margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--blue-500); }
.prose a, .link { color: var(--blue-600); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--blue-600) 40%, transparent); transition: text-decoration-color var(--t-fast); }
.prose a:hover, .link:hover { text-decoration-color: currentColor; }
.prose blockquote { border-left: 2px solid var(--blue-500); padding: .2em 0 .2em 1.2em; font-family: var(--font-serif); font-size: 1.25em; font-style: italic; color: var(--navy-800); }
.prose strong { font-weight: 600; color: var(--ink-900); }
.prose img { border-radius: var(--r-md); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--blue-600); }
.eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; opacity: .7; }
.eyebrow.plain::before { display: none; }
.eyebrow-light { color: var(--blue-300); }
.muted { color: var(--ink-500); }
.subtle { color: var(--ink-400); }
.mono, .kic-number { font-family: var(--font-mono); font-feature-settings: 'zero'; letter-spacing: .02em; }
.tnum { font-variant-numeric: tabular-nums; }
.scripture { font-family: var(--font-serif); font-style: italic; font-weight: 300; }
.scripture cite { display: block; margin-top: .6em; font-family: var(--font-sans); font-style: normal; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-500); }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.caption { font-size: var(--fs-xs); color: var(--ink-500); line-height: 1.5; }
.label-caps { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-500); }
.num-xl { font-family: var(--font-serif); font-size: clamp(2.5rem, 2rem + 2vw, 3.75rem); font-weight: 400; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; }

/* 5 ─ LAYOUT ───────────────────────────────────────────────────────── */
.container { width: 100%; max-width: calc(var(--w-content) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container-wide { max-width: calc(var(--w-wide) + var(--gutter) * 2); }
.container-narrow { max-width: calc(var(--w-narrow) + var(--gutter) * 2); }
.container-read { max-width: calc(var(--w-read) + var(--gutter) * 2); }
.section { padding-block: var(--section-y); }
.section-sm { padding-block: calc(var(--section-y) * .6); }
.stack > * + * { margin-top: var(--stack, var(--s-4)); }
.stack-lg > * + * { margin-top: var(--s-8); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--gap, var(--s-3)); align-items: center; }
.row { display: flex; gap: var(--gap, var(--s-4)); align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap, var(--s-6)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 260px)), 1fr)); }
.grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap, var(--s-6)); }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: 1 / -1; }
@media (max-width: 1023px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-12 > [class*='span-'] { grid-column: 1 / -1; } }
@media (max-width: 767px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* 6 ─ COMPONENTS ──────────────────────────────────────────────────── */

/* Icons */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2rem; height: 2rem; stroke-width: 1.3; }
.icon-tile { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); background: var(--blue-50); color: var(--blue-600); border: 1px solid var(--blue-100); }
.icon-tile .icon { width: 22px; height: 22px; }

/* Buttons ─ primary · secondary · ghost · quiet · danger · on-dark variants */
.btn { --btn-h: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--btn-h); padding: 0 20px;
  border-radius: var(--r-md); border: 1px solid transparent; font-size: var(--fs-ui); font-weight: 600; letter-spacing: -0.005em; line-height: 1;
  white-space: nowrap; user-select: none; transition: background-color var(--t-base) var(--ease), border-color var(--t-base) var(--ease), color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), transform var(--t-fast) var(--ease); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--blue-600); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(10,26,61,.2); }
.btn-primary:hover { background: var(--blue-700); }
.btn-navy { background: var(--navy-900); color: #fff; }
.btn-navy:hover { background: var(--navy-800); }
.btn-secondary { background: #fff; color: var(--navy-900); border-color: var(--line); box-shadow: var(--sh-1); }
.btn-secondary:hover { border-color: var(--blue-300); color: var(--blue-700); background: var(--blue-50); }
.btn-ghost { color: var(--blue-600); background: transparent; }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-700); }
.btn-quiet { color: var(--ink-600); background: transparent; }
.btn-quiet:hover { background: var(--mist); color: var(--ink-900); }
.btn-danger { background: var(--danger-600); color: #fff; }
.btn-danger:hover { background: var(--danger-700); }
.btn-danger-ghost { color: var(--danger-600); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-success { background: var(--success-600); color: #fff; }
.btn-success:hover { background: var(--success-700); }
.btn-light { background: #fff; color: var(--navy-900); }
.btn-light:hover { background: var(--blue-50); }
.btn-outline-light { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.02); }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-lg { --btn-h: 54px; padding: 0 28px; font-size: 1rem; border-radius: 12px; }
.btn-sm { --btn-h: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: 8px; }
.btn-xs { --btn-h: 28px; padding: 0 10px; font-size: var(--fs-xs); border-radius: 6px; gap: 6px; }
.btn-xs .icon { width: 14px; height: 14px; }
.btn-icon { width: var(--btn-h); padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--blue-200); border-top-color: var(--blue-600); }
.arrow-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--blue-600); }
.arrow-link .icon { transition: transform var(--t-base) var(--ease); width: 18px; height: 18px; }
.arrow-link:hover .icon { transform: translateX(4px); }
.arrow-link.light { color: #fff; }

/* Forms */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: var(--s-5); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5) var(--s-5); }
.form-grid .field + .field { margin-top: 0; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 639px) { .form-grid { grid-template-columns: 1fr; } }
.label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-800); display: flex; gap: 6px; align-items: baseline; }
.label .req { color: var(--danger-600); font-weight: 600; }
.label .opt { color: var(--ink-400); font-weight: 400; font-size: var(--fs-xs); }
.hint { font-size: var(--fs-xs); color: var(--ink-500); }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--ink-900);
  font-size: 16px; line-height: 1.4; transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast); box-shadow: 0 1px 1px rgba(10,26,61,.03) inset; }
@media (min-width: 768px) { .input, .select, .textarea { font-size: var(--fs-ui); } }
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: var(--ring); }
.input[readonly] { background: var(--paper); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--paper); color: var(--ink-400); cursor: not-allowed; }
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235E6883' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input-sm, .select-sm { min-height: 36px; padding: 6px 10px; font-size: var(--fs-sm); border-radius: 8px; }
.select-sm { padding-right: 32px; background-position: right 8px center; background-size: 16px; }
.has-error .input, .has-error .select, .has-error .textarea, .input.is-invalid { border-color: var(--danger-600); }
.has-error .input:focus { box-shadow: var(--ring-danger); }
.field-error { font-size: var(--fs-xs); color: var(--danger-700); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.field-error::before { content: '!'; display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--danger-600); color: #fff; font-size: 10px; font-weight: 700; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group > :first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.input-group > :last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-500); font-size: var(--fs-sm); }
.input-group .addon:first-child { border-right: 0; } .input-group .addon:last-child { border-left: 0; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-400); pointer-events: none; width: 18px; height: 18px; }
.input-icon .input { padding-left: 42px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: var(--fs-ui); line-height: 1.45; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin-top: 1px; border: 1.5px solid var(--ink-300); border-radius: 6px; background: #fff; display: grid; place-items: center; transition: all var(--t-fast); cursor: pointer; }
.check input[type='radio'] { border-radius: 50%; }
.check input:checked { background: var(--blue-600); border-color: var(--blue-600); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type='radio']:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.check input:focus-visible { box-shadow: var(--ring); outline: none; }
.check .desc { display: block; font-size: var(--fs-xs); color: var(--ink-500); margin-top: 2px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 40px; height: 24px; border-radius: 99px; background: var(--ink-300); position: relative; transition: background var(--t-base); flex: none; }
.switch .track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--t-base) var(--ease-out); }
.switch input:checked + .track { background: var(--blue-600); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--ring); }
.choice-cards { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice-card { position: relative; display: block; padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; cursor: pointer; transition: all var(--t-base); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card:hover { border-color: var(--blue-300); }
.choice-card:has(input:checked) { border-color: var(--blue-600); box-shadow: 0 0 0 1px var(--blue-600), var(--sh-2); background: var(--blue-50); }
.choice-card:has(input:focus-visible) { box-shadow: var(--ring); }
.choice-card .choice-title { font-weight: 600; color: var(--navy-900); display: flex; justify-content: space-between; gap: 8px; }
.choice-card .choice-desc { font-size: var(--fs-sm); color: var(--ink-500); margin-top: 4px; }
.fieldset { border: 0; padding: 0; margin: 0; }
.fieldset + .fieldset { margin-top: var(--s-10); padding-top: var(--s-10); border-top: 1px solid var(--line-soft); }
.fieldset-title { font-size: var(--fs-h5); font-weight: 600; color: var(--navy-900); margin-bottom: 4px; }
.fieldset-desc { font-size: var(--fs-sm); color: var(--ink-500); margin-bottom: var(--s-5); }
.file-drop { display: grid; place-items: center; gap: 8px; padding: var(--s-8); border: 1.5px dashed var(--ink-300); border-radius: var(--r-lg); background: var(--paper); text-align: center; color: var(--ink-500); cursor: pointer; transition: all var(--t-base); }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--blue-500); background: var(--blue-50); color: var(--blue-700); }

/* Cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card-pad { padding: var(--s-6); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line-soft); }
.card-title { font-size: var(--fs-h5); font-weight: 600; color: var(--navy-900); letter-spacing: -0.01em; }
.card-sub { font-size: var(--fs-xs); color: var(--ink-500); margin-top: 2px; }
.card-body { padding: var(--s-6); }
.card-footer { padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line-soft); background: var(--paper); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-link { transition: box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease), border-color var(--t-base); }
.card-link:hover { box-shadow: var(--sh-3); transform: translateY(-2px); border-color: var(--blue-200); }
.card-flat { box-shadow: none; }
.card-navy { background: var(--navy-900); color: #fff; border-color: var(--navy-800); }
.card-navy .card-title { color: #fff; }
.card-tint { background: var(--blue-50); border-color: var(--blue-100); box-shadow: none; }

/* Badges & chips */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--r-pill); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .01em; white-space: nowrap; line-height: 1; border: 1px solid transparent; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-success { background: var(--success-100); color: var(--success-700); }
.badge-warning { background: var(--warning-100); color: var(--warning-700); }
.badge-danger { background: var(--danger-100); color: var(--danger-700); }
.badge-neutral { background: var(--neutral-100); color: var(--neutral-700); }
.badge-info { background: var(--blue-100); color: var(--blue-700); }
.badge-navy { background: var(--navy-900); color: #fff; }
.badge-outline { background: #fff; border-color: var(--line); color: var(--ink-600); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-size: var(--fs-sm); color: var(--ink-700); transition: all var(--t-fast); }
.chip:hover { border-color: var(--blue-300); color: var(--blue-700); }
.chip.is-active { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-xs); background: var(--mist); color: var(--ink-600); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* Alerts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid; font-size: var(--fs-sm); line-height: 1.5; }
.alert .icon { margin-top: 1px; width: 18px; height: 18px; }
.alert-title { font-weight: 600; display: block; }
.alert-success { background: var(--success-50); border-color: #BFE3D3; color: var(--success-700); }
.alert-warning { background: var(--warning-50); border-color: #F2D9A6; color: var(--warning-700); }
.alert-danger, .alert-error { background: var(--danger-50); border-color: #F2C3BE; color: var(--danger-700); }
.alert-info { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.alert-neutral { background: var(--neutral-50); border-color: var(--line); color: var(--ink-700); }
.alert .alert-body { flex: 1; }
.alert .alert-actions { margin-left: auto; }

/* Toasts */
.toasts { position: fixed; z-index: var(--z-toast); right: 20px; bottom: 20px; display: grid; gap: 10px; width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); background: var(--navy-900); color: #fff; box-shadow: var(--sh-4); font-size: var(--fs-sm); animation: toast-in var(--t-slow) var(--ease-out); }
.toast .icon { color: var(--blue-300); width: 18px; height: 18px; margin-top: 1px; }
.toast-success .icon { color: #7FD8B2; } .toast-error .icon, .toast-danger .icon { color: #FF9C92; } .toast-warning .icon { color: #F8C66B; }
.toast button { margin-left: auto; color: rgba(255,255,255,.6); }
.toast button:hover { color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: var(--fs-sm); }
.table th { text-align: left; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--paper); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.table th a { display: inline-flex; gap: 4px; align-items: center; }
.table th a:hover { color: var(--navy-900); }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-800); }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--blue-50); }
.table tbody tr.is-selected { background: var(--blue-100); }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table .right { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .shrink { width: 1%; white-space: nowrap; }
.table .primary-cell { font-weight: 600; color: var(--navy-900); }
.table .primary-cell a:hover { color: var(--blue-600); }
.table-compact td { padding: 10px 14px; }
.table .row-link { position: relative; }
.person-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.person-cell .meta { line-height: 1.3; }
.person-cell .name { font-weight: 600; color: var(--navy-900); }
.person-cell .sub { font-size: var(--fs-xs); color: var(--ink-500); }
/* Tables become stacked cards on phones */
@media (max-width: 767px) {
  .table-stack thead { display: none; }
  .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .table-stack td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  .table-stack td::before { content: attr(data-label); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); text-align: left; flex: none; }
  .table-stack td.primary-cell, .table-stack td[data-label=''] { display: block; text-align: left; }
  .table-stack td.primary-cell::before, .table-stack td[data-label='']::before { display: none; }
  .table-stack .num { text-align: right; }
}

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); white-space: nowrap; transition: color var(--t-fast); }
.tab:hover { color: var(--navy-900); }
.tab.is-active, .tab[aria-selected='true'] { color: var(--navy-900); }
.tab.is-active::after, .tab[aria-selected='true']::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--blue-600); }
.tab .count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--mist); color: var(--ink-600); font-size: 11px; display: inline-grid; place-items: center; }
.tab.is-active .count { background: var(--blue-100); color: var(--blue-700); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--mist); gap: 2px; }
.segmented a, .segmented button { padding: 7px 14px; border-radius: 8px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-600); }
.segmented .is-active { background: #fff; color: var(--navy-900); box-shadow: var(--sh-1); }

/* Accordion */
.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding: 22px 0; cursor: pointer; font-size: 1.0625rem; font-weight: 600; color: var(--navy-900); }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: ''; flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231F4FD6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / 14px no-repeat; transition: transform var(--t-base) var(--ease); }
.accordion details[open] summary::after { transform: rotate(45deg); }
.accordion .accordion-body { padding: 0 0 24px; color: var(--ink-600); font-size: var(--fs-body); line-height: var(--lh-body); max-width: var(--w-read); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; z-index: var(--z-dropdown); top: calc(100% + 8px); right: 0; min-width: 220px; padding: 6px; border-radius: var(--r-md); background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-3);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: all var(--t-base) var(--ease-out); }
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-menu.left { left: 0; right: auto; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 7px; font-size: var(--fs-sm); color: var(--ink-800); text-align: left; }
.dropdown-item:hover, .dropdown-item:focus-visible { background: var(--blue-50); color: var(--blue-700); outline: none; }
.dropdown-item .icon { color: var(--ink-400); width: 16px; height: 16px; }
.dropdown-item:hover .icon { color: currentColor; }
.dropdown-item.danger { color: var(--danger-700); }
.dropdown-item.danger:hover { background: var(--danger-50); }
.dropdown-sep { height: 1px; background: var(--line-soft); margin: 6px 4px; }
.dropdown-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-400); }

/* Modal & drawer */
.overlay { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(4, 11, 29, .56); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity var(--t-base) var(--ease), visibility var(--t-base); }
.overlay.is-open { opacity: 1; visibility: visible; }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto; border-radius: var(--r-lg); background: #fff; box-shadow: var(--sh-4); transform: translateY(12px) scale(.98); transition: transform var(--t-slow) var(--ease-out); }
.modal-lg { width: min(820px, 100%); }
.overlay.is-open .modal { transform: none; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 24px 0; }
.modal-title { font-size: 1.25rem; font-weight: 600; color: var(--navy-900); }
.modal-body { padding: 16px 24px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line-soft); background: var(--paper); }
.drawer-overlay { place-items: stretch end; padding: 0; }
.drawer { width: min(520px, 100vw); height: 100dvh; overflow: auto; background: #fff; box-shadow: var(--sh-4); transform: translateX(100%); transition: transform var(--t-slow) var(--ease-out); display: flex; flex-direction: column; }
.overlay.is-open .drawer { transform: none; }
.drawer-header { position: sticky; top: 0; background: #fff; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.drawer-body { padding: 24px; flex: 1; }
.drawer-footer { position: sticky; bottom: 0; background: #fff; padding: 16px 24px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; justify-content: flex-end; }
@media (max-width: 639px) { .overlay:not(.drawer-overlay) { place-items: end stretch; padding: 0; } .overlay:not(.drawer-overlay) .modal { border-radius: 20px 20px 0 0; width: 100%; max-height: 92dvh; transform: translateY(100%); } .overlay.is-open .modal { transform: none; } }

/* Avatars */
.avatar { --size: 40px; width: var(--size); height: var(--size); flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; font-size: calc(var(--size) * .38); font-weight: 600; letter-spacing: .02em; color: var(--navy-900); background: var(--blue-100); border: 1px solid rgba(10,26,61,.06); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { --size: 24px; } .avatar-sm { --size: 32px; } .avatar-md { --size: 40px; } .avatar-lg { --size: 56px; } .avatar-xl { --size: 88px; } .avatar-2xl { --size: 128px; }
.avatar-tone-0 { background: #E6EDFE; color: #15326B; } .avatar-tone-1 { background: #DDE8F8; color: #0F2552; }
.avatar-tone-2 { background: #E9E7FB; color: #2E2A6B; } .avatar-tone-3 { background: #E2EEF4; color: #123C52; }
.avatar-stack { display: flex; } .avatar-stack .avatar { border: 2px solid #fff; margin-left: -10px; } .avatar-stack .avatar:first-child { margin-left: 0; }

/* Stat / KPI */
.stat { display: grid; gap: 6px; }
.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.stat-value { font-family: var(--font-sans); font-weight: 600; font-size: clamp(1.625rem, 1.4rem + .8vw, 2.125rem); line-height: 1.05; letter-spacing: -0.025em; color: var(--navy-900); }
.stat-delta { font-size: var(--fs-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.stat-delta.up { color: var(--success-700); } .stat-delta.down { color: var(--danger-700); } .stat-delta.flat { color: var(--ink-500); }

/* Progress */
.progress { height: 8px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue-600); transition: width var(--t-slow) var(--ease-out); }
.progress.success > span { background: var(--success-600); } .progress.warning > span { background: var(--warning-600); } .progress.danger > span { background: var(--danger-600); }
.progress-thin { height: 4px; }
.ring { --p: 0; --size: 64px; --stroke: 6px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, #fff calc(100% - var(--stroke)), transparent calc(100% - var(--stroke) + 1px)), conic-gradient(var(--blue-600) calc(var(--p) * 1%), var(--mist) 0); font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); }

/* Stepper (applications & workflows) */
.stepper { display: flex; gap: 0; counter-reset: step; }
.step { flex: 1; position: relative; display: grid; gap: 8px; justify-items: start; padding-right: 12px; }
.step::before { counter-increment: step; content: counter(step); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-sm); font-weight: 600; border: 1.5px solid var(--line); background: #fff; color: var(--ink-500); position: relative; z-index: 1; }
.step::after { content: ''; position: absolute; top: 16px; left: 32px; right: 0; height: 1.5px; background: var(--line); }
.step:last-child::after { display: none; }
.step-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-500); }
.step-desc { font-size: var(--fs-xs); color: var(--ink-400); }
.step.is-done::before { content: '✓'; background: var(--success-600); border-color: var(--success-600); color: #fff; }
.step.is-done::after { background: var(--success-600); }
.step.is-current::before { background: var(--blue-600); border-color: var(--blue-600); color: #fff; box-shadow: 0 0 0 5px var(--blue-100); }
.step.is-current .step-title, .step.is-done .step-title { color: var(--navy-900); }
.step.is-declined::before { content: '×'; background: var(--danger-600); border-color: var(--danger-600); color: #fff; }
@media (max-width: 639px) { .stepper { flex-direction: column; gap: 18px; } .step { grid-template-columns: 32px 1fr; column-gap: 12px; } .step::before { grid-row: span 2; } .step::after { left: 15px; top: 32px; bottom: -18px; right: auto; width: 1.5px; height: auto; } }

/* Timeline (history, succession, activity) */
.timeline { position: relative; display: grid; gap: 0; }
.timeline-item { position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 14px; padding-bottom: 22px; }
.timeline-item::before { content: ''; position: absolute; left: 11px; top: 22px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--blue-50); border: 1px solid var(--blue-200); color: var(--blue-600); position: relative; z-index: 1; }
.timeline-dot .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.timeline-dot.success { background: var(--success-100); border-color: #BFE3D3; color: var(--success-700); }
.timeline-dot.danger { background: var(--danger-100); border-color: #F2C3BE; color: var(--danger-700); }
.timeline-dot.warning { background: var(--warning-100); border-color: #F2D9A6; color: var(--warning-700); }
.timeline-title { font-size: var(--fs-sm); font-weight: 600; color: var(--navy-900); }
.timeline-meta { font-size: var(--fs-xs); color: var(--ink-500); margin-top: 2px; }
.timeline-body { font-size: var(--fs-sm); color: var(--ink-600); margin-top: 6px; }

/* Definition lists / key-value */
.kv { display: grid; grid-template-columns: minmax(120px, 36%) 1fr; gap: 12px 20px; font-size: var(--fs-sm); }
.kv dt { color: var(--ink-500); }
.kv dd { color: var(--ink-900); font-weight: 500; overflow-wrap: anywhere; }
.kv-stack { display: grid; gap: 16px; }
.kv-stack dt { font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); }
.kv-stack dd { margin-top: 4px; color: var(--ink-900); }

/* Breadcrumbs & pagination */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--blue-600); }
.breadcrumbs .sep { color: var(--ink-300); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font-size: var(--fs-sm); color: var(--ink-500); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.page { min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--ink-800); font-weight: 600; border: 1px solid var(--line); background: #fff; transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast); }
.pagination span.page:not(.is-current) { border-color: transparent; background: transparent; color: var(--ink-400); }
.pagination a:hover, .pagination a:focus-visible { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-700); }
.pagination a:active { background: var(--blue-100); color: var(--blue-700); }
.pagination .pages .is-current, .pagination span.page.is-current { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.pagination .icon { color: currentColor; }

/* Empty, loading, error states */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(40px, 8vw, 72px) 24px; }
.empty-art { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(160deg, var(--blue-50), #fff); border: 1px solid var(--blue-100); color: var(--blue-500); margin-bottom: 6px; box-shadow: var(--sh-1); }
.empty-art .icon { width: 30px; height: 30px; stroke-width: 1.4; }
.empty-title { font-size: 1.0625rem; font-weight: 600; color: var(--navy-900); }
.empty-text { font-size: var(--fs-sm); color: var(--ink-500); max-width: 42ch; }
.skeleton { position: relative; overflow: hidden; background: var(--mist); border-radius: 6px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--blue-100); border-top-color: var(--blue-600); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tooltip */
[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px); padding: 6px 9px; border-radius: 6px; background: var(--navy-900); color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; pointer-events: none; opacity: 0; transition: all var(--t-fast); z-index: var(--z-dropdown); }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }

/* Kbd */
kbd, .kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; font-family: var(--font-sans); font-size: 11px; font-weight: 600; color: var(--ink-600); }

/* ─── Signature elements ─── */
/* Prism hairline: the logo's spectrum as a 2px line of identity */
.prism-line { height: 2px; background: var(--prism); border: 0; }
.prism-top { position: relative; }
.prism-top::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--prism); border-radius: inherit; }
/* Threefold braid rule — three interwoven strands as a divider */
.braid { display: block; width: 100%; height: 28px; color: var(--blue-300); }
.braid path { fill: none; stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.braid path:nth-child(2) { stroke: var(--blue-500); opacity: .9; }
.braid path:nth-child(3) { stroke: var(--navy-700); opacity: .55; }
.threefold-mark { width: 40px; height: 40px; }

/* Digital KIC ID card (shared by portal, admin, verification) */
.id-card { --w: 380px; position: relative; width: min(var(--w), 100%); aspect-ratio: 1.586; border-radius: 18px; overflow: hidden; color: #fff; isolation: isolate;
  background: radial-gradient(120% 90% at 100% 0%, #1F4FD6 0%, transparent 55%), radial-gradient(90% 90% at 0% 100%, #15326B 0%, transparent 60%), linear-gradient(160deg, #0A1A3D, #061131);
  box-shadow: 0 30px 60px -20px rgba(6,17,49,.55), 0 0 0 1px rgba(255,255,255,.06) inset; padding: 20px 22px; display: grid; grid-template-rows: auto 1fr auto; }
.id-card::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='250' viewBox='0 0 400 250'%3E%3Cg fill='none' stroke='%236C92F5' stroke-opacity='.22' stroke-width='.8'%3E%3Cpath d='M-20 170 C 80 60, 180 260, 280 120 S 420 40, 440 110'/%3E%3Cpath d='M-20 190 C 90 90, 190 250, 290 140 S 420 70, 440 140'/%3E%3Cpath d='M-20 210 C 100 120, 200 240, 300 160 S 420 100, 440 170'/%3E%3C/g%3E%3C/svg%3E"); background-size: cover; }
.id-card::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--prism); }
.id-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.id-card-brand { display: flex; align-items: center; gap: 10px; }
.id-card-brand img { width: 30px; height: 30px; }
.id-card-brand .t1 { font-size: 11px; font-weight: 700; letter-spacing: .22em; }
.id-card-brand .t2 { font-size: 8.5px; letter-spacing: .26em; opacity: .7; margin-top: 2px; }
.id-card-kind { font-size: 9px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; padding: 4px 8px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; }
.id-card-body { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: end; }
.id-card-photo { width: 64px; height: 76px; border-radius: 10px; overflow: hidden; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); display: grid; place-items: center; font-weight: 600; font-size: 20px; }
.id-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-card-name { font-family: var(--font-serif); font-size: 20px; line-height: 1.1; }
.id-card-role { font-size: 11px; color: var(--blue-300); margin-top: 3px; }
.id-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 10px; }
.id-card-field .k { font-size: 8px; letter-spacing: .18em; text-transform: uppercase; opacity: .6; }
.id-card-field .v { font-family: var(--font-mono); font-size: 12px; margin-top: 2px; }
.id-card-qr { width: 58px; height: 58px; padding: 4px; background: #fff; border-radius: 6px; }
.id-card-qr svg { width: 100%; height: 100%; }

@media (max-width: 480px) { .id-card { aspect-ratio: auto; min-height: 210px; gap: 14px; padding: 16px 18px 18px; } .id-card-name { font-size: 18px; } .id-card-qr { width: 54px; height: 54px; } }

/* QR codes */
.qr svg { width: 100%; height: auto; }
.qr-frame { display: inline-block; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-1); }

/* Charts (SVG, server-rendered) */
.chart { width: 100%; overflow: visible; }
.chart text { font-family: var(--font-sans); font-size: 11px; fill: var(--ink-500); }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-line { stroke: var(--line); }
.chart .series-line { fill: none; stroke: var(--blue-600); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-area { fill: url(#area-grad); }
.chart .series-dot { fill: #fff; stroke: var(--blue-600); stroke-width: 2; }
.chart-wrap { position: relative; }
.chart .bar { fill: var(--blue-600); }
.chart .bar-soft { fill: var(--blue-300); }
.chart .hit { cursor: crosshair; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; padding: 7px 10px; border-radius: 8px; background: var(--navy-900); color: #fff; font-size: 12px; line-height: 1.3; white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); box-shadow: var(--sh-2); }
.chart-tip strong { display: block; font-size: 13px; }
.chart-tip span { color: var(--blue-200); }
.chart-cursor { position: absolute; width: 1px; background: var(--line); pointer-events: none; }
.chart-empty { display: grid; justify-items: center; gap: 8px; padding: 36px 12px; color: var(--ink-400); font-size: var(--fs-sm); }
.chart-empty .icon { width: 28px; height: 28px; }
.comp-bar { display: flex; gap: 2px; height: 12px; border-radius: 6px; overflow: hidden; background: var(--mist); }
.comp-bar .seg { min-width: 3px; }
.tone-success { background: var(--success-600); } .tone-warning { background: #D69A2D; } .tone-danger { background: var(--danger-600); } .tone-neutral { background: var(--ink-300); } .tone-info { background: var(--blue-500); } .tone-navy { background: var(--navy-800); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart .bar-muted { fill: var(--blue-200); }
.chart .bar:hover { fill: var(--blue-700); }
.chart .value-label { fill: var(--navy-900); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--fs-xs); color: var(--ink-600); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bar-list { display: grid; gap: 12px; }
.bar-list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: var(--fs-sm); }
.bar-list-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.bar-list-row .track span { display: block; height: 100%; background: var(--blue-500); border-radius: inherit; }
.bar-list-row .v { font-weight: 600; color: var(--navy-900); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 36px; }
.spark path { fill: none; stroke: var(--blue-500); stroke-width: 1.6; }

/* View-as banner (Super Administrator viewing a member's portal) */
.viewas-bar { position: sticky; top: 0; z-index: calc(var(--z-header) + 5); display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 8px 16px; background: repeating-linear-gradient(135deg, #8A5306 0 12px, #A8660A 12px 24px); color: #fff; font-size: 13.5px; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.viewas-text { display: inline-flex; align-items: center; gap: 8px; }
.viewas-bar .mono { opacity: .85; font-size: 12.5px; }
body:has(.viewas-bar) .portal-header, body:has(.viewas-bar) .site-header { top: 38px; }

/* 7 ─ UTILITIES ────────────────────────────────────────────────────── */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; padding: 10px 16px; border-radius: 8px; background: var(--navy-900); color: #fff; font-weight: 600; }
.skip-link:focus { top: 12px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.w-full { width: 100%; } .mx-auto { margin-inline: auto; } .block { display: block; } .inline-flex { display: inline-flex; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); } .mt-10 { margin-top: var(--s-10); } .mt-12 { margin-top: var(--s-12); } .mt-16 { margin-top: var(--s-16); }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); } .mb-8 { margin-bottom: var(--s-8); }
.p-0 { padding: 0 !important; }
.flex-1 { flex: 1; min-width: 0; } .min-w-0 { min-width: 0; } .shrink-0 { flex-shrink: 0; }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.color-success { color: var(--success-700); } .color-warning { color: var(--warning-700); } .color-danger { color: var(--danger-700); } .color-blue { color: var(--blue-600); } .color-navy { color: var(--navy-900); }
.bg-paper { background: var(--paper); } .bg-mist { background: var(--mist); } .bg-linen { background: var(--linen); } .bg-white { background: #fff; } .bg-navy { background: var(--navy-900); color: #fff; }
.divider { height: 1px; background: var(--line-soft); margin: var(--s-6) 0; }
.hide-mobile { } .show-mobile { display: none !important; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } .show-mobile { display: revert !important; } }
.fw-400 { font-weight: 400; } .fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; }
.rounded { border-radius: var(--r-md); } .rounded-lg { border-radius: var(--r-lg); } .rounded-xl { border-radius: var(--r-xl); }
.ratio { position: relative; overflow: hidden; } .ratio > img, .ratio > picture, .ratio > picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ratio-16x9 { aspect-ratio: 16 / 9; } .ratio-3x2 { aspect-ratio: 3 / 2; } .ratio-4x5 { aspect-ratio: 4 / 5; } .ratio-1x1 { aspect-ratio: 1; } .ratio-21x9 { aspect-ratio: 21 / 9; }

/* 8 ─ FOCUS, MOTION & ACCESSIBILITY ──────────────────────────────── */
:focus-visible { outline: 2px solid var(--blue-500); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.on-dark :focus-visible { outline-color: var(--blue-300); }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: .08s; } .reveal-delay-2 { transition-delay: .16s; } .reveal-delay-3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
@media (forced-colors: active) { .btn, .badge, .card { border: 1px solid CanvasText; } }

/* 9 ─ PRINT ────────────────────────────────────────────────────────── */
@media print {
  .no-print, .site-header, .site-footer, .portal-nav, .admin-sidebar, .admin-topbar, .portal-tabbar, .toasts { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .card { box-shadow: none; border-color: #ccc; }
  .id-card { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
}
