/* Explora design system ("Clear Desk") — the only stylesheet. See DESIGN.md. */
:root {
  /* Palette — "Clear Desk": a neutral (zinc) gray ramp, a clear-blue interaction
     ramp, amber kept as the Pena data colour, and status ramps. Components use the semantic tokens below. */
  --gray-25: #FCFCFC;
  --gray-50: #FAFAFA;
  --gray-100: #F4F4F5;
  --gray-200: #E4E4E7;
  --gray-300: #D4D4D8;
  --gray-400: #A1A1AA;
  --gray-500: #71717A;
  --gray-600: #52525B;
  --gray-700: #3F3F46;
  --gray-800: #27272A;
  --gray-900: #18181B;
  --amber-25: #FFFCF5;
  --amber-50: #FFFAEB;
  --amber-100: #FEF0C7;
  --amber-200: #FEDF89;
  --amber-300: #FEC84B;
  --amber-500: #F79009;
  --amber-600: #C2540A;
  --amber-700: #B54708;
  --amber-800: #93370D;
  --amber-900: #7A2E0E;
  /* brand = clear blue: links, active tab, focus, selection. Primary buttons are ink. */
  --brand-25: #F5F8FF;
  --brand-50: #EFF4FF;
  --brand-100: #DBE6FE;
  --brand-200: #BFD3FE;
  --brand-300: #93B4FD;
  --brand-500: #3B82F6;
  --brand-600: #2563EB;
  --brand-700: #1D4ED8;
  --brand-800: #1E40AF;
  --brand-900: #1E3A8A;
  --success-50: #ECFDF3; --success-200: #ABEFC6; --success-500: #17B26A; --success-700: #067647; --success-800: #085D3A;
  --error-50: #FEF3F2; --error-200: #FECDCA; --error-500: #F04438; --error-700: #B42318; --error-800: #912018;
  --blue-50: #EFF8FF; --blue-200: #B2DDFF; --blue-500: #2E90FA; --blue-700: #175CD3;
  --white: #FFFFFF;
  --vertical-pena: var(--amber-500);
  --vertical-mitraedu: var(--blue-500);
  --fg-disabled: var(--gray-300);
  --border-hover: var(--gray-400);
  --action-primary: var(--gray-900); --action-primary-hover: var(--gray-800); --action-primary-pressed: var(--gray-700);
  --action-secondary: var(--brand-50); --action-secondary-hover: var(--brand-100); --action-secondary-pressed: var(--brand-200);
  --action-ghost-hover: var(--gray-50); --action-ghost-pressed: var(--gray-100);
  --action-success: var(--success-700); --action-success-hover: var(--success-800); --action-success-pressed: var(--success-800);
  --action-danger: var(--error-700); --action-danger-hover: var(--error-800); --action-danger-pressed: var(--error-800);
  --bg-muted: var(--gray-100);
  --focus-ring: var(--brand-100);
  --overlay: rgba(24, 24, 27, .45);
  /* deal stages — categorical */
  --stage-lead: var(--gray-400);
  --stage-sql: var(--blue-500);
  --stage-proposal: var(--amber-500);
  --stage-won: var(--success-500);
  --stage-lost: var(--error-500);
  --stage-parked: #7A5AF8;
  /* task priority */
  --priority-high: var(--status-error);
  --priority-medium: var(--amber-500);
  --priority-low: var(--status-success);
  --fg-1: var(--gray-900);
  --fg-2: var(--gray-700);
  --fg-3: var(--gray-600);
  --fg-4: var(--gray-500);
  --fg-brand: var(--brand-700);
  --fg-accent: var(--brand-700);
  --fg-on-navy: #FFFFFF;
  --fg-on-orange: #FFFFFF;
  --bg-page: #FFFFFF;
  --bg-soft: var(--gray-50);
  --bg-warm: var(--brand-25);
  --bg-sidebar: var(--brand-25);
  /* shell rhythm: the header band ends where the first nav item starts (rail 20 + brand 32 + gap 24 = 76px):
     12px pad + crumb step 22 + 30px title + 12px pad = 76 */
  --head-pad: 12px;
  --crumb-step: 22px; /* crumb line 20px + 2px gap */
  --border-subtle: var(--gray-300);
  --border-soft: var(--gray-200);
  --border-warm: var(--brand-200);
  --status-info: var(--blue-700);
  --status-info-bg: var(--blue-50);
  --status-success: var(--success-700);
  --status-success-bg: var(--success-50);
  --status-warning: var(--amber-700);
  --status-warning-bg: var(--amber-25);
  --status-error: var(--error-700);
  --status-error-bg: var(--error-50);

  --font-sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* one face only (Geist); display/mono are aliases kept for intent */
  --font-display: var(--font-sans);
  --font-mono: var(--font-sans);
  --text-display: 30px; --text-h1: 22px; --text-h2: 16px; --text-h3: 16px; --text-stat: 24px;
  --text-body: 14px; --text-label: 14px; --text-cell: 13px; --text-caption: 12px; --text-micro: 11px;
  /* text styles: complete font shorthands (weight size/line-height family) */
  --type-display: 600 var(--text-display)/38px var(--font-sans);
  --type-h1: 600 var(--text-h1)/30px var(--font-sans);
  --type-h2: 600 var(--text-h2)/24px var(--font-sans);
  --type-h3: 600 var(--text-h3)/24px var(--font-sans);
  --type-stat: 600 var(--text-stat)/32px var(--font-sans);
  --type-cell: 400 var(--text-cell)/20px var(--font-sans);
  --type-cell-strong: 500 var(--text-cell)/20px var(--font-sans);
  --type-body: 400 var(--text-body)/1.5 var(--font-sans);
  --type-body-strong: 500 var(--text-body)/1.5 var(--font-sans);
  --type-label: 500 var(--text-label)/20px var(--font-sans);
  --type-label-strong: 500 var(--text-label)/20px var(--font-sans);
  --type-label-bold: 500 var(--text-label)/20px var(--font-sans);
  --type-caption: 400 var(--text-caption)/18px var(--font-sans);
  --type-caption-strong: 500 var(--text-caption)/18px var(--font-sans);
  --type-eyebrow: 500 var(--text-caption)/18px var(--font-sans);
  --type-badge: 500 var(--text-caption)/18px var(--font-sans);
  --type-num-caption: 500 var(--text-caption)/18px var(--font-sans);
  --type-num-label: 500 var(--text-label)/20px var(--font-sans);
  --type-lede: 400 var(--text-body)/22px var(--font-sans);
  --type-brand: 600 var(--text-h3)/20px var(--font-sans);
  --type-nav-sec: 500 var(--text-micro)/16px var(--font-sans);
  --type-crumb: 400 var(--text-cell)/20px var(--font-sans);
  --type-crumb-strong: 500 var(--text-cell)/20px var(--font-sans);
  --ls-display: -0.015em;
  --ls-h1: -0.01em;
  --ls-h2: 0;
  --ls-eyebrow: 0.04em;
  --ls-nav-sec: 0.06em;
  --ls-badge: 0;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 28px; --s-8: 32px;
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(24,24,27,.04);
  --shadow-sm: 0 2px 6px rgba(24,24,27,.06), 0 1px 2px rgba(24,24,27,.04);
  --shadow-md: 0 12px 24px -6px rgba(24,24,27,.10), 0 4px 8px -4px rgba(24,24,27,.05);
  --dur-fast: 120ms; --dur-base: 180ms; --dur-slow: 260ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-lg: 0 24px 48px -12px rgba(24,24,27,.20);
}
* { box-sizing: border-box; }
/* an author display rule beats the browser's [hidden]; restate it once for every element */
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-page);
  color: var(--fg-1);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased;
}
body { display: flex; min-height: 100vh; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
h1 { font: var(--type-h1); letter-spacing: var(--ls-h1); }
h2 { font: var(--type-h2); letter-spacing: var(--ls-h2); }
h3 { font: var(--type-h3); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
::selection { background: var(--brand-100); color: var(--fg-1); }
:where(input, textarea) { caret-color: var(--brand-600); }

/* ==== Atoms ==== */

/* Button — .btn + .primary | .secondary | .outline | .ghost | .success | .danger,
   optional .sm and .is-loading. Icons: an <svg> before and/or after the label. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: 36px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--r-sm);
  font: var(--type-label-strong);
  white-space: nowrap; text-decoration: none; cursor: pointer; background: transparent; color: var(--fg-1);
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn svg, .btn .icon { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-xs), 0 0 0 4px var(--focus-ring); }
.btn.htmx-request { opacity: .7; cursor: progress; }
.btn.is-loading { cursor: progress; }
.btn.is-loading::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: btn-spin .8s linear infinite; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn.primary { background: var(--action-primary); border-color: var(--action-primary); color: var(--white); box-shadow: var(--shadow-xs); }
.btn.primary:hover { background: var(--action-primary-hover); border-color: var(--action-primary-hover); }
.btn.primary:active { background: var(--action-primary-pressed); }
.btn.secondary { background: var(--action-secondary); border-color: var(--brand-200); color: var(--brand-700); box-shadow: var(--shadow-xs); }
.btn.secondary:hover { background: var(--action-secondary-hover); }
.btn.secondary:active { background: var(--action-secondary-pressed); }
.btn.outline { background: var(--bg-page); border-color: var(--border-subtle); color: var(--fg-2); box-shadow: var(--shadow-xs); }
.btn.outline:hover { background: var(--bg-soft); color: var(--gray-800); }
.btn.outline:active, .btn.ghost:active { background: var(--action-ghost-pressed); }
.btn.ghost { color: var(--fg-3); }
.btn.ghost:hover { color: var(--fg-2); }
.btn.ghost:hover { background: var(--action-ghost-hover); }
.btn.success { background: var(--action-success); color: var(--white); }
.btn.success:hover { background: var(--action-success-hover); }
.btn.success:active { background: var(--action-success-pressed); }
.btn.danger { background: var(--action-danger); color: var(--white); }
.btn.danger:hover { background: var(--action-danger-hover); }
.btn.danger:active { background: var(--action-danger-pressed); }
.btn.ghost.danger { background: transparent; color: var(--status-error); }
.btn.ghost.danger:hover { background: var(--status-error-bg); }
/* disabled after the variants so it wins over their colours */
.btn:disabled, .btn:disabled:hover, .btn[aria-disabled="true"] { background: var(--gray-100); border-color: var(--gray-200); color: var(--gray-400); box-shadow: none; cursor: not-allowed; }
.btn[aria-disabled="true"] { pointer-events: none; }
.btn.ghost:disabled, .btn.ghost:disabled:hover, .btn.ghost[aria-disabled="true"], .btn.ghost.danger:disabled { background: transparent; color: var(--gray-300); }
.btn.sm { height: 30px; padding: 0 10px; gap: 6px; font: var(--type-label-strong); border-radius: var(--r-sm); }
.btn.sm svg, .btn.sm .icon { width: 16px; height: 16px; }

/* Badge — pill + .navy (info blue) | .neutral | .success | .warning | .error | .orange */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; border: 1px solid var(--gray-200); border-radius: var(--r-xs); white-space: nowrap;
  font: var(--type-badge); background: var(--gray-50); color: var(--gray-700);
}
/* tones stay neutral tags: the colour lives only in the leading dot */
.badge.navy::before, .badge.success::before, .badge.warning::before, .badge.orange::before, .badge.error::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); flex: none; }
.badge.navy::before { background: var(--blue-500); }
.badge.success::before { background: var(--success-500); }
.badge.warning::before, .badge.orange::before { background: var(--amber-500); }
.badge.error::before { background: var(--error-500); }

