/* ============================================================================
   ECLIPSE CANON — Light Cloud (Spike-derived DNA)
   Sumber: wrappixel/spike-nextjs-free (MUI v9 theme) → didekode jadi CSS vanilla.
   Filosofi: STRUKTUR dikunci, WARNA satu variabel. Ganti --brand → semua ikut.
   Pakai: <link rel="stylesheet" href="eclipse.css">  lalu override --brand di :root.
   ========================================================================== */

/* Manrope (pengganti Plus Jakarta Sans — aturan Lumi). Self-host kalau bisa. */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ═══ 1. BRAND — SATU-SATUNYA yang diganti tiap projek ═══════════════════
     Default = Spike azure. Contoh swap:
       wa.grubhr  → --brand:#00A884; --brand-tint:#e0f4ef;
       cortex     → --brand:#00c489; --brand-tint:#e2f8f0;
     --brand-tint = versi ~8% buat bg pill/hover. --brand-contrast = teks di atas brand. */
  --brand:          #0085db;
  --brand-tint:     color-mix(in srgb, var(--brand) 13%, #ffffff);
  --brand-contrast: #ffffff;

  /* ═══ 2. INK & SURFACE — dikunci (netral, bikin brand "pop") ═════════════ */
  --canvas:   #F0F5F9;   /* background app/halaman */
  --paper:    #ffffff;   /* background card */
  --ink:      #111c2d;   /* teks utama (navy near-black) */
  --ink-soft: #707a82;   /* teks sekunder */
  --muted:    #adb0bb;   /* axis chart / paling redup */
  --divider:  #e5eaef;   /* garis pemisah */
  --hover:    #f6f9fc;   /* bg hover baris/row */
  --grey-100: #F2F6FA; --grey-200: #f0f5f9; --grey-300: #DFE5EF;
  --grey-400: #7C8FAC; --grey-500: #5A6A85;

  /* ═══ 3. STATE SEMANTIK — dikunci (dipakai apa adanya, jarang di-rebrand) ═ */
  --success: #4bd08b; --success-tint: #dffff3;
  --info:    #46caeb; --info-tint:    #e1f5fa;
  --warning: #f8c076; --warning-tint: #fff6ea; --warning-ink: #d99733;
  --error:   #fb977d; --error-tint:   #ffede9;

  /* ═══ CHART PALETTE (kategorikal terkoordinasi — pola shadcn/21st --chart-N).
     chart-1 = brand (ikut swap warna), chart-2..6 = hue komplementer harmonis
     buat pie / donut multi-kategori / multi-series. Single-series tetap pakai --brand. ═══ */
  --chart-1: var(--brand);
  --chart-2: #14b8a6;  /* teal   */
  --chart-3: #f5a623;  /* amber  */
  --chart-4: #8b5cf6;  /* violet */
  --chart-5: #fb7185;  /* rose   */
  --chart-6: #38bdf8;  /* sky    */

  /* ═══ 4. TIPOGRAFI — dikunci. Semua heading 600, angka besar 700 ═════════ */
  --font: 'Manrope', -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-h1: 2.25rem;    --lh-h1: 2.75rem;
  --fs-h2: 1.875rem;   --lh-h2: 2.25rem;
  --fs-h3: 1.5rem;     --lh-h3: 1.75rem;
  --fs-h4: 1.3125rem;  --lh-h4: 1.6rem;
  --fs-h5: 1.125rem;   --lh-h5: 1.6rem;
  --fs-h6: 1rem;       --lh-h6: 1.2rem;
  --fs-body: 0.875rem; --lh-body: 1.334rem;   /* 14px — ukuran teks default */
  --fs-small: 0.75rem; --lh-small: 1rem;       /* 12px — caption/label */
  --fw-reg: 400; --fw-med: 500; --fw-semi: 600; --fw-bold: 700;

  /* ═══ 5. RADIUS — dikunci. Kartu lembut, tombol/input pill ═══════════════ */
  --r-card: 18px;   /* card */
  --r-pill: 25px;   /* button + input (ciri khas Spike) */
  --r-chip: 10px;   /* badge/chip kecil */
  --r-sm:   6px;    /* elemen kecil / bar chart */

  /* ═══ 6. SHADOW — dikunci. SATU shadow lembut (Spike elevation-9) ════════
     Free source = netral 5% hitam. Mau nge-brand? ganti jadi
     0 9px 17.5px color-mix(in srgb, var(--brand) 12%, transparent). */
  --shadow-card: 0 9px 17.5px rgba(0,0,0,0.05);
  --shadow-pop:  0 12px 32px rgba(0,0,0,0.10);

  /* ═══ 7. SPACING & LAYOUT — dikunci ═════════════════════════════════════ */
  --pad-card: 30px;   /* padding dalam card */
  --gap: 24px;        /* jarak antar card / grid gap */
  --sidebar-w: 270px; /* lebar sidebar */
  --header-h: 70px;   /* tinggi topbar */
  --maxw: 1200px;     /* lebar konten maksimum */

  /* ═══ 8. FOUNDATION SCALES — upgrade 2026 (review gpt-5-pro). ADITIF: nambah
     token skala + semantik + a11y. NOL ubah look. Semua NETRAL/turunan brand
     → tetap aman swap --brand. Pakai ini buat kerjaan baru. ═══════════════ */
  /* Spacing scale 4/8 (—gap & —pad-card lama tetap dipakai) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-7: 28px; --space-8: 32px;
  --space-9: 40px; --space-10: 48px; --space-12: 64px;
  /* Tinggi kontrol (target tap; ≥40 desktop, ≥44 utama) */
  --control-h-sm: 40px; --control-h-md: 44px; --control-h-lg: 52px;
  /* Z-index scale (ganti angka literal 45 dll) */
  --z-nav: 30; --z-popover: 40; --z-modal: 50; --z-toast: 60; --z-tooltip: 70;
  /* Motion */
  --duration-100: 100ms; --duration-150: 150ms; --duration-200: 200ms; --duration-300: 300ms;
  --ease-standard: cubic-bezier(.2,0,0,1); --ease-emphasized: cubic-bezier(.2,0,0,1.2);
  /* Teks semantik (JANGAN pakai --muted buat teks) */
  --text-primary: var(--ink); --text-secondary: var(--ink-soft);
  --text-disabled: #b8c2cc; --text-inverse: #ffffff;
  /* Border scale (—divider = subtle) */
  --border-subtle: var(--divider); --border: #cfd6df; --border-strong: #7C8FAC;
  /* Form field */
  --field-bg: var(--paper); --field-border: #cfd6df; --field-placeholder: #adb0bb;
  --field-disabled-bg: #F2F6FA; --field-disabled-ink: #9aa3ae;
  --field-focus-border: var(--brand); --field-invalid-border: var(--error);
  /* Focus ring a11y */
  --focus-ring-color: var(--brand); --focus-ring-width: 3px; --focus-ring-alpha: 55%;
  /* Overlay / chart / skeleton */
  --scrim: rgba(17,28,45,.5);
  --chart-grid: rgba(0,0,0,.08); --chart-axis: #adb0bb;
  --skeleton-base: #e9eff5; --skeleton-shimmer: #f5f8fb;
  /* Link netral (bukan aksen kedua — pair sama underline di konten) */
  --link: var(--ink); --link-hover: #0b2a4a;
  /* Elevation alias (look SAMA, nama jelas) */
  --elev-1: var(--shadow-card); --elev-2: var(--shadow-pop);
}

