/* Kola Finance main.css: docs/mockups/assets/portal.css moved here unchanged except for
   asset paths (../assets/), WOFF2 fonts, and the review-only mockup index block removed.
   App-only additions go in app.css, never here.
   Tokens first (values set for Kola Global; token names are the framework's), then components in BEM order.
   Client override: light mode only, so there are no dark-theme values. */

@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../assets/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter Display"; src: url("../assets/fonts/InterDisplay-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* Brand (from the Kola Global logo) */
  --brand-green: #65a693;
  --brand-navy: #2b4269;
  --brand-terracotta: #d95436;

  /* Green scale derived from --brand-green (hue 162) */
  --green-50: #f3f8f6;
  --green-100: #e6f0ec;
  --green-200: #cfe3dc;
  --green-300: #8ebeb0;
  --green-400: #65a693;
  --green-500: #528e7d;
  --green-600: #477b6c;
  --green-700: #3c675b;
  --green-800: #30554a;
  --green-900: #254139;

  /* Colour */
  --bg: #ffffff;
  --surface: #ffffff;
  --tint: var(--green-50);
  --tint-2: var(--green-100);
  --border: #d6e0dc;
  --border-strong: #8a96a4;          /* input borders: 3.0:1 on white */
  --ink: #1d2b47;                    /* 14.1:1 */
  --muted: #55627a;                  /* 6.2:1 on white, 5.7:1 on --tint */
  --primary: var(--green-700);       /* 6.4:1 on white */
  --primary-hover: var(--green-800);
  --primary-soft: var(--green-100);
  --primary-soft-text: var(--green-800); /* 7.2:1 on --primary-soft */
  --on-primary: #ffffff;
  --link: var(--green-700);
  --focus: var(--green-600);         /* 4.9:1, ring */
  --accent: var(--brand-terracotta); /* decoration only (4.0:1) */
  --accent-bg: #fbece7;
  --accent-text: #a63a1f;
  --success: #1f7a4d;
  --success-bg: #e7f3ec;
  --success-text: #1f6b45;
  --warning: #e08a00;                /* icons, borders and dots only */
  --warning-bg: #fdf1dc;
  --warning-text: #8a5300;
  --danger: #b42318;
  --danger-bg: #fbe9e7;
  --danger-text: #a3261c;
  --info: var(--brand-navy);
  --info-bg: #e8edf5;
  --info-text: var(--brand-navy);
  --glass: rgba(255, 255, 255, .8);

  /* Type */
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;
  --font-brand: "Inter Display", "Inter", "Segoe UI", Arial, sans-serif;
  --font-mono: Menlo, Consolas, monospace;
  --text-xs: 12px; --lh-xs: 16px;
  --text-sm: 13px; --lh-sm: 20px;
  --text-md: 15px; --lh-md: 24px;
  --text-lg: 18px; --lh-lg: 26px;
  --text-xl: 24px; --lh-xl: 32px;
  --text-2xl: 32px; --lh-2xl: 40px;

  /* Spacing, shape, depth, motion */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 24px; --space-6: 32px; --space-7: 48px; --space-8: 64px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(29, 43, 71, .06);
  --shadow-2: 0 12px 28px -14px rgba(29, 43, 71, .30);
  --duration: 150ms;
  --side-width: 240px;
  --list-width: 320px;
  --header-height: 60px;
  --control-height: 36px;
}

@media (prefers-reduced-motion: reduce) { :root { --duration: 0ms; } }
@media (pointer: coarse) { :root { --control-height: 44px; } }

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--text-md)/var(--lh-md) var(--font-body); font-feature-settings: "cv11"; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num, .table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: var(--text-sm); }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 16px; height: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: var(--space-4); top: -48px; z-index: 50; padding: var(--space-2) var(--space-3); background: var(--primary); color: var(--on-primary); border-radius: var(--radius-sm); }
.skip-link:focus { top: var(--space-3); }

/* App shell */
.shell { display: grid; grid-template-columns: var(--side-width) minmax(0, 1fr); min-height: 100vh; }
.shell__main { display: flex; flex-direction: column; min-width: 0; }
.content { width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--space-5) var(--space-6) var(--space-7); }
.content--wide { max-width: none; }