/* Bentuk — school form (SD, MI, TK, …) in a list cell; tone from Institution.BentukTone */
.bentuk { display: inline-flex; justify-content: center; min-width: 32px; padding: 1px 6px; border-radius: var(--r-xs); font: var(--type-caption-strong); white-space: nowrap; background: var(--gray-100); color: var(--gray-700); }

/* Dot — .dot + a stage, priority or vertical tone */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: var(--r-pill); flex: none; background: var(--gray-300); }
.dot.lead { background: var(--stage-lead); }
.dot.sql { background: var(--stage-sql); }
.dot.proposal { background: var(--stage-proposal); }
.dot.won { background: var(--stage-won); }
.dot.lost { background: var(--stage-lost); }
.dot.parked { background: var(--stage-parked); }
.dot.high { background: var(--priority-high); }
.dot.medium { background: var(--priority-medium); }
.dot.low { background: var(--priority-low); }
.dot.pena { background: var(--vertical-pena); }
.dot.mitraedu { background: var(--vertical-mitraedu); }

/* Pill — static rounded label, optional leading .dot; .pill .k/.v for key-value chips */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--r-pill);
  font: var(--type-caption-strong); background: var(--bg-muted); color: var(--fg-2);
}
.pill .k { font: var(--type-eyebrow); letter-spacing: var(--ls-badge); text-transform: uppercase; color: var(--fg-3); }
.pill .v { color: var(--fg-1); }

/* Chip — toggleable square token (BANT letters, filter toggles); .on when active */
.chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; padding: 0 6px; border: 1px dashed var(--border-subtle); border-radius: var(--r-xs);
  background: var(--bg-page); color: var(--fg-4); font: var(--type-num-label); font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:hover { border-color: var(--gray-400); color: var(--fg-2); }
.chip.on, .chip.on:hover { border-style: solid; border-color: var(--success-200); background: var(--success-50); color: var(--success-700); }
.chip:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }

/* Avatar — initials disc; .sm (22px) in rows and filters, default 28px, .lg (32px) in headers */
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-pill);
  background: var(--brand-100); color: var(--brand-800); font: var(--type-eyebrow);
}
.avatar.sm { width: 22px; height: 22px; }
.avatar.lg { width: 32px; height: 32px; font: var(--type-caption); }

/* Form controls — class-less controls only, at zero specificity: a component
   that classes its control owns its whole look. */
:where(input:not([class], [type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit]), select:not([class]), textarea:not([class]),
  .field input[type=file], .input-error, .menu-search, .pagesize-select,
  /* htmx adds these to a class-less control while a request runs or a swap settles */
  input[class="htmx-request"]:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit]), select[class="htmx-request"], textarea[class="htmx-request"],
  input[class="htmx-added"]:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit]), select[class="htmx-added"], textarea[class="htmx-added"],
  input[class="htmx-settling"]:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit]), select[class="htmx-settling"], textarea[class="htmx-settling"],
  input[class="htmx-swapping"]:not([type=checkbox], [type=radio], [type=file], [type=hidden], [type=submit]), select[class="htmx-swapping"], textarea[class="htmx-swapping"]) {
  height: 36px; padding: 0 12px; border: 1px solid var(--border-subtle); border-radius: var(--r-sm);
  background: var(--bg-page); color: var(--fg-1); font: var(--type-body); box-shadow: var(--shadow-xs);
}
:where(input, textarea)::placeholder { color: var(--fg-4); }
:where(textarea:not([class])) { height: auto; padding: 10px 14px; resize: vertical; min-height: 70px; }
:where(h1, h2, h3) > .badge { margin-left: var(--s-2); }
:where(input, select, textarea):focus-visible { outline: none; border-color: var(--brand-300); box-shadow: var(--shadow-xs), 0 0 0 4px var(--focus-ring); }
:where(input[type=checkbox], input[type=radio]) { accent-color: var(--brand-600); }
:where(.field input:not([type=checkbox], [type=radio]), .field select, .field textarea) { width: 100%; }

/* Bar — data bar for market breakdowns; width is the one inline style: <span class="bar"><span class="bar-fill navy" style="width:42.0%"></span></span> */
.bar { display: block; height: 6px; border-radius: var(--r-pill); background: var(--bg-muted); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--brand-600); }
.bar-fill.orange { background: var(--amber-500); }
.bar-fill.success { background: var(--status-success); }
.bar-fill.error { background: var(--status-error); }
.period-row { margin-bottom: var(--s-4); }
.event-meta { display: flex; flex-direction: column; gap: 2px; max-width: 420px; font: var(--type-caption); overflow-wrap: anywhere; }
.modal.wide { width: 1180px; }
.device-modal { display: flex; flex-direction: column; gap: var(--s-5); }
.device-modal h3 { margin: 0 0 var(--s-3); }
.device-modal-detail, .device-modal-list { padding: var(--s-4) var(--s-5); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.device-modal-detail { background: var(--bg-soft); }
.fact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--s-4) var(--s-5); margin: 0; }
.fact { min-width: 0; }
.fact.wide { grid-column: span 2; }
.fact dt { font: var(--type-caption); color: var(--fg-3); }
.fact dd { margin: 2px 0 0; font: var(--type-label-strong); color: var(--fg-1); overflow-wrap: anywhere; }
@media (max-width: 520px) { .fact.wide { grid-column: auto; } }
.bar-table td:last-child { width: 40%; min-width: 64px; }

/* Day columns — daily counts as a column chart; height is the one inline style: <span class="day-col" title="…"><span style="height:42.0%"></span></span> */
.day-cols { display: flex; align-items: stretch; gap: 3px; height: 120px; }
.day-col { flex: 1 1 0; display: flex; flex-direction: column; justify-content: flex-end; }
.day-cols.dense { gap: 1px; }
.day-col > span { display: block; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--brand-600); }
.day-col.today > span { background: var(--amber-500); }
.day-axis { display: flex; justify-content: space-between; margin-top: var(--s-2); font: var(--type-caption); color: var(--fg-3); }

/* Pill toggle — rounded selectable label (composer type, activity filter). Radio/checkbox inside, or a link with .on */
.pill-toggle {
  position: relative; display: inline-flex; align-items: center; gap: var(--s-1); height: 25px; padding: 0 9px;
  border: 1px solid var(--border-subtle); border-radius: var(--r-pill); background: var(--bg-page); color: var(--fg-2);
  font: var(--type-caption-strong); cursor: pointer; user-select: none;
}
.pill-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill-toggle:hover { border-color: var(--border-hover); }
.pill-toggle.on, .pill-toggle:has(input:checked) { border-color: var(--amber-200); background: var(--amber-50); color: var(--amber-800); }
.pill-toggle:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus-ring); }

/* Check circle — the done toggle of a checklist row (circle = done, square checkbox = select).
   .done when ticked; .ring shows a quantity item's progress from the inherited --pct (0..100). */
.check-circle {
  display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; padding: 0;
  border: 1.5px solid var(--gray-300); border-radius: var(--r-pill); background: var(--bg-page); color: var(--white); cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.check-circle svg { width: 12px; height: 12px; opacity: 0; transform: scale(.6); transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.check-circle:hover:not(:disabled) { border-color: var(--gray-400); }
.check-circle:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); }
.check-circle.done { border-color: var(--status-success); background: var(--status-success); }
.check-circle.done:hover:not(:disabled) { border-color: var(--action-success-hover); background: var(--action-success-hover); }
.check-circle.done svg { opacity: 1; transform: none; }
.check-circle.ring {
  border-color: transparent; background-origin: border-box;
  background-image: radial-gradient(closest-side, var(--bg-page) 68%, transparent 70%), conic-gradient(var(--status-success) calc(var(--pct, 0) * 1%), var(--gray-300) 0);
}
.check-circle:disabled { opacity: .5; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) { .check-circle, .check-circle svg { transition: none; } }

/* Link — text action (card actions, "Lihat detail lengkap"); .accent | .muted | .danger */
.link { display: inline-flex; align-items: center; gap: var(--s-1); padding: 0; border: 0; background: none; color: var(--fg-brand); font: var(--type-label-strong); cursor: pointer; text-decoration: none; }
.link:hover { color: var(--brand-800); }
.link.accent { color: var(--fg-accent); }
.link.muted { color: var(--fg-3); }
.link.danger { color: var(--status-error); }
.link svg, .link .icon { width: 16px; height: 16px; }

/* Priority — P1/P2/P3 marker on deal cards */
.priority { font: var(--type-eyebrow); letter-spacing: var(--ls-eyebrow); color: var(--fg-1); }
.priority.p1 { color: var(--priority-high); }
.priority.p2 { color: var(--brand-700); }
.priority.p3 { color: var(--fg-3); }

/* Code badge — NPSN, kode PT, bentuk, strata */
.code { display: inline-flex; align-items: center; padding: 1px var(--s-2); border: 1px solid var(--border-soft); border-radius: var(--r-xs); background: var(--bg-soft); color: var(--fg-2); font: var(--type-caption-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Skeleton — one-line lazy placeholder */
.skeleton { display: block; height: 10px; border-radius: var(--r-xs); background: var(--bg-muted); }
.skeleton.block { height: 64px; border-radius: var(--r-md); }

/* Stage pill — dot + stage label; tone class is the stage key */
.stage { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 7px; border: 1px solid var(--gray-200); border-radius: var(--r-xs); background: var(--bg-page); font: var(--type-caption-strong); color: var(--fg-2); white-space: nowrap; }
.stage::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--gray-300); flex: none; }
.stage.lead::before { background: var(--stage-lead); }
.stage.sql::before { background: var(--stage-sql); }
.stage.proposal::before { background: var(--stage-proposal); }
.stage.won::before { background: var(--stage-won); }
.stage.lost::before { background: var(--stage-lost); }
.stage.parked::before { background: var(--stage-parked); }

/* Text */
.mono { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--fg-3); }
.eyebrow { font: var(--type-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-3); }