/* ═══ DARK MODE (bonus) — struktur SAMA, tinggal balik ink/surface.
   Aktifkan: <html data-theme="dark">. Brand tetap dominan. ═══════════════ */
/* Dark mode = nilai ASLI Spike Pro (navy, bukan hitam). Card LEBIH gelap dari canvas. */
[data-theme="dark"] {
  --canvas:   #15263A;   /* bg halaman (navy) */
  --paper:    #111C2D;   /* card (lebih gelap dari canvas = recessed) */
  --ink:      #EAEFF4;
  --ink-soft: #aeb9d0;
  --muted:    #7C8FAC;
  --divider:  #333F55;
  --hover:    #2a3a52;
  --grey-100: #333F55; --grey-200: #465670; --grey-300: #7C8FAC;
  /* tint ikut --brand otomatis (color-mix), override inline dari swatch */
  --brand-tint: color-mix(in srgb, var(--brand) 22%, #15263A) !important;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.25);
  /* dark overrides token foundation (§8) */
  --text-disabled: #6c7c93; --text-inverse: #111c2d;
  --border: #465670; --border-strong: #aeb9d0;
  --field-border: #465670; --field-placeholder: #7C8FAC;
  --field-disabled-bg: #15263A; --field-disabled-ink: #7b8aa2;
  --focus-ring-alpha: 70%;
  --scrim: rgba(0,0,0,.55);
  --chart-grid: rgba(255,255,255,.08); --chart-axis: #7C8FAC;
  --skeleton-base: #1b2a42; --skeleton-shimmer: #243653;
  --link-hover: #f2f7fb;
}

/* ────────────────────────── BASE ──────────────────────────────────────── */
* { box-sizing: border-box; }

/* Scrollbar tipis + AUTO-HIDE: default transparan (ga keliatan), muncul pas
   scroll (shell.js kasih .is-scrolling ke <html> ~800ms) atau hover area scroll. */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.is-scrolling, .is-scrolling * { scrollbar-color: var(--grey-300) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
.is-scrolling::-webkit-scrollbar-thumb, .is-scrolling ::-webkit-scrollbar-thumb { background: var(--grey-300); background-clip: content-box; }
.is-scrolling ::-webkit-scrollbar-thumb:hover { background: var(--grey-400); background-clip: content-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* Scrollbar HALAMAN: sembunyiin native, ganti custom grip kecil-fixed (shell.js).
   Area scroll dalam (sidebar/list) tetap pakai native tipis auto-hide di atas. */
html { scrollbar-width: none; }
html::-webkit-scrollbar { width: 0; height: 0; display: none; }
.ec-cbar { position: fixed; width: 14px; z-index: var(--z-nav); pointer-events: none; } /* di bawah popover/modal (fix blocking) */
.ec-cbar-thumb { position: absolute; right: 3px; width: 5px; border-radius: 999px; background: var(--grey-300);
  opacity: 0; transition: opacity .25s, background .15s; pointer-events: auto; cursor: pointer; }
.ec-cbar.show .ec-cbar-thumb, .ec-cbar-thumb:active { opacity: 1; }
.ec-cbar-thumb:hover { background: var(--grey-400); width: 7px; right: 2px; }
/* container yang pakai custom scrollbar → sembunyiin native-nya */
.ec-cbar-host { scrollbar-width: none; }
.ec-cbar-host::-webkit-scrollbar { width: 0; height: 0; display: none; }
body {
  margin: 0; font-family: var(--font); background: var(--canvas);
  color: var(--ink); font-size: var(--fs-body); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;   /* angka rata-lebar → KPI/tabel/harga sejajar (gpt-5-pro) */
}
h1,h2,h3,h4,h5,h6 { margin: 0; font-weight: var(--fw-semi); color: var(--ink); }
h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); }
h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); }
h5 { font-size: var(--fs-h5); line-height: var(--lh-h5); }
h6 { font-size: var(--fs-h6); line-height: var(--lh-h6); }
a { color: var(--link); text-decoration: none; }
/* Link KONTEN (bare <a>) = underline netral (a11y WCAG 1.4.1 "use of color"). Link komponen
   (nav-item/btn/breadcrumb/dropdown/pagination/mk-nav — pakai class) TIDAK kena underline. */
a:not([class]) { text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: 2px; }
a:not([class]):hover { color: var(--link-hover); text-decoration-thickness: .12em; }
/* Reset: link KOMPONEN nav/menu (bare <a> tapi di-style parent) → JANGAN underline */
.breadcrumb a, .dropdown-menu a, .mk-nav a, .mk-footer a, .pagination a,
.timeline a, .ec-tabs a, .stepper a { text-decoration: none; }   /* .toast a sengaja TIDAK di-reset (link konten toast tetap underline, WCAG 1.4.1) */
.text-soft { color: var(--ink-soft); }
.text-small { font-size: var(--fs-small); line-height: var(--lh-small); }
.text-brand { color: var(--brand); }

/* ── A11Y (upgrade gpt-5-pro): focus-visible ring, reduced-motion, forced-colors ── */
:where(a,button,[role="button"],.btn,.chip,.ec-tab,.nav-item,.list-row,.segment button,
  input,select,textarea,summary,.m-tab,.ms-item,.m-iconbtn):focus-visible {
  outline: none;
  /* 2-lapis (fix gpt-5-pro): gap warna kertas + ring brand → keliatan di bg apa pun (termasuk brand-tint) */
  box-shadow: 0 0 0 2px var(--paper),
              0 0 0 calc(var(--focus-ring-width) + 2px) color-mix(in srgb, var(--focus-ring-color) var(--focus-ring-alpha), transparent);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {          /* high-contrast OS → balikin scrollbar native + outline fokus (box-shadow di-suppress) */
  .ec-cbar { display: none !important; }
  html { scrollbar-width: auto; }
  :where(a,button,[role="button"],.btn,.chip,.ec-tab,.nav-item,.list-row,.segment button,
    input,select,textarea,summary,.m-tab,.ms-item,.m-iconbtn):focus-visible {
    outline: 2px solid CanvasText; outline-offset: 2px; box-shadow: none;
  }
}

/* ────────────────────────── CARD ──────────────────────────────────────── */
.card {
  background: var(--paper); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: var(--pad-card);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--gap); gap: 16px;
}
.card-head h5 { font-size: var(--fs-h5); }