/* Side nav */
.sidenav { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--tint); border-right: 1px solid var(--border); }
.sidenav__brand { display: flex; align-items: center; flex: none; height: var(--header-height); padding: 0 var(--space-4); border-bottom: 1px solid var(--border); text-decoration: none; }
.sidenav__logo { height: 38px; width: auto; }
.sidenav__entity { margin: var(--space-3) var(--space-3) 0; }
.sidenav__scroll { flex: 1; overflow-y: auto; padding: var(--space-2) var(--space-3) var(--space-4); }
.sidenav__group { margin-top: var(--space-4); }
.sidenav__label { padding: 0 var(--space-2) var(--space-1); font-size: var(--text-xs); line-height: var(--lh-xs); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sidenav__list { list-style: none; margin: 0; padding: 0; }
.sidenav__link { position: relative; display: flex; align-items: center; gap: var(--space-2); min-height: 34px; padding: 0 var(--space-2); border-radius: var(--radius-sm); color: var(--ink); font-size: var(--text-sm); line-height: var(--lh-sm); text-decoration: none; transition: background var(--duration) ease-out; }
.sidenav__link .icon { color: var(--muted); }
.sidenav__link:hover { background: var(--tint-2); color: var(--ink); }
.sidenav__link--current { background: var(--surface); color: var(--primary-soft-text); font-weight: 600; box-shadow: var(--shadow-1); }
.sidenav__link--current::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.sidenav__link--current .icon { color: var(--primary); }
.sidenav__count { margin-left: auto; }
.sidenav__footer { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); line-height: var(--lh-sm); }
.sidenav__user { min-width: 0; flex: 1; }
.sidenav__user-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidenav__user-role { color: var(--muted); font-size: var(--text-xs); line-height: var(--lh-xs); }

/* Avatar */
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--brand-navy); color: #fff; font-size: var(--text-xs); font-weight: 600; }
.avatar--green { background: var(--green-700); }

/* Header */
.header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-4); height: var(--header-height); padding: 0 var(--space-6); background: var(--glass); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.header .header__menu { display: none; }
.header__crumbs { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.header__crumbs a { color: var(--muted); text-decoration: none; }
.header__crumbs a:hover { color: var(--ink); text-decoration: underline; }
.header__crumbs [aria-current] { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header__actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.header__search { position: relative; width: 300px; }
.header__search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.header__search input { width: 100%; height: var(--control-height); padding: 0 40px 0 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--text-sm); }
.header__search input::placeholder { color: var(--muted); }
.header__kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--tint); font: 600 11px/18px var(--font-body); color: var(--muted); text-align: center; }
.header__bell { position: relative; }
.header__dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font: 700 10px/16px var(--font-body); }