/* ==== Type utilities — one-offs in templates; components use the tokens ==== */
.t-display { font: var(--type-display); letter-spacing: var(--ls-display); }
.t-h1 { font: var(--type-h1); letter-spacing: var(--ls-h1); }
.t-h2 { font: var(--type-h2); letter-spacing: var(--ls-h2); }
.t-h3 { font: var(--type-h3); }
.t-body { font: var(--type-body); }
.t-body-strong { font: var(--type-body-strong); }
.t-label { font: var(--type-label); }
.t-label-strong { font: var(--type-label-strong); }
.t-label-bold { font: var(--type-label-bold); }
.t-caption { font: var(--type-caption); }
.t-caption-strong { font: var(--type-caption-strong); }
.t-eyebrow { font: var(--type-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.t-badge { font: var(--type-badge); letter-spacing: var(--ls-badge); text-transform: uppercase; }
.t-num-caption { font: var(--type-num-caption); font-variant-numeric: tabular-nums; }
.t-num-label { font: var(--type-num-label); font-variant-numeric: tabular-nums; }
.fg-1 { color: var(--fg-1); }
.fg-2 { color: var(--fg-2); }

/* ==== Layout utilities — one-offs only; three uses of a combination make a component ==== */
.row { display: flex; align-items: center; gap: var(--s-2); }
.right > .row { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: var(--s-2); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.flush { margin: 0; }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); }
.right { text-align: right; } .shrink { width: 1%; white-space: nowrap; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.italic { font-style: italic; }
.upper { text-transform: uppercase; }

/* ==== Molecules ==== */

/* Field — label + control (+ .hint). Controls are styled by the form-control atom. */
.field { margin-bottom: var(--s-4); }
.field > label { display: block; margin-bottom: 6px; font: var(--type-label); color: var(--fg-2); }
.field .val { font: var(--type-label); }
.hint { margin-top: var(--s-1); font: var(--type-caption); color: var(--fg-3); }
.hint.error { color: var(--status-error); }
.hint.success { color: var(--status-success); }
.hint-row { display: flex; justify-content: space-between; gap: var(--s-3); }
.hint-row > .hint:last-child { flex: none; font-variant-numeric: tabular-nums; }

/* Alert (Figma Banner) — message box above a form, list or page; .error | .success | .warning | .info */
.alert {
  margin-bottom: var(--s-4); padding: var(--s-4); border: 1px solid var(--border-subtle); border-radius: var(--r-md);
  background: var(--gray-25); color: var(--fg-2); font: var(--type-label); box-shadow: var(--shadow-xs);
}
.alert.error { background: var(--error-50); color: var(--error-700); border-color: var(--error-200); }
.alert.success { background: var(--success-50); color: var(--success-700); border-color: var(--success-200); }
.alert.warning { background: var(--amber-25); color: var(--amber-700); border-color: var(--amber-200); }
.alert.info { position: relative; padding-left: calc(var(--s-4) + 26px); background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-200); }
/* The info circle, drawn in currentColor so it follows the tone. */
.alert.info::before { content: ""; position: absolute; left: var(--s-4); top: calc(var(--s-4) + 1px); width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.alert .link { margin-left: var(--s-2); }
.alert a { font: var(--type-label-strong); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }
.alert p { margin: 0; }

/* BANT row — eyebrow + four chips + "n/4 terpenuhi" */
.bant { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.bant form { margin: 0; }
.bant-label { font: var(--type-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-3); }
.bant-note { font: var(--type-caption); color: var(--fg-3); }

/* Field rows — .kv stacked in one column */
.kv-list { display: flex; flex-direction: column; }
.kv-list .kv:last-child, .kv-grid .kv:nth-last-child(-n+2) { border-bottom: none; }
.kv .v.num { font: var(--type-num-label); font-variant-numeric: tabular-nums; }

/* Contact card grid */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-3); }
.contact-card { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--bg-page); box-shadow: var(--shadow-xs); color: inherit; }
.contact-card:hover { border-color: var(--border-hover); }
.contact-card-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.contact-card-name { font: var(--type-label-bold); color: var(--fg-1); }
.contact-card-role { font: var(--type-caption); color: var(--fg-3); }
.contact-card .meta-item { margin-top: var(--s-2); font: var(--type-caption); color: var(--fg-3); }

/* Person card — the deal's Kontak tab (XPLR-6): who, roles, how to reach, actions */
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.person-card { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--bg-page); box-shadow: var(--shadow-xs); }
.person-card-head { display: flex; align-items: center; gap: var(--s-3); }
.person-card-main { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); min-width: 0; }
.person-card-name { font: var(--type-label-strong); color: var(--fg-1); }
.person-card-name:hover { color: var(--fg-brand); }
.person-card-roles { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; font: var(--type-caption); color: var(--fg-3); }
.person-card-meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font: var(--type-caption); color: var(--fg-2); }
.person-card-meta a.meta-item:hover { color: var(--fg-brand); }
.person-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--gray-100); }
.person-card-actions form { margin: 0; }

/* List row — compact linked row inside a .list box (rail Deals, Perguruan tinggi) */
.list { display: flex; flex-direction: column; border: 1px solid var(--border-soft); border-radius: var(--r-md); overflow: hidden; background: var(--bg-page); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border-soft); color: inherit; }
.list-row:first-child { border-top: none; }
.list-row:hover { background: var(--bg-soft); }
.list-row-icon { display: inline-flex; color: var(--fg-accent); }
.list-row-main { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.list-row-title { font: var(--type-label-bold); color: var(--fg-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row-meta { font: var(--type-caption); color: var(--fg-3); }
.list-row-value { font: var(--type-num-caption); font-variant-numeric: tabular-nums; color: var(--fg-2); white-space: nowrap; }
.list-row > .icon:last-child { color: var(--fg-3); }

/* Task row — checkbox, title + due, meta (entity, assignee) */
.task-list { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: flex-start; gap: var(--s-2); padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.task-row:last-child { border-bottom: none; }
.task-row form { margin: 0; }
.task-check { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-top: 2px; padding: 0; border: 1px solid var(--border-subtle); border-radius: var(--r-xs); background: var(--bg-page); color: var(--fg-on-orange); cursor: pointer; }
.task-check svg { width: 12px; height: 12px; }
.task-row.done .task-check { border-color: var(--action-primary); background: var(--action-primary); }
.task-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.task-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.task-row-title { font: var(--type-label-bold); color: var(--fg-1); }
.task-row.done .task-row-title { color: var(--fg-3); text-decoration: line-through; }
.due { display: inline-flex; align-items: center; gap: var(--s-1); font: var(--type-caption-strong); color: var(--fg-3); white-space: nowrap; }
.due.overdue { color: var(--status-error); }

/* Touchpoint item — one feed entry */
.tp-item { display: flex; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--border-soft); }
.tp-item:last-child { border-bottom: none; }
.tp-photos { display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap; }
.tp-photo img { display: block; height: 96px; width: auto; max-width: 160px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--border-soft); }
/* Document list — a touchpoint's PDF/Word attachments (XPLR-7), in the feed and the edit modal */
.doc-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.doc-row { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border: 1px solid var(--border-soft); border-radius: var(--r-sm); background: var(--bg-page); }
.doc-row > .icon { width: 18px; height: 18px; color: var(--fg-brand); }
.doc-row form { margin: 0 0 0 auto; }
.doc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-label-strong); color: var(--fg-1); }
.doc-name:hover { color: var(--fg-brand); }
.doc-meta { flex: none; font: var(--type-caption); color: var(--fg-3); }
.photo-list { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.photo-list figure { margin: 0; display: flex; flex-direction: column; gap: var(--s-1); align-items: center; }
.photo-list img { display: block; height: 96px; width: auto; border-radius: var(--r-sm); border: 1px solid var(--border-soft); }
.tp-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.tp-item-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.tp-item-author { font: var(--type-label-bold); color: var(--fg-1); }
.tp-item-when, .tp-item-with { font: var(--type-caption); color: var(--fg-3); }
.tp-item-delete { margin: 0 0 0 auto; }
.tp-item p { margin: 0; font: var(--type-label); color: var(--fg-2); white-space: pre-wrap; }

/* Section header count — "Deals 3" */
.card-head .count { margin-left: var(--s-2); font: var(--type-num-caption); font-variant-numeric: tabular-nums; color: var(--fg-3); }

/* Tab count — "Kontak 4" */
.tabs .tab-count { padding: 0 8px; border-radius: var(--r-pill); background: var(--gray-100); font: var(--type-num-caption); font-variant-numeric: tabular-nums; color: var(--fg-2); }
.tabs .tab.active .tab-count { background: var(--brand-50); color: var(--brand-700); }

/* Search — icon + input */
.search { position: relative; flex: 0 0 320px; }
.search > svg, .search > .icon { position: absolute; left: 12px; top: 10px; width: 16px; height: 16px; color: var(--fg-4); }
.search input { width: 100%; height: 36px; padding: 0 12px 0 36px; max-width: none; background: var(--bg-page); }

/* Menu — <details class="menu"><summary>…</summary><div class="menu-panel">…</div></details> */
.menu { position: relative; }
.menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border-subtle); border-radius: var(--r-sm); background: var(--bg-page); color: var(--fg-2);
  font: var(--type-label); cursor: pointer; box-shadow: var(--shadow-xs);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--bg-soft); color: var(--gray-800); }
.menu > summary:focus-visible { outline: none; box-shadow: var(--shadow-xs), 0 0 0 4px var(--focus-ring); }
.menu.active > summary { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-700); }
.menu > summary svg.icon { width: 15px; height: 15px; color: var(--fg-2); }
.menu > summary svg.chev { width: 16px; height: 16px; color: var(--fg-4); transition: transform var(--dur-fast) var(--ease-out); }
.menu[open] > summary svg.chev { transform: rotate(180deg); }
.menu-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--brand-600); color: var(--fg-on-orange); font: var(--type-caption-strong);
}
.menu-count[hidden] { display: none; }
.menu-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 248px; max-height: 300px; overflow: auto; padding: 6px;
  background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: var(--r-sm); box-shadow: var(--shadow-md);
}
.menu-panel.view { width: 232px; min-width: 0; max-height: none; padding: 12px; }
.menu-panel.scroll { max-height: 236px; }
.menu-label { padding: 0 2px 8px; }
.menu-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-xs);
  font: var(--type-label); color: var(--fg-2); cursor: pointer; user-select: none;
}
/* The filter-search script hides rows with [hidden]; an author display:flex
   beats the browser's [hidden] rule, so restate it. */