/* ────────────────────────── BUTTON ────────────────────────────────────── */
.btn {
  font-family: var(--font); font-size: var(--fs-body); font-weight: var(--fw-med);
  border: none; border-radius: var(--r-pill); padding: 10px 22px; cursor: pointer;
  background: var(--brand); color: var(--brand-contrast);
  box-shadow: none; transition: filter .15s, transform .15s;
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h-sm); /* target tap ≥40 */
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-ghost {
  background: var(--brand-tint); color: var(--brand);
}
.btn-outline {
  background: transparent; color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}
.btn-soft { background: var(--hover); color: var(--ink); }

/* ────────────────────────── CHIP / BADGE (tint bg + saturated text) ────── */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-small); font-weight: var(--fw-semi); line-height: 1;
  padding: 5px 10px; border-radius: var(--r-chip);
  background: var(--brand-tint); color: var(--brand);
}
.chip-success { background: var(--success-tint); color: var(--success); }
.chip-info    { background: var(--info-tint);    color: var(--info); }
.chip-warning { background: var(--warning-tint); color: var(--warning-ink); }
.chip-error   { background: var(--error-tint);   color: var(--error); }

/* ────────────────────────── STAT / KPI CARD ───────────────────────────── */
.stat-number { font-size: var(--fs-h3); font-weight: var(--fw-bold); color: var(--ink); }
.stat-delta { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; }
.delta-dot {
  width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.delta-up   { background: var(--success-tint); color: var(--success); }
.delta-down { background: var(--error-tint);   color: var(--error); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ────────────────────────── SIDEBAR NAV ───────────────────────────────── */
.ec-shell { display: flex; min-height: 100vh; }
.ec-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--paper);
  padding: 20px; border-right: 1px solid var(--divider);
  height: 100vh; position: sticky; top: 0; overflow-y: auto;
}
.ec-main { flex: 1; min-width: 0; }
.ec-topbar {
  height: var(--header-h); background: var(--paper);
  border-bottom: 1px solid var(--divider);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
/* Dashboard/app = FLUID isi penuh (JANGAN cap+nempel-kiri = dead space kanan).
   Halaman baca (form/settings) pakai .narrow → kolom terpusat, margin seimbang. */
.ec-content { padding: var(--gap); width: 100%; }
.ec-content.wide-cap { max-width: 1600px; margin-inline: auto; }   /* opsional: cap+center di ultrawide */
.ec-content.narrow { max-width: 960px; margin-inline: auto; }       /* form/settings terpusat */

/* Two-pane: rail kiri + konten kanan (settings, master-detail, docs). Isi penuh lebar. */
.ec-two-pane { display: grid; grid-template-columns: 260px 1fr; gap: var(--gap); align-items: start; }
.ec-two-pane .rail { position: sticky; top: var(--gap); }
@media (max-width: 820px) { .ec-two-pane { grid-template-columns: 1fr; } .ec-two-pane .rail { position: static; } }
.nav-subhead {
  font-size: var(--fs-small); font-weight: var(--fw-bold); text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin: 18px 12px 8px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px; color: var(--ink-soft);
  font-weight: var(--fw-med); cursor: pointer; transition: background .12s, color .12s;
}
.nav-item svg { width: 22px; height: 22px; flex-shrink: 0; }
.nav-item:hover { background: var(--brand-tint); color: var(--brand); }
.nav-item.is-active { background: var(--brand); color: var(--brand-contrast); }
.nav-item.is-active svg { color: var(--brand-contrast); }

/* ────────────────────────── TABLE (bersih, garis tipis) ────────────────── */
.ec-table { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.ec-table th {
  text-align: left; color: var(--ink-soft); font-weight: var(--fw-semi);
  font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .03em;
  padding: 12px 16px; border-bottom: 1px solid var(--divider);
}
.ec-table td { padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.ec-table tr:hover td { background: var(--hover); }

/* ────────────────────────── INPUT (pill outlined) ─────────────────────── */
.ec-input {
  font-family: var(--font); font-size: var(--fs-body); color: var(--ink);
  background: var(--field-bg); border: 1px solid var(--field-border);
  border-radius: var(--r-pill); padding: 11px 18px; width: 100%; min-height: var(--control-h-md);
}
.ec-input::placeholder { color: var(--field-placeholder); }
.ec-input:focus { outline: none; border-color: var(--field-focus-border); }
.ec-input:disabled { background: var(--field-disabled-bg); color: var(--field-disabled-ink); cursor: not-allowed; }
.ec-input[aria-invalid="true"], .ec-input.is-invalid { border-color: var(--field-invalid-border); }

/* ────────────────────────── GRID HELPER ───────────────────────────────── */
.ec-grid { display: grid; gap: var(--gap); }
.ec-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ec-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ec-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .ec-grid-2,.ec-grid-3,.ec-grid-4 { grid-template-columns: 1fr; }
  .ec-sidebar { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODUL HALAMAN — komponen tambahan buat multi-page app (chat/report/setting)
   Semua tetap token-driven. Warna dari --brand.
   ════════════════════════════════════════════════════════════════════════ */

/* ── Avatar ── */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-tint); color: var(--brand); font-weight: var(--fw-bold);
  overflow: hidden; font-size: var(--fs-body);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-small); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--fs-h4); }

/* ── Tabs (underline) ── */
.ec-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); }
.ec-tab {
  padding: 12px 16px; font-weight: var(--fw-med); color: var(--ink-soft);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font); font-size: var(--fs-body);
}
.ec-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ── Segmented control ── */
.segment { display: inline-flex; background: var(--canvas); border-radius: var(--r-pill); padding: 4px; }
.segment button {
  border: none; background: none; padding: 7px 16px; border-radius: var(--r-pill);
  font-family: var(--font); font-size: var(--fs-small); font-weight: var(--fw-med);
  color: var(--ink-soft); cursor: pointer;
}
.segment button.is-active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-card); }

/* ── Toggle switch ── */
.ec-toggle { position: relative; width: 42px; height: 24px; display: inline-block; flex-shrink: 0; }
.ec-toggle input { opacity: 0; width: 0; height: 0; }
.ec-toggle .track {
  position: absolute; inset: 0; background: var(--grey-300); border-radius: 999px; transition: background .18s;
}
.ec-toggle .track::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .18s;
}
.ec-toggle input:checked + .track { background: var(--brand); }
.ec-toggle input:checked + .track::before { transform: translateX(18px); }