/* Page head */
.page-head { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-head__text { flex: 1; min-width: 0; }
.page-head__eyebrow { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.page-head__title { font: 700 var(--text-xl)/var(--lh-xl) var(--font-brand); color: var(--brand-navy); letter-spacing: -.01em; }
.page-head__sub { margin-top: var(--space-1); color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.page-head__facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); font-size: var(--text-sm); line-height: var(--lh-sm); }
.page-head__facts dt { color: var(--muted); }
.page-head__facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.page-head__fact { display: flex; flex-direction: column; }

/* Button */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-height); padding: 0 var(--space-4); border: 1px solid transparent; border-radius: var(--radius-sm); font-size: var(--text-sm); font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none; cursor: pointer; transition: background var(--duration) ease-out, border-color var(--duration) ease-out, color var(--duration) ease-out; }
.btn--primary { background: var(--primary); color: var(--on-primary); }
.btn--primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn--secondary:hover { background: var(--tint); color: var(--ink); }
.btn--quiet { background: transparent; color: var(--primary); }
.btn--quiet:hover { background: var(--primary-soft); color: var(--primary-soft-text); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #8f1c13; color: #fff; }
.btn--small { height: 30px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn--icon { width: var(--control-height); padding: 0; background: transparent; color: var(--muted); }
.btn--icon:hover { background: var(--tint-2); color: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--loading { position: relative; color: transparent !important; pointer-events: none; }
.btn--loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid var(--on-primary); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn--secondary.btn--loading::after { border-color: var(--primary); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Field */
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field__label { font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 600; }
.field__optional { font-weight: 400; color: var(--muted); }
.field__control { width: 100%; min-height: var(--control-height); padding: 6px var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--text-md); line-height: 22px; transition: border-color var(--duration) ease-out, box-shadow var(--duration) ease-out; }
.field__control:hover { border-color: var(--ink); }
.field__control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 0 0 4px var(--focus); }
.field__control[readonly], .field__control:disabled { background: var(--tint); color: var(--muted); border-color: var(--border); }
textarea.field__control { min-height: 96px; resize: vertical; }
select.field__control { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field__affix { display: flex; }
.field__affix .field__control { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.field__prefix { display: inline-flex; white-space: nowrap; align-items: center; padding: 0 var(--space-3); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--tint); color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.field__affix--suffix .field__control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.field__affix--suffix .field__prefix { border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.field__help { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.field__error { display: flex; gap: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--danger-text); }
.field--error .field__control { border-color: var(--danger); }
.field--error .field__control:focus { box-shadow: 0 0 0 2px var(--danger-bg), 0 0 0 4px var(--danger); }

/* Choice */
.choice { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-md); line-height: var(--lh-md); cursor: pointer; }
.choice input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--primary); flex: none; }
.choice__hint { display: block; font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.choice-group { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); padding: 0; margin: 0; border: 0; }
.choice-group legend { margin-bottom: var(--space-1); padding: 0; font-size: var(--text-sm); font-weight: 600; }
.choice--switch input { appearance: none; width: 36px; height: 20px; margin-top: 2px; border-radius: 10px; background: var(--border-strong); position: relative; cursor: pointer; transition: background var(--duration) ease-out; }
.choice--switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform var(--duration) ease-out; }
.choice--switch input:checked { background: var(--primary); }
.choice--switch input:checked::after { transform: translateX(16px); }

/* Segmented radio (radio cards) */
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--tint); }
.segmented__item { position: relative; }
.segmented__item input { position: absolute; opacity: 0; }
.segmented__item span { display: block; padding: 5px var(--space-4); border-radius: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--muted); cursor: pointer; }
.segmented__item input:checked + span { background: var(--surface); color: var(--primary-soft-text); box-shadow: var(--shadow-1); }
.segmented__item input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Lookup */
.lookup { position: relative; }
.lookup__list { position: absolute; z-index: 15; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: var(--space-1); list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.lookup__option { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: 6px; cursor: pointer; }
.lookup__option[aria-selected="true"], .lookup__option:hover { background: var(--primary-soft); }
.lookup__name { font-weight: 600; }
.lookup__meta { font-size: var(--text-sm); color: var(--muted); }
.lookup__selected { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }
.lookup__selected-text { flex: 1; min-width: 0; }

/* Chip */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: var(--text-sm); font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; }
a.chip:hover, button.chip:hover { border-color: var(--border-strong); background: var(--tint); color: var(--ink); }
.chip__count { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip--selected, a.chip--selected:hover { background: var(--primary-soft); border-color: var(--green-300); color: var(--primary-soft-text); }
.chip--selected .chip__count { color: var(--primary-soft-text); }
.chip--removable { padding-right: 4px; }
.chip__remove { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.chip__remove:hover { background: var(--tint-2); color: var(--ink); }

/* Badge (status) */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: var(--text-xs); line-height: 1; font-weight: 600; white-space: nowrap; background: var(--tint-2); color: var(--primary-soft-text); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--plain::before, .badge--count::before { display: none; }
.badge--count { min-width: 20px; height: 20px; justify-content: center; padding: 0 6px; background: var(--brand-navy); color: #fff; }
.badge--count-attention { background: var(--accent); }
.badge--success { background: var(--success-bg); color: var(--success-text); }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); }
.badge--warning::before { background: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger-text); }
.badge--info { background: var(--info-bg); color: var(--info-text); }
.badge--neutral { background: #eef1f4; color: var(--muted); }

/* Card */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.card__head { display: flex; align-items: center; gap: var(--space-3); min-height: 52px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.card__title { flex: 1; font-size: var(--text-md); line-height: var(--lh-md); font-weight: 600; }
.card__sub { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); font-weight: 400; }
.card__body { padding: var(--space-4); }
.card__body--flush { padding: 0; }
.card__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); }
.card--stat { padding: var(--space-4); }
.card--stat .card__label { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.card__value { margin-top: var(--space-1); font: 700 var(--text-2xl)/var(--lh-2xl) var(--font-brand); color: var(--brand-navy); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.card__value-unit { font-size: var(--text-md); font-weight: 600; color: var(--muted); margin-right: 2px; }
.card__delta { margin-top: var(--space-1); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.card__delta--up { color: var(--success-text); }
.card__delta--down { color: var(--danger-text); }
.card--side + .card--side { margin-top: var(--space-4); }
.card--accent { border-top: 3px solid var(--primary); }

/* Grid helpers */
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-5); align-items: start; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.stack > * + * { margin-top: var(--space-5); }
.stack--sm > * + * { margin-top: var(--space-3); }
.row { display: flex; align-items: center; gap: var(--space-2); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Key–value list */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv__num { font-variant-numeric: tabular-nums; }
.kv--stacked { grid-template-columns: 1fr; gap: 0; }
.kv--stacked dd { margin-bottom: var(--space-2); }

/* Sensitive value */
.secret { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.table th { position: sticky; top: 0; z-index: 1; padding: var(--space-2) var(--space-3); background: var(--tint); border-bottom: 1px solid var(--border); text-align: left; font-weight: 600; color: var(--muted); white-space: nowrap; }
.table th:first-child, .table td:first-child { padding-left: var(--space-4); }
.table th:last-child, .table td:last-child { padding-right: var(--space-4); }
.table td { padding: 10px var(--space-3); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--duration) ease-out; }
.table--clickable tbody tr { cursor: pointer; }
.table--clickable tbody tr:hover { background: var(--tint); }
.table__link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table__link:hover { color: var(--primary); text-decoration: underline; }
.table__meta { display: block; color: var(--muted); font-size: var(--text-xs); line-height: var(--lh-xs); }
.table__sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font-weight: 600; cursor: pointer; }
.table__sort[aria-sort] { color: var(--ink); }
.table--compact td { padding-top: 6px; padding-bottom: 6px; }
.table tfoot td { background: var(--tint); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.table__check { width: 40px; }
.table tr.is-selected { background: var(--primary-soft); }
.table-bar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--muted); }
.pager { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.pager__page { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 6px; color: var(--ink); text-decoration: none; font-variant-numeric: tabular-nums; }
.pager__page:hover { background: var(--tint-2); color: var(--ink); }
.pager__page[aria-current] { background: var(--primary); color: var(--on-primary); font-weight: 600; }

/* Toolbar above lists */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.toolbar__search { position: relative; width: 280px; }
.toolbar__search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar__search .field__control { padding-left: 34px; font-size: var(--text-sm); }

/* Tabs */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.tabs__tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: var(--space-2) var(--space-3) 10px; border: 0; background: none; color: var(--muted); font-size: var(--text-sm); font-weight: 600; text-decoration: none; cursor: pointer; }
.tabs__tab:hover { color: var(--ink); }
.tabs__tab[aria-selected="true"] { color: var(--primary-soft-text); }
.tabs__tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--space-2); right: var(--space-2); bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.tabs--card { margin: 0; padding: 0 var(--space-3); }