.menu-row[hidden] { display: none; }
.menu-row:hover { background: var(--gray-50); }
.menu-row input[type=checkbox] { width: 15px; height: 15px; flex: none; }
.menu-search { width: 100%; margin-bottom: 6px; padding: 6px 10px; }
.menu-clear {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-left: auto;
  color: var(--fg-brand); font: var(--type-label-strong);
}
.menu-clear svg { width: 15px; height: 15px; }

/* Inline select — a table-cell picker built on .menu: plain text at rest, border + chevron on hover/focus.
   Variants: .kind-badge (options are badges), .kind-pill, .kind-avatar; plain without. Script: static/inline-select.js. */
.inline-select { min-width: 0; margin: 0; }
.inline-select > .menu > summary {
  position: relative; width: 100%; height: 30px; padding: 0 18px 0 6px; gap: 6px; border-color: transparent; background: transparent;
  font: var(--type-caption); color: var(--fg-1);
}
.inline-select > .menu > summary svg.chev { position: absolute; top: 50%; right: 3px; width: 14px; height: 14px; margin-top: -7px; opacity: 0; }
.inline-select > .menu > summary:hover, .inline-select > .menu > summary:focus-visible, .inline-select > .menu[open] > summary { border-color: var(--border-subtle); background: var(--bg-page); }
.inline-select > .menu > summary:hover svg.chev, .inline-select > .menu > summary:focus-visible svg.chev, .inline-select > .menu[open] > summary svg.chev { opacity: 1; }
.inline-select > .menu > summary[aria-disabled="true"], .inline-select > .menu > summary[aria-disabled="true"]:hover { border-color: transparent; background: transparent; cursor: not-allowed; }
.inline-select > .menu > summary[aria-disabled="true"] svg.chev { opacity: 0; }
.inline-select .menu-panel { min-width: 200px; }
.inline-select .menu-row { width: 100%; border: 0; background: none; text-align: left; }
.inline-select .menu-row:hover, .inline-select .menu-row:focus-visible { background: var(--gray-50); outline: none; }
.inline-select .menu-row[aria-selected="true"] { background: var(--bg-soft); font: var(--type-label-strong); }
.inline-select-empty { color: var(--fg-3); }

/* Form select — the menu as a form field (components.html "form-select"): radios post with the form, the summary shows the checked label. */
.form-select > summary { display: flex; width: 100%; justify-content: space-between; color: var(--fg-1); font: var(--type-body); }
.form-select .menu-panel { width: 100%; min-width: 0; }
.form-select .menu-row input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.form-select .menu-row:has(input:checked) { background: var(--bg-soft); color: var(--fg-1); font: var(--type-label-strong); }
.form-select .menu-row:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--focus-ring); }

/* Input affix — fixed text around an input: <div class="input-affix"><span>demo-</span><input><span>.penaschool.id</span></div> */
.input-affix { display: flex; align-items: center; height: 40px; border: 1px solid var(--border-subtle); border-radius: var(--r-sm); background: var(--bg-page); box-shadow: var(--shadow-xs); overflow: hidden; }
.input-affix:focus-within { border-color: var(--brand-300); box-shadow: var(--shadow-xs), 0 0 0 4px var(--focus-ring); }
.input-affix > span { flex: none; padding: 0 10px; color: var(--fg-3); font: var(--type-body); background: var(--bg-soft); align-self: stretch; display: flex; align-items: center; }
.field .input-affix > input { flex: 1; min-width: 0; height: 100%; padding: 0 8px; border: 0; border-radius: 0; box-shadow: none; }
.field .input-affix > input:focus-visible { box-shadow: none; }

/* Date cell — a short date ("30 Okt" or "—") that opens the hidden native picker; .late in red */
.date-cell { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.date-cell-btn {
  height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent;
  color: var(--fg-1); font: var(--type-caption); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.date-cell-btn:hover:not(:disabled), .date-cell-btn:focus-visible { border-color: var(--border-subtle); background: var(--bg-page); }
.date-cell-btn.late { color: var(--status-error); font: var(--type-caption-strong); }
.date-cell-btn:disabled { cursor: not-allowed; }
.date-cell-input { position: absolute; bottom: 0; left: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.date-cell-due { padding: 0 7px; font: var(--type-caption-strong); color: var(--status-warning); }

/* Save state — "Menyimpan…" / "Tersimpan" after an autosave caption; width reserved so nothing jumps */
.save-state { display: inline-block; min-width: 11ch; margin-left: var(--s-1); font: var(--type-caption-strong); color: var(--fg-3); }

/* Key–value — label column, then the value read left to right; stack them in .kv-grid */
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
.kv { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: baseline; column-gap: var(--s-4); padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.kv .k { flex-shrink: 0; font: var(--type-caption-strong); color: var(--fg-3); }
.kv .v { font: var(--type-cell); color: var(--fg-1); text-align: left; overflow-wrap: anywhere; }
.manual-code { margin: 8px 0; padding: 12px; border: 1px solid var(--border-soft); border-radius: var(--r-xs); background: var(--bg-soft); font: var(--type-caption); white-space: pre-wrap; overflow-wrap: anywhere; }
.kv .v.empty { color: var(--fg-3); font: var(--type-cell); }

/* Meta row — icon + text facts under a page title */
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; font: var(--type-caption); color: var(--fg-3); }
.meta-row svg { width: 14px; height: 14px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.stack > .meta-row { margin-top: 0; }

/* Actions — a row of buttons; in a form it sits below the fields */
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); flex-shrink: 0; }
form .actions { margin-top: 18px; }

/* Divider — labelled rule between sections */
.divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; font: var(--type-eyebrow); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--fg-3); }
.divider::after { content: ""; flex: 1; height: 1px; background: var(--border-soft); }

/* Tabs — underline tabs; .tab-radio + .tab-panel for radio-driven panels */
.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border-soft); overflow-x: auto; }
.tabs .tab { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 0 0 12px; border-bottom: 2px solid transparent; font: var(--type-label-strong); color: var(--fg-3); white-space: nowrap; cursor: pointer; }
.tabs .tab:hover { color: var(--fg-1); border-bottom-color: var(--gray-300); }
.tabs .tab.active { color: var(--fg-1); border-bottom-color: var(--brand-600); }

/* Segmented — pill toggle; .stacked puts icons above labels */
.segmented { display: inline-flex; gap: 4px; width: fit-content; padding: 4px; border: 1px solid var(--gray-200); border-radius: var(--r-sm); background: var(--gray-50); }
.segmented .segment { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid transparent; border-radius: var(--r-xs); font: var(--type-label-strong); color: var(--fg-4); text-decoration: none; cursor: pointer; }
.segmented .segment svg { width: 15px; height: 15px; }
.segmented .segment.active, .segmented .segment:has(input:checked) { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-800); box-shadow: var(--shadow-xs); }
/* Radio-backed segments (kanban stalled filter): the label is the control. */
.segmented .segment input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.segmented .segment:has(input:focus-visible) { outline: 2px solid var(--amber-600); outline-offset: 1px; }
.segmented.stacked { display: flex; width: 100%; }
.segmented.stacked .segment { flex: 1; flex-direction: column; gap: 6px; padding: 10px 6px 8px; font: var(--type-badge); }
.segmented.stacked .segment svg { width: 18px; height: 18px; }
.segmented.stacked .segment.active svg { color: var(--amber-600); }

/* Stat — KPI tile */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--s-4); }
.stat { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5); background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.stat > div { display: flex; flex-direction: column; gap: var(--s-2); height: 100%; }
/* the refresh's KPI tiles are text only: label, number, caption */
.stat > .stat-icon { display: none; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border-soft); border-radius: var(--r-sm); background: var(--bg-page); color: var(--fg-2); box-shadow: var(--shadow-xs); }
.stat-icon svg, .stat-icon .icon { width: 20px; height: 20px; }
.stat-value { font: var(--type-stat); letter-spacing: var(--ls-h1); font-variant-numeric: tabular-nums; color: var(--fg-1); }
.stat-label { order: -1; display: flex; align-items: center; gap: var(--s-2); font: var(--type-label); color: var(--fg-3); }
.stat-sub { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--border-soft); font: var(--type-caption); color: var(--fg-3); }

/* Empty state — one line, or .panel with icon + h2 + p */
.empty-state { padding: 8px 0; font: var(--type-label); color: var(--fg-3); }
.empty-state.panel { display: flex; align-items: flex-start; gap: var(--s-4); padding: var(--s-7); background: var(--bg-page); border: 1px solid var(--border-subtle); border-radius: var(--r-md); color: var(--fg-1); }
.empty-state.panel .stat-icon { color: var(--fg-3); }
.empty-state.panel h2 { margin: 0 0 var(--s-1); font: var(--type-h3); }
.empty-state.panel p { margin: 0 0 var(--s-3); max-width: 56ch; font: var(--type-label); color: var(--fg-3); }

/* Pager — page-size select + info on the left, filled page buttons on the right */
.pager-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s-4); padding: var(--s-3) var(--s-5); border-top: 1px solid var(--border-soft); }
.pager-foot-left { display: flex; align-items: center; gap: var(--s-3); }
.pagesize-select { width: 80px; }
.pager-info { font: var(--type-cell); color: var(--fg-3); }
.pager { display: flex; align-items: center; gap: var(--s-2); }
.pager-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 8px; border: none; border-radius: var(--r-sm); background: transparent; color: var(--fg-3); font: var(--type-num-caption); font-variant-numeric: tabular-nums; }
.pager-btn:hover { background: var(--gray-50); color: var(--fg-2); }
.pager-btn.active { background: var(--gray-100); color: var(--fg-1); }
.pager-btn.disabled { background: transparent; color: var(--gray-300); cursor: not-allowed; pointer-events: none; }
.pager-btn svg { width: 18px; height: 18px; }

/* Empty row — an empty-state as a table's only row */
tr.empty-row:hover { background: none; }
tr.empty-row td { padding: var(--s-4); }
tr.empty-row .empty-state.panel { border: none; padding: var(--s-4) var(--s-2); }

/* Bulk action bar — selection count + actions above a table  */
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin-bottom: var(--s-3); padding: 10px var(--s-4); border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--bg-soft); font: var(--type-label); color: var(--fg-2); }
.bulk-bar[hidden] { display: none; }
.bulk-count { font: var(--type-label-bold); color: var(--fg-1); }
.bulk-bar .grow { flex: 1 1 auto; }

/* Modal head eyebrow */
.modal-head .eyebrow { margin-bottom: 2px; }

/* ==== Organisms ==== */