/* ── Form field ── */
.field { margin-bottom: 18px; }
.field > label { display: block; font-size: var(--fs-small); font-weight: var(--fw-semi); color: var(--ink-soft); margin-bottom: 7px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ── List row (inbox / customer / setting) ── */
.list-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border-radius: 12px; cursor: pointer; transition: background .12s;
}
.list-row:hover { background: var(--hover); }
.list-row.is-active { background: var(--brand-tint); }
.list-row > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--ink-soft); }
.list-row.is-active > svg, .list-row.is-active .t { color: var(--brand); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow .t { font-weight: var(--fw-semi); color: var(--ink); }
.list-row .grow .s { font-size: var(--fs-small); color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .meta { font-size: var(--fs-small); color: var(--muted); text-align: right; flex-shrink: 0; }

/* ── Search input (ikon di kiri) ── */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search input {
  font-family: var(--font); font-size: var(--fs-body); color: var(--ink); width: 100%;
  background: var(--canvas); border: 1px solid transparent; border-radius: var(--r-pill);
  padding: 10px 16px 10px 40px;
}
.search input:focus { outline: none; border-color: var(--brand); background: var(--paper); }

/* ── CHAT ── */
.chat-layout { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--header-h)); }
.chat-list { border-right: 1px solid var(--divider); overflow-y: auto; padding: 12px; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--canvas); }
.bubble { max-width: 68%; padding: 11px 15px; border-radius: 16px; line-height: 1.45; font-size: var(--fs-body); box-shadow: var(--shadow-card); }
.bubble.in  { background: var(--paper); color: var(--ink); border-bottom-left-radius: 5px; align-self: flex-start; }
.bubble.out { background: var(--brand); color: var(--brand-contrast); border-bottom-right-radius: 5px; align-self: flex-end; }
.bubble .time { display: block; font-size: 10px; opacity: .6; margin-top: 4px; }
.chat-composer { display: flex; gap: 10px; padding: 16px; border-top: 1px solid var(--divider); background: var(--paper); align-items: center; }
.typing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; animation: ecblink 1.2s infinite; }
@keyframes ecblink { 0%,60%,100%{opacity:.3} 30%{opacity:1} }

/* ── Progress bar ── */
.bar { height: 8px; background: var(--canvas); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   MODUL UI-KIT — komponen tambahan buat galeri (components/forms/auth)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Auth split layout (login/register/forgot/2fa — standalone, tanpa shell) ── */
.ec-auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.ec-auth .auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--paper); }
.ec-auth .auth-box { width: 100%; max-width: 380px; }
.ec-auth .auth-art {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 20px; padding: 48px; color: #fff; text-align: center;
  background:
    radial-gradient(120% 120% at 78% 12%, color-mix(in srgb, var(--brand) 62%, #fff) 0%, transparent 55%),
    linear-gradient(150deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 74%, #000) 100%);
}
.ec-auth .auth-art h2, .ec-auth .auth-art h3 { color: #fff; }
@media (max-width: 820px) { .ec-auth { grid-template-columns: 1fr; } .ec-auth .auth-art { display: none; } }

/* ── Alert ── */
.alert {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border-radius: 12px; font-size: var(--fs-body); background: var(--brand-tint); color: var(--ink);
  border-left: 3px solid var(--brand);
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--brand); }
.alert-success { background: var(--success-tint); border-left-color: var(--success); } .alert-success svg { color: var(--success); }
.alert-info    { background: var(--info-tint);    border-left-color: var(--info); }    .alert-info svg { color: var(--info); }
.alert-warning { background: var(--warning-tint); border-left-color: var(--warning); } .alert-warning svg { color: var(--warning-ink); }
.alert-error   { background: var(--error-tint);   border-left-color: var(--error); }   .alert-error svg { color: var(--error); }

/* ── Breadcrumb ── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); color: var(--ink-soft); }
.breadcrumb a { color: var(--ink-soft); } .breadcrumb a:hover { color: var(--brand); }
.breadcrumb .sep { color: var(--muted); }
.breadcrumb .current { color: var(--ink); font-weight: var(--fw-semi); }

/* ── Pagination ── */
.pagination { display: inline-flex; gap: 6px; }
.pagination button, .pagination a {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px; border: 1px solid var(--divider);
  background: var(--paper); color: var(--ink); font-family: var(--font); font-size: var(--fs-small);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.pagination .is-active { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); }

/* ── Spinner ── */
.spinner {
  width: 22px; height: 22px; border-radius: 50%; display: inline-block;
  border: 2.5px solid var(--brand-tint); border-top-color: var(--brand); animation: ecspin .7s linear infinite;
}
@keyframes ecspin { to { transform: rotate(360deg); } }

/* ── Accordion (native details) ── */
.accordion { border: 1px solid var(--divider); border-radius: 12px; overflow: hidden; }
.accordion details { border-bottom: 1px solid var(--divider); }
.accordion details:last-child { border-bottom: none; }
.accordion summary {
  padding: 14px 16px; cursor: pointer; font-weight: var(--fw-semi); list-style: none;
  display: flex; align-items: center; justify-content: space-between;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: '+'; color: var(--muted); font-size: 1.1rem; }
.accordion details[open] summary::after { content: '−'; color: var(--brand); }
.accordion .acc-body { padding: 0 16px 16px; color: var(--ink-soft); font-size: var(--fs-body); }

/* ── Modal (demo: static, pakai .is-open buat tampil) ── */
.modal-overlay {
  position: fixed; inset: 0; background: var(--scrim); display: none;
  align-items: center; justify-content: center; z-index: var(--z-modal); padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal { background: var(--paper); border-radius: var(--r-card); box-shadow: var(--shadow-pop); width: 100%; max-width: 460px; padding: var(--pad-card); }

/* ── Stepper ── */
.stepper { display: flex; align-items: center; gap: 0; }
.stepper .step { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.stepper .step .dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--canvas); color: var(--ink-soft); font-weight: var(--fw-bold); font-size: var(--fs-small); flex-shrink: 0;
}
.stepper .step.done .dot, .stepper .step.active .dot { background: var(--brand); color: var(--brand-contrast); }
.stepper .step.active { color: var(--ink); font-weight: var(--fw-semi); }
.stepper .line { flex: 1; height: 2px; background: var(--divider); margin: 0 12px; min-width: 24px; }
.stepper .line.done { background: var(--brand); }

/* ── Dropdown menu (demo static) ── */
.dropdown-menu {
  background: var(--paper); border: 1px solid var(--divider); border-radius: 12px;
  box-shadow: var(--shadow-card); padding: 6px; min-width: 180px;
}
.dropdown-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); font-size: var(--fs-body); }
.dropdown-menu a:hover { background: var(--hover); }

/* ── Icon tile (buat halaman icons) ── */
.icon-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; border-radius: 12px; border: 1px solid var(--divider); }
.icon-tile:hover { border-color: var(--brand); background: var(--brand-tint); }
.icon-tile svg { width: 24px; height: 24px; color: var(--ink); display: block; }