/* Stepper */
.steps { display: flex; margin: 0 0 var(--space-5); padding: 0; list-style: none; counter-reset: step; }
.steps__step { position: relative; flex: 1; display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }
.steps__step:not(:last-child)::after { content: ""; flex: 1; height: 2px; margin: 0 var(--space-3); background: var(--border); border-radius: 1px; }
.steps__marker { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); font-size: var(--text-xs); font-weight: 700; color: var(--muted); }
.steps__step--done { color: var(--ink); }
.steps__step--done .steps__marker { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.steps__step--done:not(:last-child)::after { background: var(--green-300); }
.steps__step--current { color: var(--ink); font-weight: 600; }
.steps__step--current .steps__marker { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* Checklist (closing steps) */
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); font-size: var(--text-sm); line-height: var(--lh-sm); }
.checklist__item:last-child { border-bottom: 0; }
.checklist__icon { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; }
.checklist__icon--done { background: var(--success-bg); color: var(--success-text); }
.checklist__icon--failed { background: var(--danger-bg); color: var(--danger-text); }
.checklist__icon--pending { background: #eef1f4; color: var(--muted); }
.checklist__text { flex: 1; min-width: 0; }
.checklist__title { font-weight: 600; }
.checklist__meta { color: var(--muted); font-size: var(--text-xs); line-height: var(--lh-xs); }
.checklist__meta--error { color: var(--danger-text); }
.checklist__amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* Calculation breakdown */
.calc { margin: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.calc__row { display: flex; justify-content: space-between; gap: var(--space-3); padding: 6px 0; }
.calc__row dt { color: var(--muted); }
.calc__row dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc__row--minus dd::before { content: "− "; color: var(--muted); }
.calc__row--total { margin-top: var(--space-1); padding-top: var(--space-2); border-top: 1px solid var(--border); font-weight: 700; }
.calc__row--total dt { color: var(--ink); }
.calc__row--total dd { color: var(--brand-navy); font-size: var(--text-md); }

/* Meter */
.meter { height: 6px; border-radius: 3px; background: var(--tint-2); overflow: hidden; }
.meter__bar { height: 100%; border-radius: 3px; background: var(--primary); }
.meter__bar--58 { width: 58%; } .meter__bar--71 { width: 71%; } .meter__bar--94 { width: 94%; } .meter__bar--100 { width: 100%; }

/* Banner */
.banner { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4); border: 1px solid; border-left-width: 4px; border-radius: var(--radius-sm); font-size: var(--text-sm); line-height: var(--lh-sm); }
.banner .icon { margin-top: 1px; }
.banner__text { flex: 1; }
.banner__title { font-weight: 600; }
.banner--info { background: var(--info-bg); border-color: #b9c6dc; border-left-color: var(--info); color: var(--info-text); }
.banner--success { background: var(--success-bg); border-color: #b5d8c4; border-left-color: var(--success); color: var(--success-text); }
.banner--warning { background: var(--warning-bg); border-color: #f2d39a; border-left-color: var(--warning); color: var(--warning-text); }
.banner--danger { background: var(--danger-bg); border-color: #f0bcb6; border-left-color: var(--danger); color: var(--danger-text); }
.banner .btn { margin-left: auto; }

/* Attention list (dashboard) */
.attention { margin: 0; padding: 0; list-style: none; }
.attention__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.attention__item:last-child { border-bottom: 0; }
.attention__icon { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary-soft-text); }
.attention__icon--warning { background: var(--warning-bg); color: var(--warning-text); }
.attention__icon--danger { background: var(--danger-bg); color: var(--danger-text); }
.attention__icon--info { background: var(--info-bg); color: var(--info-text); }
.attention__text { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: var(--lh-sm); }
.attention__title { font-weight: 600; color: var(--ink); }
.attention__meta { color: var(--muted); }

/* Activity */
.thread { margin: 0; padding: 0; list-style: none; }
.thread__item { position: relative; display: flex; gap: var(--space-3); padding: 0 0 var(--space-4); font-size: var(--text-sm); line-height: var(--lh-sm); }
.thread__item:not(:last-child)::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--border); }
.thread__dot { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary-soft-text); }
.thread__dot--warn { background: var(--warning-bg); color: var(--warning-text); }
.thread__dot--danger { background: var(--danger-bg); color: var(--danger-text); }
.thread__body { flex: 1; min-width: 0; }
.thread__who { font-weight: 600; }
.thread__when { color: var(--muted); font-size: var(--text-xs); }

/* Toast */
.toasts { position: fixed; right: var(--space-5); bottom: var(--space-5); z-index: 40; display: flex; flex-direction: column; gap: var(--space-2); }
.toast { display: flex; align-items: center; gap: var(--space-3); min-width: 300px; max-width: 420px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--ink); color: #fff; box-shadow: var(--shadow-2); font-size: var(--text-sm); line-height: var(--lh-sm); }
.toast__text { flex: 1; }
.toast .icon { color: var(--green-300); }
.toast--error { background: var(--danger); }
.toast--error .icon { color: #fff; }
.toast .btn--icon { color: #fff; }
.toast .btn--icon:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.toast__action { padding: 0; border: 0; background: none; color: #fff; font-weight: 600; text-decoration: underline; cursor: pointer; }
.toasts--static { position: static; }

/* Dialog */
.dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.dialog::backdrop { background: rgba(29, 43, 71, .45); }
.dialog__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4) var(--space-5); }
.dialog__title { flex: 1; font-size: var(--text-lg); line-height: var(--lh-lg); }
.dialog__body { padding: 0 var(--space-5) var(--space-4); color: var(--muted); font-size: var(--text-md); }
.dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); background: var(--tint); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.dialog--static { display: block; position: static; margin: 0; }

/* Menu */
.menu { position: relative; }
.menu__list { min-width: 220px; margin: 0; padding: var(--space-1); list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.menu__list--floating { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); }
.menu__list[hidden] { display: none; }
.menu__item { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2) var(--space-3); border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: var(--text-sm); text-align: left; text-decoration: none; cursor: pointer; }
.menu__item:hover, .menu__item:focus-visible { background: var(--tint); color: var(--ink); }
.menu__item--danger { color: var(--danger-text); }
.menu__item--danger:hover { background: var(--danger-bg); color: var(--danger-text); }
.menu__sep { height: 1px; margin: var(--space-1) 0; background: var(--border); }
.menu__heading { padding: var(--space-2) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* Entity switcher */
.entity-switch { display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; }
.entity-switch:hover { border-color: var(--border-strong); }
.entity-switch__mark { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 6px; background: var(--brand-navy); color: #fff; font-size: var(--text-xs); font-weight: 700; }
.entity-switch__text { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: 18px; }
.entity-switch__name { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-switch__meta { display: block; color: var(--muted); font-size: var(--text-xs); }

/* Empty state */
.empty { max-width: 480px; margin: var(--space-7) auto; text-align: center; }
.empty__art { width: 72px; height: 72px; margin: 0 auto var(--space-4); }
.empty__title { font: 700 var(--text-lg)/var(--lh-lg) var(--font-brand); color: var(--brand-navy); }
.empty__text { margin: var(--space-2) 0 var(--space-5); color: var(--muted); }
.empty__actions { display: flex; justify-content: center; gap: var(--space-2); }

/* Skeleton */
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--tint-2) 25%, var(--tint) 50%, var(--tint-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton--w40 { width: 40%; } .skeleton--w60 { width: 60%; } .skeleton--w80 { width: 80%; }
.skeleton--card { height: 96px; border-radius: var(--radius-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Error state */
.error { max-width: 520px; margin: var(--space-8) auto; text-align: center; }
.error__code { display: inline-block; margin-bottom: var(--space-3); font: 700 var(--text-sm)/1 var(--font-body); letter-spacing: .08em; color: var(--accent-text); text-transform: uppercase; }
.error__title { font: 700 var(--text-xl)/var(--lh-xl) var(--font-brand); color: var(--brand-navy); }
.error__text { margin: var(--space-3) 0 var(--space-5); color: var(--muted); }
.error__ref { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--muted); }
.error--inline { margin: 0; text-align: left; }

/* Rich text editor (compact) */
.editor { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.editor__bar { display: flex; gap: 2px; padding: var(--space-1); border-bottom: 1px solid var(--border); background: var(--tint); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.editor__btn { display: inline-grid; place-items: center; width: 30px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-weight: 700; cursor: pointer; }
.editor__btn:hover { background: var(--tint-2); color: var(--ink); }
.editor__area { min-height: 96px; padding: var(--space-2) var(--space-3); }

/* Form layout */
.form { max-width: 720px; }
.form__section { padding: var(--space-5); }
.form__section + .form__section { border-top: 1px solid var(--border); }
.form__section-title { font-size: var(--text-md); font-weight: 600; }
.form__section-sub { margin: 2px 0 var(--space-4); font-size: var(--text-sm); color: var(--muted); }
.form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form__full { grid-column: 1 / -1; }
.action-bar { position: sticky; bottom: 0; z-index: 10; display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-5); padding: var(--space-3) var(--space-4); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-2); }
.action-bar__note { flex: 1; font-size: var(--text-sm); color: var(--muted); }

/* Sign-in */
.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth__brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: var(--space-7); background: var(--brand-navy); color: #fff; overflow: hidden; }
.auth__brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; background: url("../assets/brand/kola-mark.png") center / contain no-repeat; opacity: .14; }
.auth__logo { width: 72px; height: 72px; padding: 8px; border-radius: 50%; background: #fff; }
.auth__pitch { position: relative; z-index: 1; max-width: 420px; }
.auth__kicker { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--green-200); }
.auth__kicker::before { content: ""; width: 24px; height: 3px; border-radius: 2px; background: var(--accent); }
.auth__headline { margin-top: var(--space-3); font: 700 var(--text-2xl)/var(--lh-2xl) var(--font-brand); letter-spacing: -.01em; }
.auth__copy { margin-top: var(--space-3); color: #d7deea; }
.auth__legal { position: relative; z-index: 1; font-size: var(--text-xs); color: #b8c3d6; }
.auth__panel { display: grid; place-items: center; padding: var(--space-6); background: var(--tint); }
.auth__card { width: 100%; max-width: 400px; padding: var(--space-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.auth__wordmark { height: 40px; width: auto; margin-bottom: var(--space-5); }
.auth__title { font: 700 var(--text-xl)/var(--lh-xl) var(--font-brand); color: var(--brand-navy); }
.auth__sub { margin: var(--space-1) 0 var(--space-5); color: var(--muted); font-size: var(--text-sm); }
.auth__help { margin-top: var(--space-5); font-size: var(--text-sm); color: var(--muted); text-align: center; }

/* Components page */
.specimen { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
.swatch { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; font-size: var(--text-xs); line-height: var(--lh-xs); }
.swatch__chip { height: 52px; }
.swatch__info { padding: var(--space-2); }
.swatch__name { font-weight: 600; font-family: var(--font-mono); }
.sw-green-50 { background: var(--green-50); } .sw-green-100 { background: var(--green-100); } .sw-green-200 { background: var(--green-200); }
.sw-green-300 { background: var(--green-300); } .sw-green-400 { background: var(--green-400); } .sw-green-500 { background: var(--green-500); }
.sw-green-600 { background: var(--green-600); } .sw-green-700 { background: var(--green-700); } .sw-green-800 { background: var(--green-800); }
.sw-green-900 { background: var(--green-900); } .sw-navy { background: var(--brand-navy); } .sw-terracotta { background: var(--brand-terracotta); }
.sw-ink { background: var(--ink); } .sw-muted { background: var(--muted); } .sw-border { background: var(--border); } .sw-border-strong { background: var(--border-strong); }
.sw-success { background: var(--success); } .sw-warning { background: var(--warning); } .sw-danger { background: var(--danger); } .sw-info { background: var(--info); }
.type-sample + .type-sample { margin-top: var(--space-3); }
.t-2xl { font: 700 var(--text-2xl)/var(--lh-2xl) var(--font-brand); color: var(--brand-navy); }
.t-xl { font: 700 var(--text-xl)/var(--lh-xl) var(--font-brand); color: var(--brand-navy); }
.t-lg { font-size: var(--text-lg); line-height: var(--lh-lg); font-weight: 600; }
.t-md { font-size: var(--text-md); line-height: var(--lh-md); }
.t-sm { font-size: var(--text-sm); line-height: var(--lh-sm); }
.t-xs { font-size: var(--text-xs); line-height: var(--lh-xs); }
.section-title { margin: var(--space-6) 0 var(--space-3); font: 700 var(--text-lg)/var(--lh-lg) var(--font-brand); color: var(--brand-navy); }

/* Responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidenav { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--side-width); transform: translateX(-100%); transition: transform var(--duration) ease-out; }
  .shell--nav-open .sidenav { transform: none; box-shadow: var(--shadow-2); }
  .header .header__menu { display: inline-flex; }
  .header { padding: 0 var(--space-4); }
  .header__search { width: 200px; }
  .content { padding: var(--space-4); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__brand { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .field__control { font-size: 16px; }
  .header__search { display: none; }
  .stats, .stats--4 { grid-template-columns: minmax(0, 1fr); }
  .attention__item { flex-wrap: wrap; }
  .attention__text { flex: 1 1 calc(100% - 44px); }
  .attention__item .btn { margin-left: 44px; }
  .split--even { grid-template-columns: minmax(0, 1fr); }
  .page-head { flex-direction: column; }
  .form__grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar__search { width: 100%; }
  .hide-phone { display: none; }
}

/* Forced states for the components page */
.btn--primary.is-hover { background: var(--primary-hover); }
.btn--secondary.is-hover { background: var(--tint); }
.is-focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.meter__bar--95 { width: 95%; } .meter__bar--96 { width: 96%; }

/* Fixes from screenshot review */
.table .mono, .table td.mono { white-space: nowrap; }
.table__col-name { min-width: 300px; }
.table-bar .field__control { width: auto; min-height: 30px; padding-top: 2px; padding-bottom: 2px; font-size: var(--text-sm); }
.form__section .banner { margin: var(--space-4) 0 0; }
.card__body--sm { font-size: var(--text-sm); line-height: var(--lh-sm); }
.card__value-unit { font-family: var(--font-body); }
.stats--4 .card__value { font-size: var(--text-2xl); }