/* Card — the page's content container */
.card-stack { display: flex; flex-direction: column; gap: var(--s-4); }
.card { --card-pad: 24px; padding: var(--card-pad); background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.card.roomy { --card-pad: 28px; }
.card.form { max-width: 480px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card-head h2 { margin: 0; font: var(--type-h3); color: var(--fg-1); }
/* a card that opens with its head gets a header strip: the head spans the card, ruled off from the body */
.detail-grid .card > .card-head:first-child { background: var(--brand-25); border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0; }
.detail-grid .card > .card-head:first-child h2 { color: var(--brand-900); }
.card > .card-head:first-child { min-height: 56px; margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1) var(--card-pad); padding: var(--s-3) var(--card-pad); border-bottom: 1px solid var(--border-soft); }
.card-head .sub { font: var(--type-caption); color: var(--fg-3); }

/* Table — element styles (zero specificity) + .table-wrap container */
:where(table) { width: 100%; border-collapse: collapse; font: var(--type-cell); }
:where(thead th) { height: 36px; padding: 0 var(--s-4); text-align: left; white-space: nowrap; font: var(--type-caption-strong); color: var(--fg-3); background: var(--gray-50); border-bottom: 1px solid var(--border-soft); }
:where(thead th a) { color: inherit; }
:where(thead th a:hover) { color: var(--fg-brand); }
:where(tbody td) { padding: 10px var(--s-4); vertical-align: middle; border-bottom: 1px solid var(--border-soft); }
:where(tbody tr:last-child td) { border-bottom: none; }
:where(tbody tr:hover) { background: var(--gray-50); }
:where(tr[onclick]) { cursor: pointer; }
:where(td.num, th.num) { text-align: right; white-space: nowrap; }
:where(td.num) { font: var(--type-cell); font-variant-numeric: tabular-nums; color: var(--fg-1); }
.table-wrap { overflow: hidden; background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.table-scroll { overflow-x: auto; }
/* a list card: .table-wrap > .table-head + .toolbar.inset + table + pager in one frame */
.table-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding: var(--s-4) var(--s-5) 0; }
.table-head h2 { margin: 0; font: var(--type-h3); color: var(--fg-1); }
.table-head-note { margin-left: auto; font: var(--type-caption); color: var(--fg-3); }
.table-wrap > .toolbar.inset { margin: 0; padding: var(--s-4) var(--s-5); border: 0; border-bottom: 1px solid var(--border-soft); border-radius: 0; box-shadow: none; }
.table-wrap .alert { margin: var(--s-3) var(--s-5); }
.table-wrap:has(> .toolbar .menu[open]) { overflow: visible; }
:where(tbody td) > a.t-label-bold { color: var(--fg-1); }
/* in a table cell the bold/strong label utilities step down to the 13px cell voice */
:where(tbody td) .t-label-bold, :where(tbody td) .t-label-strong { font: var(--type-cell-strong); }
:where(tbody td) .t-label { font: var(--type-cell); }
:where(tbody td) > a.t-label-bold:hover { color: var(--fg-brand); }
/* a row menu would be clipped by the wrappers; open them up only while it is open */
.table-wrap:has(td .menu[open]), .table-wrap:has(td .menu[open]) .table-scroll { overflow: visible; }

/* Toolbar — search + menus + actions above a list */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 16px; background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: var(--r-md); }
.toolbar-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
/* a trailing toolbar action sits at the right edge, after Reset filter */
.toolbar-row > .btn { margin-left: auto; }
.toolbar-row > .menu-clear + .btn { margin-left: 0; }
/* .split: search on the left, the .toolbar-group of menus on the right */
.toolbar-row.split { justify-content: space-between; }
.toolbar-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Page head — crumbs, title, lede, meta, actions */
.page { color: var(--fg-1); }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font: var(--type-crumb); color: var(--fg-4); }
.crumbs .crumb-sep { color: var(--fg-4); }
.crumbs a { color: var(--fg-4); font: var(--type-crumb); }
.crumbs a:hover { color: var(--fg-brand); }
.crumbs .current { color: var(--fg-1); font: var(--type-crumb-strong); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 0 calc(var(--gutter) * -1) 24px; padding: 0 var(--gutter) var(--head-pad); border-bottom: 1px solid var(--border-soft); }
.page-head h1 { margin: 0; font: var(--type-h1); letter-spacing: var(--ls-h1); color: var(--fg-1); }
.page-head > .tabs { align-self: flex-end; margin: 0 0 calc(-1 * var(--head-pad) - 1px); border-bottom: 0; }
.page-head p { margin: 4px 0 0; max-width: 90ch; font: var(--type-lede); color: var(--fg-3); }
.page-head .actions { gap: var(--s-3); }
.page-head > .actions, .page-head > .btn { margin-block: -3px; } /* a 36px button takes exactly the 30px title line */
/* a record's facts (meta line, BANT) sit just under the band, not inside it */
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-5); margin: calc(-1 * var(--s-2)) 0 var(--s-5); }
.detail-meta > .meta-row { margin-top: 0; }

/* Modal — :target dialog. Standard ones via {{template "modal-open"}}; .xl dialogs by hand. */
.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 50; align-items: center; justify-content: center; background: var(--overlay); }
.modal-backdrop:target, .modal-backdrop.is-open { display: flex; }
.modal { display: flex; flex-direction: column; width: 480px; max-width: calc(100vw - 40px); max-height: calc(100vh - 64px); overflow: hidden; background: var(--bg-page); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.modal.lg { width: 640px; }
.modal.xl { width: 780px; }
/* A form between the dialog and its body/foot must be a shrinkable flex
   column, or it grows to content height and clips the foot. */
.modal > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--border-soft); }
.modal-head h2 { margin: 0; font: var(--type-h2); color: var(--fg-1); }
.modal.xl .modal-head { align-items: flex-start; padding: 22px 28px 18px; }
.modal.xl .modal-head h2 { margin-top: 3px; font: var(--type-h2); letter-spacing: var(--ls-h2); }
.modal-icon { display: flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 48px; border: 8px solid var(--brand-50); border-radius: var(--r-pill); background: var(--brand-100); color: var(--brand-600); }
.modal-icon svg { width: 19px; height: 19px; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-4); font: var(--type-h2); }
.modal-close:hover { background: var(--gray-50); color: var(--fg-1); }
.modal-close svg { width: 17px; height: 17px; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 20px 24px 24px; }
.modal.xl .modal-body { display: flex; flex-direction: column; gap: 20px; padding: 22px 28px 26px; }
.modal-body input[type=search] { width: 100%; margin-bottom: 14px; }
.modal-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; border-top: 1px solid var(--border-soft); background: var(--bg-page); }

/* App sidebar — 240px rail on the blue-25 ground: collapsible sections, pinned user footer.
   Only <nav> scrolls; brand and footer never move. */
.sidebar {
  flex: 0 0 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-soft);
  color: var(--gray-700);
  display: flex;
  flex-direction: column;
  padding: 20px 0 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.brand { flex: none; display: flex; align-items: center; gap: 10px; padding: 0 20px var(--s-6); }
.brand-link { display: flex; align-items: center; gap: 10px; min-width: 0; border-radius: var(--r-sm); color: inherit; }
.brand-link:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 3px; }
.topbar-title { display: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--brand-600); color: var(--white);
  display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 16px; height: 16px; }
.brand-name { font: var(--type-brand); color: var(--fg-1); }
nav.primary {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 0 12px 8px;
  scrollbar-width: thin; scrollbar-color: var(--gray-300) transparent;
  /* scroll shadows: the local covers hide each shadow until there is more list beyond that edge */
  background:
    linear-gradient(var(--bg-sidebar) 40%, transparent) top / 100% 24px no-repeat local,
    linear-gradient(transparent, var(--bg-sidebar) 60%) bottom / 100% 24px no-repeat local,
    radial-gradient(farthest-side at 50% 0, color-mix(in srgb, var(--gray-900) 14%, transparent), transparent) top / 100% 8px no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, color-mix(in srgb, var(--gray-900) 14%, transparent), transparent) bottom / 100% 8px no-repeat scroll;
}
.sidebar .nav-toggle { display: none; margin-left: auto; }
nav.primary::-webkit-scrollbar { width: 8px; }
nav.primary::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
nav.primary::-webkit-scrollbar-track { background: transparent; }
.nav-item, .nav-sec {
  display: flex; align-items: center; gap: 10px; width: 100%;
  min-height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  font: var(--type-label); color: var(--gray-700);
  background: transparent; border: 0; text-decoration: none; text-align: left; cursor: pointer;
  transition: background-color 180ms ease-out, color 180ms ease-out;
}
.nav-item svg { width: 16px; height: 16px; flex: none; color: var(--gray-500); }
.nav-sec svg { width: 16px; height: 16px; flex: none; }
.nav-item span { flex: 1; min-width: 0; }
.nav-item:hover { background: color-mix(in srgb, var(--brand-100) 55%, var(--bg-sidebar)); color: var(--gray-900); }
.nav-sec:hover { color: var(--gray-700); }
/* one clear ring on the rail, inset so it never clips at the rail edge */
.nav-item:focus-visible, .nav-sec:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.nav-item.active, .nav-item.active:hover { background: var(--brand-100); color: var(--brand-700); }
.nav-item.active svg { color: var(--brand-600); }
.nav-sec {
  min-height: 24px; padding: 2px 10px; margin-top: 14px;
  font: var(--type-nav-sec); letter-spacing: var(--ls-nav-sec); text-transform: uppercase; color: var(--gray-500);
}
.nav-sec span { flex: 1; }
/* a collapsed section that holds the current page shows a blue dot */
.nav-sec.has-active[aria-expanded="false"] span::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: var(--r-pill); background: var(--brand-600); vertical-align: 1px; }
.nav-sec .chev { width: 13px; height: 13px; transition: transform 180ms ease-in-out; }
.nav-sec[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group[hidden] { display: none; }
.sidebar-foot { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 12px; padding: 12px 8px 0; border-top: 1px solid var(--border-soft); }
.sidebar-foot form { margin: 0; }
.sidebar-user { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sidebar-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-label-strong); color: var(--fg-1); }
.sidebar-user-name:hover, .sidebar-user-name.active { color: var(--fg-brand); }
.sidebar-logout { padding: 0; border: 0; background: none; font: var(--type-caption); color: var(--fg-3); cursor: pointer; text-align: left; }
.sidebar-logout:hover { color: var(--fg-1); text-decoration: underline; }

.skip-link { position: absolute; z-index: 100; left: 12px; top: -48px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--action-primary); color: var(--white); font: var(--type-label); }
.skip-link:focus { top: 12px; }
.main:focus { outline: none; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-page); }
.page-crumb { font: var(--type-crumb); color: var(--fg-4); }
.page-crumb strong { font: var(--type-crumb-strong); color: var(--fg-1); }
/* detail pages carry their own .crumbs trail */
.content:has(.crumbs) > .page-crumb { display: none; }
.content { --gutter: 32px; padding: var(--head-pad) var(--gutter) 48px; }
.content > .page-crumb, .crumbs { margin-bottom: calc(var(--crumb-step) - 20px); }
/* a page with no crumb keeps its title (and the band's rule) on the same lines */
.content > .page-head:first-child, .content > .page:first-child > .page-head:first-child { padding-top: var(--crumb-step); }