/* Badge ikon kotak (ikon tunggal, presisi tengah 2 sumbu) — pakai ini buat badge stat/widget */
.icon-badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; flex-shrink: 0; }
.icon-badge svg { display: block; }
.icon-tile span { font-size: 11px; color: var(--ink-soft); }

/* ══════════════════════════════════════════════════════════════════════════
   MODUL POLISH — pola konsistensi lintas-halaman (page header, feedback, dll)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Page header standar (breadcrumb opsional + judul + subjudul + aksi kanan) ── */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--gap); flex-wrap: wrap; }  /* aksi center vs judul (serapan Emergent web-ref + panel) */
.page-head .ph-title { font-size: var(--fs-h3); line-height: var(--lh-h3); font-weight: var(--fw-semi); color: var(--ink); }
.page-head .ph-sub { margin-top: 4px; color: var(--ink-soft); font-size: var(--fs-body); }
.page-head .ph-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── Divider dengan teks tengah ("atau") ── */
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-small); margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--divider); }

/* ── Avatar group (tumpuk) ── */
.avatar-group { display: inline-flex; }
.avatar-group > * { margin-left: -10px; border: 2px solid var(--paper); }
.avatar-group > *:first-child { margin-left: 0; }

/* ── Timeline (aktivitas) ── */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: var(--divider); }
.timeline .tl-item { position: relative; padding-bottom: 20px; }
.timeline .tl-item:last-child { padding-bottom: 0; }
.timeline .tl-item::before { content: ''; position: absolute; left: -22px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.timeline .tl-time { font-size: var(--fs-small); color: var(--muted); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state .es-icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: var(--brand-tint); display: flex; align-items: center; justify-content: center; }
.empty-state .es-icon svg { width: 28px; height: 28px; color: var(--brand); }
.empty-state h5 { color: var(--ink); margin-bottom: 6px; }

/* ── Skeleton loader (shimmer) ── */
.skeleton { position: relative; overflow: hidden; background: var(--skeleton-base); border-radius: 8px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skeleton-shimmer), transparent); animation: ecshimmer 1.4s infinite; }
@keyframes ecshimmer { 100% { transform: translateX(100%); } }
.skeleton-line { height: 12px; margin-bottom: 8px; }

/* ── Toast / notifikasi ── */
.toast-stack { position: fixed; bottom: 24px; inset-inline-end: 24px; display: flex; flex-direction: column; gap: 10px; z-index: var(--z-toast); }
.toast { display: flex; align-items: center; gap: 12px; background: var(--paper); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 14px 16px; min-width: 280px; border-left: 3px solid var(--brand); }
.toast svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--brand); }
.toast.t-success { border-left-color: var(--success); } .toast.t-success svg { color: var(--success); }
.toast.t-error { border-left-color: var(--error); } .toast.t-error svg { color: var(--error); }

/* ── Tooltip (hover CSS) ── */
.tip { position: relative; display: inline-flex; }
.tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px); background: var(--ink); color: var(--paper); font-size: var(--fs-small); padding: 6px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: var(--z-tooltip); }
.tip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Keyboard key ── */
.kbd { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--divider); border-bottom-width: 2px; background: var(--paper); font-family: var(--font); font-size: 12px; font-weight: var(--fw-semi); color: var(--ink-soft); }

/* ── Rating bintang ── */
.rating { display: inline-flex; gap: 2px; color: var(--warning-ink); }
.rating svg { width: 15px; height: 15px; }

/* ── Section label kecil ── */
.section-label { font-size: var(--fs-small); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 0 0 12px; }

/* ══════════════════════════════════════════════════════════════════════════
   MARKETING KIT — layout publik (navbar + hero + fitur + pricing + footer)
   Buat halaman landing/pricing/about dst (bukan app shell). Token-driven.
   ════════════════════════════════════════════════════════════════════════ */
.mk-page { background: var(--paper); }
.mk-container { max-width: 1160px; margin-inline: auto; padding-inline: 24px; }

/* Navbar publik */
.mk-nav { position: sticky; top: 0; z-index: var(--z-nav); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--divider); }
.mk-nav .in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.mk-nav .links { display: flex; gap: 26px; align-items: center; }
.mk-nav .links a { color: var(--ink-soft); font-weight: var(--fw-med); font-size: var(--fs-body); }
.mk-nav .links a:hover { color: var(--brand); }
.mk-brand { display: flex; align-items: center; gap: 10px; font-weight: var(--fw-bold); font-size: 1.2rem; }
.mk-brand img { width: 32px; height: 32px; object-fit: contain; }
@media (max-width: 800px) { .mk-nav .links { display: none; } }

/* Section */
.mk-section { padding: 84px 0; }
.mk-eyebrow { color: var(--brand); font-weight: var(--fw-bold); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .08em; }
.mk-h2 { font-size: 2.25rem; line-height: 1.15; font-weight: var(--fw-bold); letter-spacing: -.02em; margin: 10px 0 0; }
.mk-lead { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.6; max-width: 640px; }
.mk-center { text-align: center; } .mk-center .mk-lead { margin-inline: auto; }

/* Hero */
.mk-hero { padding: 80px 0 72px; position: relative; overflow: hidden; }
.mk-hero h1 { font-size: 3.2rem; line-height: 1.08; font-weight: var(--fw-bold); letter-spacing: -.03em; }
.mk-hero h1 .hl { color: var(--brand); }
@media (max-width: 700px) { .mk-hero h1 { font-size: 2.2rem; } .mk-h2 { font-size: 1.7rem; } }