.section-label { margin: 28px 0 12px; }
.section-label:first-of-type { margin-top: 0; }

@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar { position: relative; height: auto; flex: none; }
  .content { --gutter: 16px; padding: 16px var(--gutter) 40px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .stat { padding: var(--s-3) var(--s-4); }
  .stat-sub { display: none; }
  /* with JS: a sticky top bar (brand + Menu) that opens the full nav over the page */
  .sidebar.js-nav { position: sticky; top: 0; z-index: 20; padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .sidebar.js-nav .brand { padding: 0 16px; }
  .sidebar.js-nav .nav-toggle { display: inline-flex; height: 44px; padding: 0 14px; }
  .sidebar.js-nav .brand-name { display: none; }
  .sidebar.js-nav .brand-link { min-height: 44px; min-width: 44px; }
  .sidebar.js-nav .topbar-title { display: block; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-label-strong); color: var(--fg-1); }
  .sidebar.js-nav.open .brand { padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
  .sidebar.js-nav .nav-item { min-height: 44px; }
  .sidebar.js-nav .nav-sec { min-height: 44px; margin-top: 4px; }
  .sidebar.js-nav .sidebar-user-name, .sidebar.js-nav .sidebar-logout { min-height: 44px; display: flex; align-items: center; }
  .sidebar.js-nav:not(.open) nav.primary, .sidebar.js-nav:not(.open) .sidebar-foot { display: none; }
  .sidebar.js-nav.open { height: 100dvh; }
  .sidebar.js-nav.open nav.primary { padding-top: 12px; }
}

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }

.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border-subtle); border-radius: 8px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--brand-600); }
.checkbox-row .dot { margin-right: 2px; }
.checkbox-row .label { font: var(--type-label); }

/* Add-contact / add-affiliation modal — CSS :target show/hide, zero JS.
   A trigger link (href="#some-modal-id") makes the backdrop the URL's
   fragment target; a close link (href="{{.Path}}", no fragment)
   dismisses it. */
.search-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 9px; margin-bottom: 8px; }
/* Deal detail panel — same CSS :target show/hide trick as
   .modal-backdrop, but rendered in normal page flow (no fixed
   overlay/backdrop) directly under the deal row that opened it, so
   clicking a deal expands its detail in place rather than popping a
   dialog on top of the page. */

#tab-institution:checked ~ .segmented label[for="tab-institution"],
#tab-yayasan:checked ~ .segmented label[for="tab-yayasan"],
#tab-university:checked ~ .segmented label[for="tab-university"] { background: var(--amber-50); border-color: var(--amber-200); color: var(--amber-800); box-shadow: var(--shadow-xs); }

.selected-card { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--brand-50); border: 1px solid var(--brand-200); }
.selected-card-icon { width: 32px; height: 32px; flex: none; border-radius: var(--r-xs); background: var(--bg-page); border: 1px solid var(--brand-200); display: flex; align-items: center; justify-content: center; color: var(--brand-700); }
.selected-card-icon svg { width: 17px; height: 17px; }
.selected-card-name { font: var(--type-h3); color: var(--fg-1); }
.selected-card-change { flex: none; font: var(--type-caption-strong); color: var(--brand-700); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

#priority-none:checked ~ label[for="priority-none"],
#priority-low:checked ~ label[for="priority-low"],
#priority-medium:checked ~ label[for="priority-medium"],
#priority-high:checked ~ label[for="priority-high"] { border-color: var(--amber-500); background: var(--amber-50); color: var(--amber-700); }

.view-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

/* zero-JS <details>/<summary> popovers: the Kanban/Table layout
   switcher, plus the table view's Vertical/Stage/Owner filters —
   styled as one family so they read as a single control row. */
.reason-note { font: var(--type-caption); color: var(--fg-3); font-style: italic; margin-top: 2px; }

.board-scroll { overflow-x: auto; padding-bottom: 8px; }
.board { display: flex; gap: 16px; min-width: max-content; align-items: flex-start; }
.column { width: 300px; flex: none; padding: var(--s-3); border: 1px solid var(--border-soft); border-radius: var(--r-md); background: var(--bg-soft); }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.column-head h2 { font: var(--type-label-strong); color: var(--fg-1); display: flex; align-items: center; gap: 8px; }
.column-count { font: var(--type-caption-strong); font-variant-numeric: tabular-nums; color: var(--fg-2); background: var(--gray-100); border-radius: var(--r-xs); padding: 0 7px; }
.column-total { font: var(--type-badge); color: var(--fg-3); margin-top: 2px; }
.column-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; margin-top: 10px; }
.column-list:not(:has(.deal-card))::after { content: "Belum ada lead"; padding: var(--s-3) 2px; font: var(--type-caption); color: var(--fg-4); }

.deal-card { background: var(--bg-page); border: 1px solid var(--border-soft); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: grab; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.deal-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-sm); }
.deal-card .card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.deal-card .entity-row { display: flex; align-items: center; gap: 6px; font: var(--type-caption); color: var(--fg-3); min-width: 0; }
.deal-card .entity-row span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-card .priority, td .priority { padding: 0 6px; border-radius: var(--r-xs); background: var(--gray-100); font: var(--type-caption-strong); color: var(--fg-2); flex: none; }
.deal-card .priority.p1, td .priority.p1 { color: var(--fg-1); }
.deal-card .priority { display: inline-flex; align-items: center; gap: 3px; padding: 0 5px 0 4px; }
.deal-card .priority::before { content: ""; width: 6px; height: 6px; border-radius: var(--r-pill); background: var(--fg-4); }
.deal-card .priority.p1::before { background: var(--priority-high); }
.deal-card .priority.p2::before { background: var(--priority-medium); }
.deal-card h3 { min-width: 0; font: var(--type-label-strong); color: var(--fg-1); }
.deal-card h3 a:hover { color: var(--fg-brand); }
.deal-card .card-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: -4px; font: var(--type-cell); color: var(--fg-3); }
.deal-card .card-value { flex: none; font: var(--type-cell-strong); font-variant-numeric: tabular-nums; color: var(--fg-1); }
.deal-card .bant .bant-label, .deal-card .bant .bant-note { display: none; }
.deal-card .bant { gap: 3px; flex-wrap: nowrap; }
.deal-card .chip { min-width: 16px; height: 20px; padding: 0 2px; border: 0; background: none; color: var(--gray-400); font: var(--type-caption-strong); }
.deal-card .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.deal-card .owner { display: flex; align-items: center; gap: 6px; min-width: 0; font: var(--type-caption); color: var(--fg-3); }
.deal-card .close-date { font: var(--type-caption); font-variant-numeric: tabular-nums; color: var(--fg-3); }
.deal-card .close-date::before { content: ","; margin-right: 4px; }
.deal-card .card-reason { font: var(--type-caption); color: var(--fg-3); background: var(--gray-50); border-radius: var(--r-xs); padding: 8px 10px; }
.deal-card.is-lost { opacity: .72; }
.deal-card.is-parked { border-style: dashed; border-color: var(--stage-parked); opacity: .85; }
.search-result .name { font: var(--type-label-strong); }
.search-result .meta { font: var(--type-badge); color: var(--fg-3); margin-top: 2px; }
.search-result form { display: flex; gap: 6px; align-items: center; }
.search-result input[type="text"] { padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 6px; font: var(--type-caption); width: 120px; }
.role-fields { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.role-field-card { border: 1px solid var(--border-subtle); border-radius: 10px; padding: 12px 13px; }
.role-field-card .entity-name { font: var(--type-caption-strong); color: var(--fg-1); margin-bottom: 8px; }
.role-field-card input { width: 100%; padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: 7px; font: var(--type-label); }

@media (max-width: 900px) {
    .kv-grid { grid-template-columns: 1fr; }
    .kv { grid-template-columns: 120px minmax(0, 1fr); }
}

/* Two-tab entity-type picker (Contact's own add-affiliation flow) —
   radio buttons styled as tabs, panels shown via the :checked sibling
   combinator. The radios must precede the tabs/panels in DOM order for
   this to work (CSS's ~ combinator only looks forward). */
.tab-radio { position: absolute; opacity: 0; width: 0; height: 0; }
.tab-radio-group .tabs { margin-bottom: 14px; }
.tab-panel { display: none; }
#tab-institution:checked ~ .tabs label[for="tab-institution"],
#tab-yayasan:checked ~ .tabs label[for="tab-yayasan"],
#tab-university:checked ~ .tabs label[for="tab-university"],
#tab-contact:checked ~ .tabs label[for="tab-contact"] { color: var(--brand-700); border-bottom-color: var(--brand-600); }
#tab-institution:checked ~ .institution-panel { display: block; }
#tab-yayasan:checked ~ .yayasan-panel { display: block; }
#tab-university:checked ~ .university-panel { display: block; }
#tab-contact:checked ~ .contact-panel { display: block; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.icon svg { width: 100%; height: 100%; display: block; }

/* New Deal form: two-column rows, priority radio pills, bulk-select checkbox column */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.prio-group { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.prio-pill { display: inline-flex; align-items: center; gap: var(--s-2); height: 32px; padding: 0 var(--s-4); border-radius: var(--r-pill); border: 1px solid var(--border-subtle); background: var(--bg-page); color: var(--fg-2); font: var(--type-label-strong); cursor: pointer; }
.prio-pill:hover { border-color: var(--gray-400); }
#priority-none:checked ~ label[for="priority-none"],
#priority-low:checked ~ label[for="priority-low"],
#priority-medium:checked ~ label[for="priority-medium"],
#priority-high:checked ~ label[for="priority-high"] { border-color: var(--amber-500); background: var(--amber-50); color: var(--amber-700); }
td.check-col, th.check-col { width: 28px; padding-right: 0; }
td.check-col input, th.check-col input { width: 16px; height: 16px; accent-color: var(--brand-600); }

/* ---- from internal/pricing/templates/list.html ---- */
.matrix { width: 100%; border-collapse: collapse; font: var(--type-label); }
.matrix th, .matrix td { border-bottom: 1px solid var(--border-subtle); padding: 8px 12px; text-align: left; white-space: nowrap; }
.matrix-corner { position: sticky; left: 0; background: var(--bg-page); z-index: 2; min-width: 280px; }
.matrix-pkg-head { text-align: center; min-width: 150px; }
.matrix-pkg-price { font: var(--type-badge); font-variant-numeric: tabular-nums; color: var(--fg-3); margin-top: 2px; }
.matrix-category-row td { background: var(--bg-soft); text-transform: uppercase; font: var(--type-eyebrow); letter-spacing: var(--ls-badge); color: var(--brand-600); position: sticky; left: 0; }
.matrix-module-cell { position: sticky; left: 0; background: var(--bg-page); font: var(--type-label); color: var(--fg-1); }
.matrix-checkbox-cell { text-align: center; }
.matrix-checkbox-cell input { width: 16px; height: 16px; cursor: pointer; }

/* ==== Detail page (Figma Detail templates) ==== */
.page-head.detail { margin-bottom: var(--s-4); }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.title-row h1 { margin: 0; }
.page > .stat-grid, .stat-grid:has(+ .tabs) { margin-bottom: var(--s-6); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s-4); align-items: start; }
.detail-main, .detail-rail { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } }
.card .link + .feed, .feed + .link { margin-top: var(--s-2); }