/* Feature card */
.mk-feature { padding: 26px; border-radius: var(--r-card); border: 1px solid var(--divider); background: var(--paper); transition: transform .15s, box-shadow .15s, border-color .15s; }
.mk-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); border-color: transparent; }
.mk-feature .fi { width: 48px; height: 48px; border-radius: 13px; background: var(--brand-tint); color: var(--brand); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.mk-feature .fi svg { width: 24px; height: 24px; }
.mk-feature h4 { font-size: 1.05rem; margin-bottom: 6px; }
.mk-feature p { color: var(--ink-soft); font-size: var(--fs-body); line-height: 1.55; }

/* Pricing card */
.mk-price { border: 1px solid var(--divider); border-radius: var(--r-card); padding: 30px; background: var(--paper); display: flex; flex-direction: column; }
.mk-price.popular { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-card); position: relative; }
.mk-price .amount { font-size: 2.6rem; font-weight: var(--fw-bold); letter-spacing: -.02em; }
.mk-price .amount small { font-size: 1rem; color: var(--ink-soft); font-weight: var(--fw-med); }
.mk-price ul { list-style: none; padding: 0; margin: 20px 0; display: flex; flex-direction: column; gap: 11px; }
.mk-price li { display: flex; align-items: center; gap: 10px; font-size: var(--fs-body); color: var(--ink-soft); }
.mk-price li svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