/* Stage pick — the header's stage dropdown */
.stage-pick > summary { height: 30px; padding: 0 var(--s-2); }
.stage-pick .menu-panel { min-width: 220px; }
.stage-pick .menu-row { width: 100%; border: 0; background: none; text-align: left; }

/* AI summary card */
.ai-card .card-head h2 { display: inline-flex; align-items: center; gap: var(--s-2); }
.ai-card .card-head h2 .icon { color: var(--fg-accent); }
.ai-card-text { margin: 0; max-width: 78ch; font: var(--type-body); color: var(--fg-2); white-space: pre-wrap; }
.ai-card-foot { margin: var(--s-4) 0 0; padding-top: var(--s-3); border-top: 1px solid var(--border-soft); font: var(--type-caption); color: var(--fg-3); }
.ai-card .badge { margin-right: var(--s-1); }

/* Composer */
.composer { display: flex; gap: var(--s-3); align-items: flex-start; margin-bottom: var(--s-4); }
.composer-box { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--s-3); padding: 10px var(--s-3); border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-page); }
.composer-box textarea { min-height: 44px; padding: 0; border: 0; resize: vertical; font: var(--type-body); }
.composer-box textarea:focus-visible { outline: none; }
.composer-box:focus-within { border-color: var(--brand-300); box-shadow: 0 0 0 4px var(--focus-ring); }
.composer-with, .composer-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.composer-foot .btn { margin-left: auto; }
.feed { display: flex; flex-direction: column; padding: 0 var(--s-4); border: 1px solid var(--border-subtle); border-radius: var(--r-md); }
/* Ringkasan's Aktivitas terbaru: the feed sits straight in the card, unboxed */
.card-head + .feed { padding: 0; border: none; }

/* ==== Domain: Implementasi ==== */
/* Progress bar: <progress class="progress" value="0..100" max="100">;
   .done when full, .sm inside checklist rows. Native element, so no inline width. */
.progress { -webkit-appearance: none; appearance: none; display: inline-block; width: 120px; height: 6px; border: none; border-radius: var(--r-pill); background: var(--gray-100); color: var(--brand-600); overflow: hidden; vertical-align: middle; }
.progress::-webkit-progress-bar { background: var(--gray-100); border-radius: var(--r-pill); }
.progress::-webkit-progress-value { background: var(--brand-600); border-radius: var(--r-pill); }
.progress::-moz-progress-bar { background: var(--brand-600); border-radius: var(--r-pill); }
.progress.done::-webkit-progress-value { background: var(--status-success); }
.progress.done::-moz-progress-bar { background: var(--status-success); }
.progress.sm { width: 96px; height: 4px; }
/* Small secondary text; pair with .dim for the muted colour. */
/* Daftar Implementasi */
.impl-client { max-width: 420px; }
.impl-entity { display: flex; align-items: center; gap: var(--s-2); }
.impl-entity strong { font: var(--type-label-strong); color: var(--fg-1); }
.impl-client .t-caption { margin-top: 4px; }
.impl-client > .badge { margin-top: 6px; }
.impl-end { text-align: right; }
.impl-empty .actions { margin-top: var(--s-3); }

/* Mulai Implementasi modal and school picker */
.impl-modal-title { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.impl-modal-title > div { min-width: 0; }
.actions.impl-foot { margin-top: 0; }
.impl-section { display: grid; gap: 10px; }
.impl-section .divider { margin: 0; }
.impl-drop { max-height: 300px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-page); box-shadow: var(--shadow-md); }
.impl-mod-cat { padding: var(--s-2) var(--s-3); background: var(--gray-100); font: var(--type-label-bold); }
.impl-mod-cat label { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; }
.impl-mod { display: flex; align-items: center; gap: var(--s-2); padding: 6px 12px 6px 36px; font: var(--type-label); cursor: pointer; }
/* implFilterModules hides rows with [hidden]; display:flex would beat the browser rule. */
.impl-mod[hidden] { display: none; }
.impl-module-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.impl-module-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px 4px 12px; border-radius: var(--r-pill); background: var(--gray-50); color: var(--brand-600); font: var(--type-label-strong); }
.impl-module-chip button { padding: 0 2px; border: none; background: none; color: inherit; font: inherit; cursor: pointer; }
.impl-list { overflow: hidden; border: 1px solid var(--border-subtle); border-radius: var(--r-md); background: var(--bg-page); }
.impl-list-row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-top: 1px solid var(--border-subtle); }
.impl-list-row:first-child { border-top: none; }
.impl-list-row form { margin: 0; }
.impl-grow { flex: 1; min-width: 0; }
.impl-not-found { display: grid; gap: var(--s-2); }
.impl-not-found summary::-webkit-details-marker { display: none; }
.impl-new-school-fields { display: grid; gap: var(--s-2); margin-top: 10px; }
.impl-new-school-fields .field { margin-bottom: 0; }
.impl-new-school-fields > .btn { justify-self: start; }

/* Detail sekolah: toolbar, tab bar, checklist grid, Ringkasan */
.impl-push { margin-left: auto; }
.impl-sibling { display: inline-flex; align-items: center; gap: var(--s-2); }
.impl-sibling .btn.sm { width: 28px; padding: 0; }
.impl-sibling .inline-select > .menu > summary { min-width: 260px; height: 34px; font: var(--type-label-strong); }
.impl-kebab > summary { padding: 0 10px; }
.impl-kebab > .menu-panel { left: auto; right: 0; min-width: 220px; }
.impl-kebab .menu-row.danger { color: var(--status-error); }
.impl-stats { margin-bottom: var(--s-4); }
.impl-tabs .tab { display: inline-flex; align-items: center; gap: 6px; }
.table-wrap.impl-table { overflow: visible; }
.impl-grid { display: grid; grid-template-columns: 20px minmax(200px, 1fr) 104px 92px 80px 116px 76px 84px 108px 28px; gap: var(--s-2); align-items: center; min-height: 56px; padding: var(--s-2) var(--s-3); border-top: 1px solid var(--border-subtle); }
.impl-grid.head { min-height: 44px; border-top: none; border-radius: var(--r-md) var(--r-md) 0 0; background: var(--gray-50); font: var(--type-caption-strong); color: var(--fg-3); }
.impl-grid.highlight { background: var(--status-warning-bg); }
.impl-grid form { margin: 0; }
.impl-group { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-top: 1px solid var(--border-subtle); background: var(--gray-100); font: var(--type-label-bold); cursor: pointer; }
.impl-group .dim { font: var(--type-label); }
.empty-state.impl-grid-empty { padding: var(--s-6); }
.impl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); min-width: 0; }
.impl-item .impl-error { flex-basis: 100%; margin-top: 0; }
.impl-item-title { font: var(--type-label-strong); color: var(--fg-1); }
.impl-item-title.done { color: var(--fg-3); }
.impl-qty-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.impl-qty-cell .progress.sm { width: 64px; margin-left: 4px; }
.impl-qty { display: flex; align-items: center; gap: 2px; }
.impl-inline { display: inline; }
.impl-cell-input { width: 100%; padding: 2px 4px; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--fg-1); font: var(--type-caption); }
.impl-cell-input:hover, .impl-cell-input:focus { border-color: var(--border-subtle); background: var(--bg-page); }
.impl-cell-input.narrow { width: 34px; text-align: center; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.impl-cell-input.narrow::-webkit-inner-spin-button, .impl-cell-input.narrow::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.impl-cell-input::placeholder { color: var(--fg-3); }
.impl-error { margin-top: 4px; font: var(--type-caption); color: var(--status-error); }
.impl-attach-cell { min-width: 0; }
.impl-attach {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px;
  border: 1px solid var(--border-soft); border-radius: var(--r-pill); background: var(--bg-soft); color: var(--fg-brand); font: var(--type-caption-strong);
}
.impl-attach:hover { border-color: var(--border-hover); }
.impl-attach-more { color: var(--fg-3); }
.btn.impl-del { width: 28px; padding: 0; color: var(--fg-3); opacity: 0; }
.impl-grid:hover .btn.impl-del, .impl-grid:focus-within .btn.impl-del { opacity: 1; }
.btn.impl-del:hover { background: var(--status-error-bg); color: var(--status-error); }
.impl-summary { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s-4); }
.impl-stage-row { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-2) 0; }
.impl-stage-name { width: 160px; font: var(--type-label-strong); }
.impl-late-date { color: var(--status-error); }
/* Setting Template */
.impl-grid.tmpl { grid-template-columns: 128px minmax(200px, 1fr) 240px 120px 76px 28px; }
.impl-dialog { padding: 0; border: none; background: transparent; }
.impl-dialog::backdrop { background: var(--overlay); }