/* CTA band */
.mk-cta { border-radius: var(--r-card); padding: 56px 40px; text-align: center; color: #fff;
  background: radial-gradient(120% 120% at 78% 12%, color-mix(in srgb, var(--brand) 62%, #fff) 0%, transparent 55%), linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 72%, #000)); }
.mk-cta h2 { color: #fff; font-size: 2rem; font-weight: var(--fw-bold); }
.mk-cta p { color: color-mix(in srgb, #fff 85%, transparent); margin: 12px 0 24px; }

/* Footer */
.mk-footer { border-top: 1px solid var(--divider); background: var(--canvas); padding: 56px 0 32px; }
.mk-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.mk-footer h5 { font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; }
.mk-footer a { display: block; color: var(--ink-soft); font-size: var(--fs-body); padding: 5px 0; }
.mk-footer a:hover { color: var(--brand); }
.mk-footer .bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--divider); display: flex; justify-content: space-between; color: var(--muted); font-size: var(--fs-small); }
@media (max-width: 800px) { .mk-footer .cols { grid-template-columns: 1fr 1fr; } }

/* Error page (standalone terpusat) */
.mk-error { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; background: var(--canvas); }
.mk-error img { width: 240px; max-width: 70vw; margin-bottom: 8px; }
.mk-error h1 { font-size: 2.4rem; font-weight: var(--fw-bold); }

/* ══════════════════════════════════════════════════════════════════════════
   PDF / PRINT KIT — acuan dokumen A4 (laporan, invoice) siap print/export PDF
   Preview di layar = "kertas" A4 terpusat; @media print = bersih A4.
   ════════════════════════════════════════════════════════════════════════ */
.pdf-canvas { background: var(--canvas); padding: 28px 0; min-height: 100vh; }
.pdf-doc {
  width: 794px; min-height: 1123px;              /* A4 @ 96dpi */
  margin: 0 auto; background: #fff; color: #111c2d;
  padding: 54px 56px; box-shadow: var(--shadow-pop); border-radius: 4px;
  font-family: var(--font); box-sizing: border-box;
}
.pdf-doc h1,.pdf-doc h2,.pdf-doc h3,.pdf-doc h4 { color: #111c2d; }
.pdf-head { display: flex; justify-content: space-between; align-items: flex-start;
  border-bottom: 2px solid var(--brand); padding-bottom: 20px; margin-bottom: 28px; }
.pdf-head .brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.25rem; }
.pdf-head .brand img { width: 34px; height: 34px; object-fit: contain; }
.pdf-head .meta { text-align: right; font-size: 12px; color: #5A6A85; line-height: 1.7; }
.pdf-section { margin-bottom: 17px; page-break-inside: avoid; }
.pdf-section > h3 { font-size: 1rem; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #e5eaef; }
.pdf-kpis { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.pdf-kpi { border: 1px solid #e5eaef; border-radius: 10px; padding: 14px; }
.pdf-kpi .n { font-size: 1.4rem; font-weight: 700; }
.pdf-kpi .l { font-size: 11px; color: #5A6A85; }
.pdf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pdf-table th { text-align: left; background: #F2F6FA; color: #5A6A85; font-weight: 600;
  padding: 9px 12px; border-bottom: 1px solid #e5eaef; }
.pdf-table td { padding: 9px 12px; border-bottom: 1px solid #eef2f7; }
.pdf-bar { height: 9px; background: #eef2f7; border-radius: 6px; overflow: hidden; }
.pdf-bar > span { display: block; height: 100%; background: var(--brand); }
.pdf-foot { margin-top: 34px; padding-top: 14px; border-top: 1px solid #e5eaef;
  display: flex; justify-content: space-between; font-size: 11px; color: #98a2b3; }

@page { size: A4; margin: 14mm; }
@media print {
  html, body, .pdf-canvas { background: #fff !important; padding: 0 !important; }
  .ec-sidebar, .ec-topbar, #ec-side, #ec-top, .ec-cbar, .mk-nav, .mk-footer, .no-print { display: none !important; }
  .pdf-doc { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; border-radius: 0; }
  .pdf-section, .pdf-kpi, tr { page-break-inside: avoid; }
  a { color: inherit !important; text-decoration: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ============================================================
   INTERAKSI (interactions.js) — state + animasi mikro
   ============================================================ */
.modal-overlay.is-open { display: flex; animation: ecFade .18s ease; }
.modal-overlay.is-open .modal { animation: ecPop .24s cubic-bezier(.2,.8,.2,1); }
@keyframes ecFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ecPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* dropdown fungsional — butuh wrapper .dropdown + trigger [data-dropdown] */
.dropdown { position: relative; display: inline-block; }
.dropdown > .dropdown-menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; display: none; z-index: var(--z-popover); animation: ecPop var(--duration-150) var(--ease-standard); }
.dropdown.is-open > .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: var(--fs-small); }
.dropdown-menu a:hover { background: var(--brand-tint); color: var(--brand); }
.dropdown-menu a:hover svg { color: var(--brand) !important; }

.toast { animation: ecToastIn .28s cubic-bezier(.2,.8,.2,1); }
.toast.ec-out { animation: ecToastOut .22s ease forwards; }
@keyframes ecToastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes ecToastOut { to { opacity: 0; transform: translateX(24px); } }

.btn { position: relative; overflow: hidden; }
.ec-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .25; transform: scale(0); animation: ecRipple .55s ease-out; pointer-events: none; }
@keyframes ecRipple { to { transform: scale(2.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .ec-ripple { display: none; } }   /* transisi/animasi global udah dimatiin di blok a11y §base */

/* ══════════════════════════════════════════════════════════════════════════
   §13 KAPABILITAS + ADOPSI (batch-2 review gpt-5-pro) — aditif, hormat DNA.
   ════════════════════════════════════════════════════════════════════════ */

/* Button size variants — .btn dasar min-height 40; toolbar padat/icon pakai ini */
.btn-sm   { min-height: 34px; padding: 6px 14px; font-size: var(--fs-small); }
.btn-lg   { min-height: var(--control-h-lg); padding: 13px 26px; }
.btn-icon { min-height: var(--control-h-sm); width: var(--control-h-sm); padding: 0; }
.btn-icon.btn-sm { min-height: 34px; width: 34px; }

/* Link KONTEN ber-class (WCAG 1.4.1 di prose): .prose a / a.link = underline */
.prose a, [data-prose] a, a.link { color: var(--link); text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: 2px; }
.prose a:hover, [data-prose] a:hover, a.link:hover { color: var(--link-hover); text-decoration-thickness: .12em; }
.no-underline a { text-decoration: none; }

/* Form validation micro-pattern (helper / error / success) */
.field .msg { margin-top: 6px; font-size: var(--fs-small); color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.field .msg svg { width: 14px; height: 14px; flex-shrink: 0; }
.field[data-state="invalid"] .ec-input, .ec-input.is-invalid { border-color: var(--field-invalid-border); }
.field[data-state="invalid"] .msg, .msg-error { color: var(--error); }
.field[data-state="valid"] .ec-input { border-color: var(--success); }
.field[data-state="valid"] .msg, .msg-ok { color: var(--success); }

/* Breakpoint tokens (rujukan konsisten + container-query). @media butuh literal. */
:root { --bp-xs: 480px; --bp-sm: 640px; --bp-md: 768px; --bp-lg: 1024px; --bp-xl: 1280px; }

/* Density modes: html[data-density=compact|comfortable] skala spacing + tinggi kontrol */
html[data-density="compact"] {
  --pad-card: 20px; --gap: 16px;
  --control-h-sm: 36px; --control-h-md: 40px; --control-h-lg: 46px;
}
html[data-density="comfortable"] {
  --pad-card: 38px; --gap: 30px;
  --control-h-sm: 44px; --control-h-md: 48px; --control-h-lg: 56px;
}

/* RTL readiness — logical properties di komponen kunci (aman di LTR, rapih di [dir=rtl]) */
.ec-sidebar { border-inline-end: 1px solid var(--divider); border-right: 0; }
.avatar-group > * { margin-inline-start: -10px; margin-left: 0; }
.avatar-group > *:first-child { margin-inline-start: 0; }
.search svg { inset-inline-start: 14px; left: auto; }
.search input { padding-inline: 40px 16px; }
[dir="rtl"] .breadcrumb svg, [dir="rtl"] .nav-item .chev, [dir="rtl"] .pagination svg { transform: scaleX(-1); }

/* ══════════════════════════════════════════════════════════════════════════
   §14 CAPSTONE (sintesis panel 6-model: gpt-5.6/gpt-5.5-pro/kimi/grok/deepseek/glm)
   Brand-derivative ladder + komponen baru + beauty. Semua turunan --brand → aman swap.
   ════════════════════════════════════════════════════════════════════════ */

/* Brand-derivative ladder — turunan --brand buat state/surface (extensible) */
:root {
  --brand-surface: color-mix(in srgb, var(--brand) 8%,  var(--paper));   /* bg blok brand halus */
  --brand-border:  color-mix(in srgb, var(--brand) 38%, transparent);    /* garis brand */
  --brand-hover:   color-mix(in srgb, var(--brand) 90%, #000);           /* tombol brand hover */
  --brand-active:  color-mix(in srgb, var(--brand) 80%, #000);           /* pressed */
}
[data-theme="dark"] {
  --brand-surface: color-mix(in srgb, var(--brand) 16%, var(--paper));
  --brand-hover:   color-mix(in srgb, var(--brand) 88%, #fff);
  --brand-active:  color-mix(in srgb, var(--brand) 78%, #fff);
}
.btn:hover { filter: none; background: var(--brand-hover); }   /* ganti brightness → derivative (konsisten) */
.btn:active { background: var(--brand-active); }
.btn-ghost:hover { background: var(--brand-tint); filter: brightness(.98); }

/* Beauty: 1px inner-top highlight di card (premium, halus) + micro-lift nav aktif */
.card, .modal, .dropdown-menu { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--paper) 70%, #fff), var(--elev-1); }
[data-theme="dark"] .card, [data-theme="dark"] .modal, [data-theme="dark"] .dropdown-menu { box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--elev-1); }
.modal { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--paper) 70%, #fff), var(--elev-2); }
.nav-item.is-active { box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent); }

/* ── COMMAND PALETTE (⌘K) — .ec-cmdk (konsensus grok/glm/gpt) ── */
.ec-cmdk-overlay { position: fixed; inset: 0; background: var(--scrim); display: none; align-items: flex-start; justify-content: center; z-index: var(--z-modal); padding: 12vh 20px 20px; }
.ec-cmdk-overlay.is-open { display: flex; }
.ec-cmdk { width: 100%; max-width: 560px; background: var(--paper); border-radius: var(--r-card); box-shadow: var(--elev-2); overflow: hidden; }
.ec-cmdk .cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--divider); }
.ec-cmdk .cmdk-input svg { width: 20px; height: 20px; color: var(--muted); flex-shrink: 0; }
.ec-cmdk .cmdk-input input { flex: 1; border: none; background: none; font-family: var(--font); font-size: var(--fs-h6); color: var(--ink); }
.ec-cmdk .cmdk-input input:focus { outline: none; }
.ec-cmdk .cmdk-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.ec-cmdk .cmdk-group { font-size: var(--fs-small); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px 6px; }
.ec-cmdk .cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink); }
.ec-cmdk .cmdk-item svg { width: 19px; height: 19px; color: var(--ink-soft); flex-shrink: 0; }
.ec-cmdk .cmdk-item .grow { flex: 1; min-width: 0; }
.ec-cmdk .cmdk-item[aria-selected="true"], .ec-cmdk .cmdk-item:hover { background: var(--brand-tint); color: var(--brand); }
.ec-cmdk .cmdk-item[aria-selected="true"] svg, .ec-cmdk .cmdk-item:hover svg { color: var(--brand); }

/* ── BANNER (announcement page-level, beda dari .alert inline) — .ec-banner ── */
.ec-banner { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--brand-surface); color: var(--ink); border-bottom: 1px solid var(--brand-border); font-size: var(--fs-body); }
.ec-banner svg { width: 20px; height: 20px; color: var(--brand); flex-shrink: 0; }
.ec-banner .grow { flex: 1; min-width: 0; }
.ec-banner a { color: var(--brand); font-weight: var(--fw-semi); text-decoration: underline; }
.ec-banner .x { background: none; border: none; cursor: pointer; color: var(--ink-soft); padding: 4px; display: inline-flex; border-radius: 6px; }
.ec-banner.is-warning { background: var(--warning-tint); border-bottom-color: var(--warning); } .ec-banner.is-warning svg { color: var(--warning-ink); }

/* ── TOAST VARIANTS: action (undo) + progress ── */
.toast .toast-action { margin-left: 4px; background: none; border: none; color: var(--brand); font-family: var(--font); font-weight: var(--fw-semi); font-size: var(--fs-body); cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.toast .toast-action:hover { background: var(--brand-tint); }
.toast.is-progress { position: relative; overflow: hidden; }
.toast.is-progress::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; background: var(--brand); animation: ecToastBar 4s linear forwards; }
@keyframes ecToastBar { from { width: 100%; } to { width: 0; } }

/* ── SKELETON VARIANTS per-komponen (konsensus grok/glm) ── */
.skeleton-card { height: 120px; border-radius: var(--r-card); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-chart { height: 220px; border-radius: var(--r-card); }
.skeleton-row { height: 48px; border-radius: 8px; }
.skeleton-card, .skeleton-avatar, .skeleton-chart, .skeleton-row { position: relative; overflow: hidden; background: var(--skeleton-base); }
.skeleton-card::after, .skeleton-avatar::after, .skeleton-chart::after, .skeleton-row::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--skeleton-shimmer), transparent); animation: ecshimmer 1.4s infinite; }

/* ══════════════════════════════════════════════════════════════════════════
   §15 — Panel web polish (top-5 konsensus GPT-5.6 + Kimi + Grok). Kecil, hormat DNA.
   ════════════════════════════════════════════════════════════════════════ */
.stat-number { letter-spacing: -.02em; }                                       /* angka besar lebih rapat (premium) */
.ec-table tbody tr { transition: background .12s; }                            /* hover baris halus */
.ec-table .numeric, .ec-table td.numeric, .ec-table th.numeric { text-align: right; font-variant-numeric: tabular-nums; } /* kolom angka rata-kanan */
[data-theme="dark"] .card { border: 1px solid var(--divider); }                /* definisi card di dark (card ~ canvas) */
.mk-price.popular { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 8%, transparent), var(--elev-1); }  /* halo brand halus (emphasis, 1-aksen) */

/* ══════════════════════════════════════════════════════════════════════════
   §16 — Pola serapan Emergent web-reference (data-viz + sidebar). Token-driven, 1-aksen.
   ════════════════════════════════════════════════════════════════════════ */
/* Donut center label — angka total di tengah ring */
.donut-wrap { position: relative; }
.donut-wrap .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center .val { font-size: var(--fs-h3); font-weight: var(--fw-bold); letter-spacing: -.02em; color: var(--ink); }
.donut-center .lbl { font-size: var(--fs-small); color: var(--text-secondary); margin-top: 2px; }

/* Chart legend list — dot + nama + nilai rata-kanan (lebih informatif dari legend polos) */
.chart-legend { display: flex; flex-direction: column; gap: 11px; }
.chart-legend .row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-body); }
.chart-legend .row .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.chart-legend .row .name { color: var(--ink); }
.chart-legend .row .val { margin-left: auto; color: var(--text-secondary); font-weight: var(--fw-semi); font-variant-numeric: tabular-nums; }

/* Promo / upgrade card — CTA kecil di sidebar (turunan brand, aman swap) */
.promo-card { background: var(--brand-surface); border: 1px solid var(--brand-border); border-radius: var(--r-card); padding: 16px; }
.promo-card .t { font-weight: var(--fw-bold); letter-spacing: -.01em; }
.promo-card .d { font-size: var(--fs-small); color: var(--text-secondary); margin: 4px 0 12px; line-height: 1.5; }

/* ══════════════════════════════════════════════════════════════════════════
   §17 — KONTROL FORM LENGKAP (v1.5 component-completeness) + DRAWER.
   Kanonisasi check/radio/select dari forms.html (biar reusable) + slider/file/drawer baru.
   ════════════════════════════════════════════════════════════════════════ */
/* Select (chevron custom) */
.ec-select { position: relative; }
.ec-select select { -webkit-appearance: none; appearance: none; padding-inline-end: 42px; cursor: pointer; background: var(--field-bg); }
.ec-select svg { position: absolute; inset-inline-end: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
/* Checkbox */
.ec-check, .ec-radio { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: var(--fs-body); color: var(--ink); user-select: none; }
.ec-check input, .ec-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.ec-check .box { width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0; border: 1.6px solid var(--border); background: var(--field-bg); display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.ec-check .box svg { width: 14px; height: 14px; color: var(--brand-contrast); opacity: 0; }
.ec-check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.ec-check input:checked + .box svg { opacity: 1; }
.ec-check input:focus-visible + .box, .ec-radio input:focus-visible + .dot { box-shadow: 0 0 0 3px var(--brand-tint); }
/* Radio */
.ec-radio .dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; border: 1.6px solid var(--border); background: var(--field-bg); display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.ec-radio .dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-contrast); transform: scale(0); transition: transform .15s; }
.ec-radio input:checked + .dot { background: var(--brand); border-color: var(--brand); }
.ec-radio input:checked + .dot::after { transform: scale(1); }
/* Slider (range) */
.ec-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--grey-300); outline: none; }
.ec-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); border: 3px solid var(--paper); box-shadow: var(--elev-1); cursor: pointer; }
.ec-slider::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); border: 3px solid var(--paper); cursor: pointer; }
.ec-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-tint); }
/* File upload (dropzone) */
.ec-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; border: 1.5px dashed var(--border); border-radius: var(--r-card); background: var(--field-bg); color: var(--ink-soft); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.ec-file:hover, .ec-file.is-drag { border-color: var(--brand); background: var(--brand-tint); }
.ec-file svg { width: 28px; height: 28px; color: var(--brand); }
.ec-file input[type=file] { display: none; }
/* Drawer / side-sheet */
.ec-drawer-overlay { position: fixed; inset: 0; background: var(--scrim); display: none; z-index: var(--z-modal); }
.ec-drawer-overlay.is-open { display: block; }
.ec-drawer { position: fixed; top: 0; inset-inline-end: 0; height: 100vh; width: 380px; max-width: 90vw; background: var(--paper); box-shadow: var(--elev-2); z-index: var(--z-modal); transform: translateX(100%); transition: transform .25s var(--ease-emphasized); display: flex; flex-direction: column; }
.ec-drawer.is-open { transform: translateX(0); }
.ec-drawer.left { inset-inline-end: auto; inset-inline-start: 0; transform: translateX(-100%); }
.ec-drawer.left.is-open { transform: translateX(0); }
.ec-drawer .dr-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--divider); flex-shrink: 0; }
.ec-drawer .dr-body { flex: 1; overflow-y: auto; padding: 24px; }