/* Detail item modal: tab bar, attachments, notes */
.impl-modal-tabs { flex: none; margin: 0; padding: 0 28px; }
.impl-attach-form { display: flex; align-items: flex-end; gap: var(--s-3); }
.impl-attach-form .field { margin-bottom: 0; }
.impl-attach-name { width: 180px; }
.impl-notes { max-height: 320px; overflow-y: auto; }
.impl-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: var(--s-3); border-top: 1px solid var(--border-subtle); }
.impl-note:first-child { border-top: none; }
.impl-note-head { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.impl-note-head .btn { margin-left: auto; }
.impl-note-body { margin-top: 4px; font: var(--type-label); white-space: pre-wrap; }
.impl-note-form { display: grid; gap: var(--s-2); }
.impl-note-form .divider { margin: var(--s-2) 0 0; }
.impl-note-form .field { margin-bottom: 0; }
.impl-note-form .actions { margin-top: 0; justify-content: flex-end; }

/* ==== Page sections — Wave 2 tasks only, inside their own marker; prefer none ==== */

/* ---- page: tasks-list ---- */
.tasks-row-menu > summary { width: 32px; padding: 0; justify-content: center; border-color: transparent; background: none; }
.tasks-row-menu > .menu-panel { left: auto; right: 0; min-width: 180px; }
.tasks-row-menu form { margin: 0; }
.tasks-row-menu .menu-row { width: 100%; border: 0; background: none; text-align: left; }
.tasks-row-menu .menu-row.danger { color: var(--status-error); }
.t-label-bold.done { text-decoration: line-through; }
.tasks-fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
#entity-picker .search { flex: 1 1 auto; width: 100%; }
#entity-picker .tab-panel { margin-top: var(--s-3); }
.selected-card .stack { flex: 1; min-width: 0; gap: var(--s-1); }


/* ==== Ask home ==== (/ — search box, instant results, AI answer card) */
.ask-home { display: flex; flex-direction: column; gap: var(--s-5); max-width: 1040px; }
.ask-hero h1 { margin: var(--s-6) 0 0; font: var(--type-h1); letter-spacing: var(--ls-h1); color: var(--fg-1); }
.ask-hero p { margin: var(--s-1) 0 0; font: var(--type-lede); color: var(--fg-3); }
.ask-box { position: relative; display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-2) 0 var(--s-4); border: 1px solid var(--border-subtle); border-radius: var(--r-lg); background: var(--bg-page); box-shadow: var(--shadow-sm); }
.ask-box:focus-within { border-color: var(--brand-300); box-shadow: var(--shadow-sm), 0 0 0 4px var(--focus-ring); }
.ask-box > .icon { width: 22px; height: 22px; flex: none; color: var(--fg-4); }
.ask-box input { flex: 1 1 auto; min-width: 0; max-width: none; height: 56px; padding: 0; border: 0; background: none; box-shadow: none; font: var(--type-body); }
.ask-box input:focus { outline: none; box-shadow: none; }
.ask-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ask-kbd { padding: 1px 7px; border: 1px solid var(--border-subtle); border-radius: var(--r-xs); background: var(--bg-soft); font: var(--type-num-caption); color: var(--fg-3); }
.ask-note { margin: 0 0 var(--s-3); font: var(--type-caption); color: var(--fg-3); }
.ask-chips { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); }
.ask-chip { display: inline-flex; align-items: center; gap: var(--s-1); padding: 4px 12px; border: 1px solid var(--border-subtle); border-radius: var(--r-pill); background: var(--bg-page); font: var(--type-caption-strong); color: var(--fg-2); text-decoration: none; }
.ask-chip:hover { border-color: var(--border-hover); color: var(--fg-1); }
.ask-chip.ask { border-color: var(--brand-200); background: var(--brand-25); color: var(--brand-700); }
.ask-chip.ask:hover { background: var(--brand-50); }
a.pill { text-decoration: none; }
a.pill:hover { color: var(--fg-1); }
.ask-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--s-4); align-items: start; }
#results:has(> *) ~ .ask-main { display: none; }
#results > * + * { margin-top: var(--s-3); }
.ask-main { display: flex; flex-direction: column; gap: var(--s-5); }
.ask-tabs { margin-bottom: var(--s-3); }
.ask-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: var(--s-4); align-items: start; }
.ask-group { padding: var(--s-4); }
.ask-group .card-head { margin-bottom: var(--s-3); }
.ask-group .pager-foot { padding: var(--s-3) 0 0; border-top: 0; }
.ask-row { text-decoration: none; }
.ask-snippet { font: var(--type-caption); color: var(--fg-2); }
.ask-snippet mark { padding: 0 2px; border-radius: var(--r-xs); background: var(--amber-100); color: var(--fg-1); }
.ask-home .badge.info { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.ask-best { display: flex; align-items: center; gap: var(--s-4); border-color: var(--brand-200); text-decoration: none; color: inherit; }
.ask-best:hover { background: var(--bg-soft); }
.ask-best-main { display: flex; flex-direction: column; gap: var(--s-1); flex: 1 1 auto; min-width: 0; }
.ask-best-title { font: var(--type-h3); color: var(--fg-1); }
.ask-card { display: flex; flex-direction: column; gap: var(--s-3); }
.ask-card-head { display: flex; align-items: center; gap: var(--s-2); color: var(--fg-accent); }
.ask-card-head .icon { width: 18px; height: 18px; }
.ask-card-head h2 { margin: 0; font: var(--type-h3); color: var(--fg-1); }
.ask-card p { margin: 0; }
.ask-headline { font: var(--type-h3); color: var(--fg-1); }
.ask-big { font: var(--type-display); letter-spacing: var(--ls-display); color: var(--fg-1); }
.ask-card .table-wrap { box-shadow: none; }
.ask-card-foot { align-items: center; }
.ask-error { border-color: var(--error-200); }
.ask-error .ask-card-head { color: var(--status-error); }
.ask-steps { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; padding: 0; list-style: none; font: var(--type-label); color: var(--fg-3); }
.ask-steps li { display: flex; align-items: center; gap: var(--s-2); }
.ask-steps li.done { color: var(--fg-2); }
.ask-steps li.done .icon { width: 16px; height: 16px; color: var(--success-500); }
.ask-steps li.busy { color: var(--fg-1); }
.ask-step-dot { width: 16px; height: 16px; border: 2px solid var(--border-subtle); border-radius: 50%; }
.ask-spinner { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand-600); border-right-color: transparent; animation: btn-spin .8s linear infinite; }
.ask-also h2 { margin: 0; font: var(--type-label-bold); color: var(--fg-1); }
.ask-also .row { margin-bottom: var(--s-2); }
.ask-empty { display: flex; flex-direction: column; gap: var(--s-3); }
@media (max-width: 640px) {
  .ask-groups, .ask-columns { grid-template-columns: minmax(0, 1fr); }
  .ask-box .btn.secondary .icon { display: none; }
}

/* page: channels */
@media (min-width: 901px) { .detail-grid.narrow-rail { grid-template-columns: minmax(0, 1fr) 360px; } }
.card.soft { background: var(--bg-soft); border: 0; box-shadow: none; }
.about-list { margin: 0; padding-left: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); font: var(--type-caption); color: var(--fg-2); }

/* page: Pena Modules */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--s-4); align-items: start; }
.module-card[hidden], .module-row[hidden], #module-nohit[hidden] { display: none; }
.module-card .card-head h3 { margin: 0; font: var(--type-h3); color: var(--fg-1); }
.module-rows { display: flex; flex-direction: column; }
.module-row { display: flex; align-items: flex-start; gap: var(--s-2); padding: 6px 0; border-top: 1px solid var(--border-subtle); }
.module-row:first-child { border-top: none; }
.module-row > .badge { margin-top: 5px; }
.module-row > .module-unused { margin-top: 6px; }
.module-row > .btn { margin-top: 1px; }
.module-unused.toolbar-end { margin-left: auto; }
.module-row > .badge, .module-row > .module-unused, .module-row > .save-state { flex: none; }
.module-unused { color: var(--fg-3); white-space: nowrap; }
.module-rename { flex: 1 1 auto; min-width: 0; }
.module-name {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-xs);
  background: transparent; color: var(--fg-1); font: var(--type-label-bold); cursor: text;
}
.module-name:hover, .module-name:focus { border-color: var(--border-subtle); background: var(--bg-page); }
.module-rename-bar { display: none; align-items: center; flex-wrap: wrap; gap: var(--s-2); padding: 6px 0 4px 8px; }
.module-rename:focus-within .module-rename-bar { display: flex; }
.module-rename .hint { margin: 0 0 0 8px; }
.module-rename-bar .hint { margin: 0; }

/* page: users */
.user-actions .btn.sm { width: 28px; padding: 0; justify-content: center; }
.user-row-menu > summary { width: 28px; height: 28px; padding: 0; justify-content: center; border-color: transparent; background: none; }
.user-row-menu > .menu-panel { left: auto; right: 0; min-width: 180px; }
.user-row-menu .menu-row.danger { color: var(--status-error); }
.field .input-error { border-color: var(--status-error); }
.user-ua { max-width: 240px; }

/* page: imports */
.import-group { display: flex; flex-direction: column; gap: var(--s-2); }
.import-group-head { display: flex; align-items: baseline; gap: var(--s-2); }
.import-group-head .eyebrow { margin: 0; }
.import-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s-4); }
.import-card { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-4); }
.import-card > p { margin: 0; color: var(--fg-2); }
.import-card .stat-icon, #sevima-card .stat-icon { background: var(--bg-muted); color: var(--fg-2); }
.import-card-head > p { flex: 1; min-width: 0; margin: 0; }
.import-card-head { display: flex; align-items: center; gap: var(--s-3); }
.import-card-head h3 { margin: 0; font: var(--type-h3); color: var(--fg-1); }
.import-card-head p { margin: 0; }
.import-card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: auto; }
.card.soft { background: var(--bg-soft); box-shadow: none; }
.card.soft ul { margin: var(--s-2) 0 0; padding-left: 18px; font: var(--type-label); color: var(--fg-2); display: flex; flex-direction: column; gap: var(--s-2); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-8) var(--s-5); border: 2px dashed var(--border-soft); border-radius: var(--r-md); background: var(--bg-soft); color: var(--fg-2); text-align: center; cursor: pointer; }
.dropzone svg { width: 24px; height: 24px; color: var(--fg-brand); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:focus-within { outline: none; box-shadow: 0 0 0 4px var(--focus-ring); border-color: var(--brand-300); }
.dropzone.dragover { border-color: var(--brand-300); background: var(--brand-25); }
.dz-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-4); }
.dz-file { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border: 1px solid var(--border-soft); border-radius: var(--r-sm); background: var(--bg-page); }
.dz-file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--type-label-strong); }
.dz-file.error { background: var(--status-error-bg); border-color: color-mix(in srgb, var(--status-error) 25%, var(--white)); color: var(--status-error); }
.table-scroll.capped { max-height: 440px; overflow-y: auto; }
.dz-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }

/* page: dashboard — KPI row, then the activity feed beside the month's results */
.stat-grid + .dash-grid { margin-top: var(--s-5); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-5); align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.feed-rows { margin: calc(var(--card-pad) * -1) calc(var(--card-pad) * -1); }
.feed-rows > .list-row { padding: 10px var(--card-pad); font: var(--type-cell); }
.feed-rows > .empty-state { padding: var(--card-pad); }
/* Tile — a number on a soft ground inside a card (Metronic "overview" tiles) */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); }
.tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--s-4) var(--s-3); border-radius: var(--r-sm); background: var(--bg-soft); text-align: center; }
.tile-value { font: var(--type-stat); font-variant-numeric: tabular-nums; color: var(--fg-1); }
.tile-value.success { color: var(--status-success); }
.tile-value.error { color: var(--status-error); }
.tile-label { font: var(--type-label-strong); color: var(--fg-2); }
.tile-sub { font: var(--type-caption); font-variant-numeric: tabular-nums; color: var(--fg-3); }
