/* ==========================================================================
   KasirKu Denta GSM — 2 tema (gelap: biru tua→ungu, terang)
   Ditulis kompatibel: tanpa color-mix(), tanpa :has(), tanpa background-attachment:fixed.
   Skala kompak & desktop-first.
   ========================================================================== */

:root {
  --radius: 12px;
  --sidebar-w: 216px;
  /* Revisi 5: halaman dilebarkan — konten mengisi seluruh lebar layar (tanpa batas 1380px).
     Pakai 100% (bukan `none`) supaya tetap aman pada browser lama. */
  --page-max: 100%;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --tr: .15s ease;
}

/* ---------- TEMA GELAP (biru tua → ungu) ---------- */
html[data-theme="dark"] {
  --bg: #070A15;
  --surface: #0E1424;
  --surface-2: #131A2E;
  --surface-3: #1A2340;
  --hover: rgba(255, 255, 255, .045);
  --border: rgba(147, 168, 255, .14);
  --border-2: rgba(147, 168, 255, .24);
  --txt: #E9EDFA;
  --muted: #95A0C0;
  --muted-2: #6B7699;
  --primary: #6366F1;
  --primary-2: #A855F7;
  --grad: linear-gradient(135deg, #3B82F6 0%, #6366F1 48%, #A855F7 100%);
  --grad-soft: linear-gradient(135deg, rgba(59, 130, 246, .20), rgba(168, 85, 247, .16));
  --ok: #34D399;     --ok-soft: rgba(52, 211, 153, .14);   --ok-line: rgba(52, 211, 153, .30);
  --warn: #FBBF24;   --warn-soft: rgba(251, 191, 36, .14); --warn-line: rgba(251, 191, 36, .30);
  --danger: #FB7185; --danger-soft: rgba(251, 113, 133, .14); --danger-line: rgba(251, 113, 133, .30);
  --info: #38BDF8;   --info-soft: rgba(56, 189, 248, .14); --info-line: rgba(56, 189, 248, .30);
  --vio: #C4B5FD;    --vio-soft: rgba(168, 85, 247, .16);  --vio-line: rgba(168, 85, 247, .34);
  --muted-soft: rgba(255, 255, 255, .07);
  --shadow: 0 14px 30px -22px rgba(0, 0, 0, .9);
  --sb-from: #0A1020;
  --sb-to: #0C1226;
  --input-bg: #0A1020;
  --table-head: rgba(255, 255, 255, .035);
  --b1: #3B82F6; --b2: #6366F1; --b3: #8B5CF6; --b4: #A855F7;
  --trend-1: #60A5FA; --trend-2: #34D399;
  --trend-grid: rgba(147, 168, 255, .13);
  --modal-bg: #111A2C;
  --bubble-halo-1: rgba(59, 130, 246, .16);
  --bubble-halo-2: rgba(168, 85, 247, .14);
  --page-glow: radial-gradient(760px 420px at 6% -12%, rgba(37, 99, 235, .22), transparent 62%),
               radial-gradient(700px 420px at 100% 0%, rgba(139, 92, 246, .20), transparent 60%);
  /* Aksen khusus halaman Input Service (teal/cyan) */
  --pi-1: #22D3EE;
  --pi-2: #2DD4BF;
  --pi-line: rgba(45, 212, 191, .34);
  --pi-soft: rgba(45, 212, 191, .13);
  --pi-glow: rgba(6, 182, 212, .26);
  --pi-grad: linear-gradient(135deg, #0891B2 0%, #06B6D4 46%, #14B8A6 100%);
  --pi-grad-soft: linear-gradient(135deg, rgba(6, 182, 212, .20), rgba(20, 184, 166, .14));
}

/* ---------- TEMA TERANG ---------- */
html[data-theme="light"] {
  --bg: #F4F6FC;
  --surface: #FFFFFF;
  --surface-2: #F8FAFF;
  --surface-3: #EEF2FC;
  --hover: rgba(37, 99, 235, .05);
  --border: #E2E8F7;
  --border-2: #CFD9F0;
  --txt: #121B33;
  --muted: #5D6B8C;
  --muted-2: #8B97B4;
  --primary: #4F46E5;
  --primary-2: #7C3AED;
  --grad: linear-gradient(135deg, #2563EB 0%, #4F46E5 48%, #7C3AED 100%);
  --grad-soft: linear-gradient(135deg, rgba(37, 99, 235, .10), rgba(124, 58, 237, .09));
  --ok: #0E9F6E;     --ok-soft: #E7F8F1;   --ok-line: #A9E5CE;
  --warn: #B45309;   --warn-soft: #FEF6E7; --warn-line: #F6DCA4;
  --danger: #DC2626; --danger-soft: #FDECEC; --danger-line: #F5C2C2;
  --info: #0369A1;   --info-soft: #E8F5FD; --info-line: #B6DFF5;
  --vio: #6D28D9;    --vio-soft: #F1EBFE;  --vio-line: #D8C9FA;
  --muted-soft: #F1F4FB;
  --shadow: 0 12px 28px -24px rgba(17, 26, 51, .45);
  --sb-from: #101A3A;
  --sb-to: #1B1440;
  --input-bg: #FFFFFF;
  --table-head: #F5F8FF;
  --b1: #60A5FA; --b2: #818CF8; --b3: #A78BFA; --b4: #C084FC;
  --trend-1: #3B6FF6; --trend-2: #10B981;
  --trend-grid: #E4EAF7;
  --modal-bg: #FFFFFF;
  --bubble-halo-1: rgba(59, 130, 246, .10);
  --bubble-halo-2: rgba(168, 85, 247, .09);
  --page-glow: radial-gradient(700px 380px at 6% -12%, rgba(59, 130, 246, .14), transparent 62%),
               radial-gradient(660px 380px at 100% 0%, rgba(139, 92, 246, .12), transparent 60%);
  /* Aksen khusus halaman Input Service (teal/cyan) */
  --pi-1: #0891B2;
  --pi-2: #0D9488;
  --pi-line: #A5E7DE;
  --pi-soft: #E6FAF7;
  --pi-glow: rgba(8, 145, 178, .16);
  --pi-grad: linear-gradient(135deg, #0891B2 0%, #0D9488 52%, #14B8A6 100%);
  --pi-grad-soft: linear-gradient(135deg, rgba(8, 145, 178, .10), rgba(13, 148, 136, .08));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background-image: var(--page-glow);
  background-repeat: no-repeat;
  background-color: var(--bg);
  color: var(--txt);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; letter-spacing: -.01em; }
strong, b { font-weight: 700; }
p { margin: 0; }
svg { display: block; }
img { max-width: 100%; }

/* ================= Layout ================= */
.app { display: flex; min-height: 100vh; }
.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 16px 10px 12px;
  background: linear-gradient(180deg, var(--sb-from), var(--sb-to));
  border-right: 1px solid rgba(255, 255, 255, .07);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 0 6px 16px; }
.brand-mark, .brand-logo {
  width: 34px; height: 34px; min-width: 34px; max-width: 34px;
  min-height: 34px; max-height: 34px;
  flex: 0 0 34px; border-radius: 10px;
  display: grid; place-items: center;
  overflow: hidden;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 15px;
}
.brand-logo { background: #fff; object-fit: contain; padding: 2px; }
.brand-text { min-width: 0; display: flex; flex-direction: column; }
.brand-text strong { color: #fff; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text span { color: rgba(255, 255, 255, .58); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 9px; color: rgba(255, 255, 255, .78);
  font-size: 13px; font-weight: 600;
}
.nav-link svg { width: 15px; height: 15px; flex: 0 0 15px; }
.nav-link:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav-link.active { background: var(--grad); color: #fff; }
.sidebar-foot { padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 6px; }
.who { display: flex; align-items: center; gap: 8px; padding: 4px 8px 8px; }
.who-dot { width: 7px; height: 7px; border-radius: 50%; background: #34D399; flex: 0 0 7px; }
.who strong { display: block; color: #fff; font-size: 11.5px; }
.who span { color: rgba(255, 255, 255, .5); font-size: 9.5px; text-transform: uppercase; letter-spacing: .05em; }
.nav-logout:hover { background: rgba(251, 113, 133, .18); color: #FDA4AF; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .topbar { background: rgba(14, 20, 36, .96); }
.topbar-title { flex: 1; min-width: 0; }
.topbar-title h1 { font-size: 17px; font-weight: 800; }
.topbar-title p { font-size: 12px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 7px; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 11px; border-radius: 9px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--txt); font-size: 12.5px; font-weight: 700;
}
.theme-toggle:hover { background: var(--surface-3); }
.theme-toggle svg { width: 13px; height: 13px; }
html[data-theme="dark"] .ico-sun { display: none; }
html[data-theme="light"] .ico-moon { display: none; }

.burger { display: none; }
.scrim { display: none; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--txt);
}

/* Konten: mengisi seluruh lebar layar (revisi 5 — halaman dilebarkan) */
.content {
  padding: 16px 20px 40px;
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

/* Dua kolom untuk kelompok form opsional (Input Service lebih ringkas) */
.form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.form-cols > .form-section { display: flex; flex-direction: column; }
.form-cols > .form-section .form-grid { flex: 1; align-content: start; }
@media (max-width: 1024px) { .form-cols { grid-template-columns: minmax(0, 1fr); } }

/* Kotak donasi disorot gradasi cerah agar tidak lupa diisi */
.form-section .donation-field {
  padding: 8px 10px 9px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(251, 191, 36, .22), rgba(244, 114, 182, .20) 55%, rgba(56, 189, 248, .20));
  border: 1px solid var(--warn-line);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04) inset;
}
.form-section .donation-field > label { color: var(--txt); }
.form-section .donation-field .input { border-color: var(--warn-line); font-weight: 700; }

/* Kartu form versi rapat (sparepart) */
.form-section.tight { padding: 10px 12px 11px; }
.form-section.tight .fs-head { margin-bottom: 8px; }
.form-section.tight .picked-list { margin-top: 7px; }

/* Tab "Input Service" (dibedakan dari tab status) */
.tabs .tab-new { border-style: dashed; border-color: var(--vio-line); color: var(--vio); font-weight: 800; }
.tabs .tab-new:hover { border-color: var(--primary); color: var(--txt); }
.tabs .tab-new.active { border-style: solid; background: var(--grad); color: #fff; border-color: transparent; }

/* Tabel minimalis (dipakai daftar Data Service) */
table.tbl.compact td { padding: 7px 10px; }
table.tbl.compact th { padding: 8px 10px; }
.mini-chip {
  display: inline-block; padding: 1px 6px; border-radius: 6px; white-space: nowrap;
  font-size: 9.5px; font-weight: 800; letter-spacing: .02em;
  background: var(--vio-soft); color: var(--vio); border: 1px solid var(--vio-line);
}
.sep { opacity: .5; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: nowrap; }

/* ---------- Form bertahap (Input Service simpel) ---------- */
.form-section {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px 14px;
  background: var(--surface-2);
}
.form-section .fs-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 11px; flex-wrap: wrap;
}
.form-section .fs-num {
  width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  color: #fff; background: var(--grad);
}
.form-section .fs-head b { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.form-section .fs-head small { display: block; font-size: 11px; color: var(--muted-2); font-weight: 600; }

/* ---------- Halaman INPUT SERVICE — aksen teal/cyan ----------
   `.page-input` hanya dipasang pada panel form input & edit service (service.php).
   Aksen (--primary/--grad/--vio) di-scope di dalam panel ini saja, jadi halaman
   lain tetap memakai indigo/violet. Warna tema diambil dari --pi-* di atas. */
.page-input {
  --primary: var(--pi-1);
  --primary-2: var(--pi-2);
  --grad: var(--pi-grad);
  --grad-soft: var(--pi-grad-soft);
  --vio: var(--pi-2);
  --vio-soft: var(--pi-soft);
  --vio-line: var(--pi-line);
  position: relative;
  box-shadow: 0 24px 50px -36px var(--pi-glow), var(--shadow);
}
.panel.page-input { border-color: var(--pi-line); }
.page-input::before {
  content: ''; position: absolute; left: 1px; right: 1px; top: 1px; height: 3px;
  border-radius: 11px 11px 0 0; background: var(--pi-grad); z-index: 3;
}
.page-input .panel-head {
  background: var(--pi-grad-soft);
  border-bottom-color: var(--pi-line);
}
.page-input .form-section {
  position: relative;
  border-color: var(--border);
  transition: border-color var(--tr), box-shadow var(--tr);
}
.page-input .form-section::before {
  content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--pi-grad); opacity: .7;
}
.page-input .form-section:focus-within {
  border-color: var(--pi-line);
  box-shadow: 0 0 0 3px var(--pi-soft);
}
.page-input .form-section .fs-num { box-shadow: 0 6px 15px -8px var(--pi-glow); }
.page-input .form-section .fs-head b { letter-spacing: -.005em; }
.page-input .input:focus,
.page-input select.input:focus,
.page-input textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--pi-soft);
}
.page-input .input[readonly] { color: var(--pi-1); }
.page-input .srv-chip { border-color: var(--pi-line); background: var(--pi-soft); }
.page-input .srv-chip b { color: var(--pi-1); }
.page-input .form-actions .btn-primary { box-shadow: 0 10px 22px -14px var(--pi-glow); }
/* Tab "Input Service" saat aktif ikut aksen teal (hanya aktif di halaman form) */
.tabs .tab-new.active { background: var(--pi-grad); }

.srv-chip {
  display: inline-flex; flex-direction: column; gap: 1px;
  padding: 4px 10px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.srv-chip small {
  font-size: 9px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted-2);
}
.srv-chip b { font-size: 11.5px; color: var(--vio); }

.form-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 2px;
}
.card-highlight {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--vio-soft), var(--shadow);
}

@media (max-width: 720px) {
  .form-section { padding: 11px 11px 12px; }
}

/* ================= Tombol ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; border: 1px solid transparent;
  font-weight: 700; font-size: 12.5px; cursor: pointer; background: transparent; color: var(--txt);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-soft { background: var(--vio-soft); border-color: var(--vio-line); color: var(--vio); }
.btn-danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.btn-wa { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.btn-sm { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: 10.5px; border-radius: 6px; gap: 3px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 11.5px; padding: 0; font-weight: 600; }

/* ================= Panel & kartu ================= */
.panel, .card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.panel { margin-bottom: 14px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.panel-head h2 { font-size: 15px; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.panel-body { padding: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat {
  position: relative; overflow: hidden; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.stat-label { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); line-height: 1.25; }
.stat-ico { font-size: 12px; opacity: .85; }
.stat-value { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-hint { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; }
.tone-ok .stat-value { color: var(--ok); }
.tone-warn .stat-value { color: var(--warn); }
.tone-dang .stat-value { color: var(--danger); }
.tone-info .stat-value { color: var(--info); }
.tone-vio .stat-value { color: var(--primary-2); }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.row-between .lbl { color: var(--muted); }
.total-line { font-size: 15px; font-weight: 800; }
.total-line .lbl { color: var(--txt); font-weight: 600; font-size: 12px; }

/* ================= Tabel ================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-weight: 500; }
table.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted-2); padding: 9px 11px; background: var(--table-head);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 9px 11px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--hover); }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl .ctr { text-align: center; }
.big-table td { padding: 10px 11px; }
.t-sub { font-size: 11px; color: var(--muted-2); }
.t-strong { font-weight: 700; }
.mono { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }

/* ================= Badge & chip ================= */
.badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 800; border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge-muted { background: var(--muted-soft); color: var(--muted); border-color: var(--border-2); }
.badge-vio { background: var(--vio-soft); color: var(--vio); border-color: var(--vio-line); }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; overflow-x: auto; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; border-radius: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap;
}
.tab svg { width: 13px; height: 13px; }
.tab:hover { background: var(--hover); color: var(--txt); }
.tab.active { background: var(--grad); color: #fff; }
.tab .count { font-size: 9.5px; opacity: .8; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border-2);
  color: var(--muted); cursor: pointer;
}
.chip:hover { color: var(--txt); border-color: var(--primary); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; }

/* ================= Form ================= */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.form-grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Revisi 23: 5 kolom untuk kartu 1 Input Service (nama, WA, jenis, type, tanggal) */
.form-grid.c5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > label, .lbl-sm { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.input {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  background: var(--input-bg); border: 1px solid var(--border-2);
  color: var(--txt); font-size: 13px; font-weight: 500; outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--vio-soft); }
.input::placeholder { color: var(--muted-2); }
textarea.input { resize: vertical; min-height: 60px; }
select.input {
  appearance: none; padding-right: 26px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input[readonly] { background: var(--surface-3); color: var(--primary); border-style: dashed; }
.hint { font-size: 10.5px; color: var(--muted-2); }
.search { position: relative; flex: 1; min-width: 180px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-2); }
.search .input { padding-left: 32px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .field { min-width: 120px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 6px; }
.check {
  display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 500; background: var(--input-bg); border: 1px solid var(--border-2);
}
.check:hover { border-color: var(--primary); }
.check input { width: 14px; height: 14px; accent-color: var(--primary); margin: 0; flex: 0 0 14px; }
.check.is-checked { background: var(--vio-soft); border-color: var(--vio-line); }

/* ================= Alert ================= */
.alert {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: 9px; margin-bottom: 12px; font-size: 13px; font-weight: 600; border: 1px solid transparent;
}
.alert-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.alert-warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.alert-err { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.alert-x { background: none; border: none; color: inherit; opacity: .6; cursor: pointer; font-size: 16px; line-height: 1; }

.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.empty .big { font-size: 22px; opacity: .5; margin-bottom: 6px; }
.notice { padding: 10px 13px; border-radius: 9px; font-size: 12px; line-height: 1.5; background: var(--vio-soft); border: 1px solid var(--vio-line); color: var(--muted); }

/* ================= Grafik ================= */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: 100%; max-width: 40px; border-radius: 6px 6px 2px 2px; background: var(--grad); min-height: 3px; position: relative; }
.chart-bar.zero { background: var(--muted-soft); }
.chart-tip {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--surface-3); border: 1px solid var(--border-2); color: var(--txt);
  font-size: 10px; padding: 2px 6px; border-radius: 5px; white-space: nowrap;
  opacity: 0; pointer-events: none;
}
.chart-col:hover .chart-tip { opacity: 1; }
.chart-x { font-size: 10px; color: var(--muted-2); white-space: nowrap; }
.chart-x.today { color: var(--primary-2); font-weight: 700; }

/* Dua grafik dalam satu kotak (dashboard) */
.chart-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.chart-split-col { min-width: 0; display: flex; flex-direction: column; }
.chart-split-col + .chart-split-col { border-left: 1px solid var(--border); padding-left: 22px; }
.chart-split .cs-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px;
}
.chart-split .cs-head b { font-size: 12.5px; font-weight: 800; letter-spacing: -.01em; }
.chart-split .cs-head small { display: block; font-size: 11px; color: var(--muted-2); font-weight: 600; }
.chart-split .bubble-cluster { flex: 1; padding: 14px 10px; gap: 12px 16px; }
.chart-split .trend-legend { margin-bottom: 4px; }
@media (max-width: 1100px) {
  .chart-split { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .chart-split-col + .chart-split-col { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
}

/* ---------- Grafik tren (area + kurva halus) ---------- */
.trend { position: relative; }
.trend-legend { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 8px; }
.trend-key {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.trend-key i {
  width: 22px; height: 4px; border-radius: 4px; display: inline-block; background: var(--trend-1);
}
.trend-key.k2 i { background: var(--trend-2); }
.trend-key b { color: var(--txt); font-weight: 800; font-variant-numeric: tabular-nums; }
.trend-note { font-size: 11px; color: var(--muted-2); }
.trend-svg { width: 100%; height: auto; display: block; overflow: visible; }
.trend-grid line { stroke: var(--trend-grid); stroke-width: 1; stroke-dasharray: 5 7; }
.trend-area { opacity: .95; }
.trend-line { fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.trend-line.l1 { stroke: var(--trend-1); }
.trend-line.l2 { stroke: var(--trend-2); stroke-dasharray: 0; opacity: .9; }
.trend-dot { stroke: var(--surface); stroke-width: 2; }
.trend-dot.d1 { fill: var(--trend-1); }
.trend-dot.d2 { fill: var(--trend-2); }
.trend-pt .trend-hit { fill: transparent; }
.trend-pt:hover .trend-dot { r: 6; }
.trend-pt.is-last .trend-dot { stroke-width: 2.5; }
.trend-x { fill: var(--muted-2); font-size: 11px; font-weight: 600; font-family: var(--font); }
.trend-x.is-today { fill: var(--primary-2); font-weight: 800; }
.g1-top { stop-color: var(--trend-1); stop-opacity: .34; }
.g1-bot { stop-color: var(--trend-1); stop-opacity: 0; }
.g2-top { stop-color: var(--trend-2); stop-opacity: .18; }
.g2-bot { stop-color: var(--trend-2); stop-opacity: 0; }

/* ---------- Alat & Inventaris: kotak total + pager ---------- */
.alat-hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px;
  background: var(--grad); color: #fff; box-shadow: var(--shadow);
}
.alat-hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 90% -20%, rgba(255, 255, 255, .28), transparent 62%);
  pointer-events: none;
}
.alat-hero-label {
  font-size: 12px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase;
  opacity: .95; position: relative;
}
.alat-hero-value {
  font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin: 4px 0 2px;
  font-variant-numeric: tabular-nums; position: relative;
}
.alat-hero-sub { font-size: 12px; opacity: .9; position: relative; }
.alat-hero-sub b { font-weight: 800; }
@media (max-width: 560px) {
  .alat-hero { padding: 15px 16px; }
  .alat-hero-value { font-size: 24px; }
}

.toolbar .field.grow { flex: 1 1 320px; min-width: 220px; }

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-2);
}
.pager-info { font-size: 12px; color: var(--muted); font-weight: 600; }
.pager-info b { color: var(--txt); font-weight: 800; }
.pager .btn.disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.donut-wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.donut { position: relative; width: 122px; height: 122px; flex: 0 0 122px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center strong { display: block; font-size: 12.5px; font-weight: 800; }
.donut-center span { font-size: 9px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 130px; }
.legend-row { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.legend-row .val { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Gelembung modern — cluster flex (tidak pernah bertumpuk) */
.bubble-cluster {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 18px 22px; padding: 22px 14px;
  border-radius: 14px; border: 1px solid var(--border);
  background:
    radial-gradient(520px 260px at 12% 0%, var(--bubble-halo-1), transparent 68%),
    radial-gradient(480px 260px at 92% 100%, var(--bubble-halo-2), transparent 68%),
    var(--surface-2);
}
.bubble {
  position: relative; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  color: #fff; cursor: default;
  transition: transform .18s ease, box-shadow .18s ease;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .35) 10%, transparent 30%),
    radial-gradient(circle at 74% 82%, rgba(255, 255, 255, .18) 0%, transparent 42%),
    linear-gradient(150deg, var(--c1) 0%, var(--c2) 52%, var(--c3) 100%);
  box-shadow:
    inset -6px -8px 18px rgba(0, 0, 0, .30),
    inset 5px 6px 16px rgba(255, 255, 255, .26),
    0 14px 26px -14px var(--c-shadow),
    0 0 0 6px var(--c-ring);
}
.bubble:hover { transform: translateY(-3px) scale(1.04); z-index: 2; }
.bubble .bubble-inner { padding: 0 12px; display: flex; flex-direction: column; gap: 1px; }
.bubble .b-label { font-size: 10px; font-weight: 800; letter-spacing: .02em; opacity: .95; line-height: 1.2; }
.bubble .b-value { font-size: 13px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.bubble.sm .b-label { font-size: 9px; }
.bubble.sm .b-value { font-size: 11px; }
.bubble.is-zero {
  background: linear-gradient(150deg, var(--surface-3), var(--surface-2));
  color: var(--muted-2);
  box-shadow: inset 0 0 0 1px var(--border-2);
}
.bubble.is-zero .b-value { color: var(--muted); }
.bubble-note { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); }

/* Palet gelembung (dipakai bergiliran) */
.bubble.b1 { --c1: #38BDF8; --c2: #3B82F6; --c3: #4F46E5; --c-ring: rgba(59, 130, 246, .14); --c-shadow: rgba(59, 130, 246, .75); }
.bubble.b2 { --c1: #818CF8; --c2: #6366F1; --c3: #7C3AED; --c-ring: rgba(99, 102, 241, .14); --c-shadow: rgba(99, 102, 241, .75); }
.bubble.b3 { --c1: #C084FC; --c2: #A855F7; --c3: #7E22CE; --c-ring: rgba(168, 85, 247, .14); --c-shadow: rgba(168, 85, 247, .75); }
.bubble.b4 { --c1: #67E8F9; --c2: #22D3EE; --c3: #0EA5E9; --c-ring: rgba(34, 211, 238, .14); --c-shadow: rgba(34, 211, 238, .7); }

/* ================= Modal ================= */
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: flex-start; justify-content: center;
  padding: 16px; background: rgba(3, 6, 15, .72); overflow-y: auto; }
.modal.open { display: flex; }
.modal-card {
  width: 100%; max-width: 700px; margin: auto; background: var(--modal-bg);
  border: 1px solid var(--border-2); border-radius: 14px; box-shadow: 0 30px 60px -30px #000;
}
.modal-card.wide { max-width: 960px; }
.modal-card.slim { max-width: 480px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 15px; border-bottom: 1px solid var(--border); background: var(--modal-bg); }
.modal-head h3 { font-size: 13.5px; }
.modal-body { padding: 15px; }
.modal-foot { display: flex; gap: 7px; justify-content: flex-end; padding: 11px 15px;
  border-top: 1px solid var(--border); background: var(--modal-bg); }

/* ================= Login ================= */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.auth-card { width: 100%; max-width: 372px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.auth-logo {
  width: 46px; height: 46px; min-width: 46px; max-width: 46px; min-height: 46px; max-height: 46px;
  border-radius: 13px; background: var(--grad); display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 19px; margin-bottom: 13px;
  overflow: hidden; object-fit: contain; padding: 2px;
}
.auth-card h1 { font-size: 17px; }
.auth-card .sub { color: var(--muted); font-size: 12.5px; margin: 4px 0 16px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.role-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 11px 8px;
  border-radius: 10px; background: var(--input-bg); border: 1px solid var(--border-2);
  cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--muted);
}
.role-btn svg { width: 17px; height: 17px; }
.role-btn.active { background: var(--vio-soft); border-color: var(--vio-line); color: var(--vio); }
.role-btn span.role-sub { font-size: 9px; font-weight: 500; color: var(--muted-2); }

/* ================= Misc ================= */
.print-only { display: none; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 10px; flex-wrap: wrap; }
.section-title h2 { font-size: 13.5px; }
.pill-row { display: flex; gap: 5px; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 122px 1fr; gap: 7px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
.thumb { width: 32px; height: 32px; border-radius: 8px; overflow: hidden; background: var(--surface-3);
  border: 1px solid var(--border); display: grid; place-items: center; font-weight: 700; color: var(--muted-2); font-size: 12px; flex: 0 0 32px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sku-chip { font-family: var(--mono); font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
  background: var(--muted-soft); color: var(--muted); border: 1px solid var(--border-2); }
.scroll-box { max-height: 460px; overflow-y: auto; }

/* ================= Responsif ================= */
@media (max-width: 1280px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-side { grid-template-columns: minmax(0, 1fr); }
  :root { --page-max: 100%; }
}
@media (max-width: 1024px) {
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid.c4, .form-grid.c3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.c5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: 100%; transform: translateX(-102%);
    transition: transform .2s ease; width: 240px; flex-basis: 240px; }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 35; }
  .burger { display: grid; }
  .topbar { padding: 9px 12px; }
  .content { padding: 12px 12px 36px; }
  .form-grid, .form-grid.c3, .form-grid.c4, .form-grid.c5 { grid-template-columns: minmax(0, 1fr); }
  .span-2, .span-3 { grid-column: span 1; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
  .stat-value { font-size: 14.5px; }
  .theme-toggle .theme-label { display: none; }
  .topbar-title h1 { font-size: 14.5px; }
  .topbar-title p { display: none; }
}
@media (max-width: 560px) {
  .auth-card { padding: 18px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 13.5px; }
  .stat { padding: 9px 10px; }
  table.tbl th, table.tbl td { padding: 7px 8px; }
  .kv { grid-template-columns: 92px 1fr; }
  .modal { padding: 8px; }
  .bubble-area-legacy { height: 240px; }
}

/* ================= Pencarian ketik-otomatis (typeahead) ================= */
.typeahead { position: relative; }
.typeahead-list {
  display: none; position: absolute; z-index: 300; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 320px; overflow-y: auto; padding: 6px;
  background: var(--modal-bg); border: 1px solid var(--border-2); border-radius: 11px;
  box-shadow: 0 26px 50px -20px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .04);
}
/* Wadah yang memuat pencarian harus boleh "meluber" agar daftar hasil terlihat utuh */
.card.no-clip, .panel.no-clip, .panel-body.no-clip, .no-clip { overflow: visible !important; }
.typeahead-list.open { display: block; }
.typeahead-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; width: 100%;
  padding: 10px 11px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; text-align: left; cursor: pointer;
}
.typeahead-item + .typeahead-item { border-top: 1px solid var(--border); border-radius: 0; }
.typeahead-item:hover, .typeahead-item:focus-visible {
  background: var(--vio-soft); border-color: var(--vio-line); border-radius: 9px;
}
.ta-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.typeahead-item:hover { background: var(--vio-soft); border-color: var(--vio-line); }
.typeahead-item.disabled { opacity: .45; cursor: not-allowed; }
.ta-name { font-size: 13.5px; font-weight: 800; color: var(--txt); }
.ta-meta { grid-column: 1; font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.ta-meta b { color: var(--txt); font-weight: 700; }
.ta-price { grid-row: 1 / span 3; grid-column: 2; align-self: center; text-align: right;
  font-size: 13px; font-weight: 800; color: var(--vio); white-space: nowrap; }
.ta-price small { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted-2); margin-top: 1px; }
.ta-empty { padding: 14px 12px; font-size: 12px; color: var(--muted-2); text-align: center; }

.picked-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.picked-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border);
}
.qty-ctl { display: flex; align-items: center; gap: 4px; }
.qty-ctl button {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border-2);
  background: var(--surface-3); color: var(--txt); cursor: pointer; font-size: 15px; line-height: 1; padding: 0;
}
.qty-ctl .q { min-width: 20px; text-align: center; font-weight: 800; font-size: 12.5px; }
.check.remember { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 9px; padding: 9px 11px; }
@media (max-width: 560px) {
  .picked-row { grid-template-columns: 1fr auto; row-gap: 6px; }
  .picked-row .qty-ctl { grid-column: 2; }
}

/* Kartu barang terpilih (modal Jual Part) */
.picked-card {
  margin-top: 9px; padding: 11px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--border-2);
}
.picked-card-body { display: flex; flex-direction: column; gap: 3px; }
.pc-name { font-size: 13.5px; font-weight: 800; color: var(--txt); }
.pc-meta { font-size: 11.5px; color: var(--muted); }
.pc-figures { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.modal-card.no-clip, .modal-body.no-clip, .modal.no-clip { overflow: visible !important; }

/* ================= Tampilkan / sembunyikan password ================= */
.pw-wrap { position: relative; display: flex; }
.pw-wrap .input { padding-right: 42px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted-2); cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-3); color: var(--txt); border-color: var(--border-2); }
.pw-toggle svg { width: 16px; height: 16px; }
.pw-wrap .pw-eye-off { display: none; }
.pw-wrap.is-visible .pw-eye { display: none; }
.pw-wrap.is-visible .pw-eye-off { display: block; }
.pw-wrap.is-visible .pw-toggle { color: var(--vio); }

/* ================= Info user di pojok kanan atas (sebelah tema) ================= */
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 11px 5px 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  max-width: 230px;
}
.tu-avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800; color: #fff;
  background: var(--grad); box-shadow: 0 4px 10px -6px rgba(99, 102, 241, .9);
}
.tu-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.tu-text strong { font-size: 12px; font-weight: 800; color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tu-text small { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .topbar-user .tu-text { display: none; }
  .topbar-user { padding: 4px; border-radius: 50%; }
}

/* ==========================================================================
   REKAP HARIAN & REKAP HANDPHONE (revisi 14)
   Dua halaman ini punya tabel sendiri dan tidak dipakai dashboard/rekap bulanan.
   Gaya: minimalis — label kecil, angka tegas, garis tipis, tanpa bayangan tebal.
   ========================================================================== */
.rh-hero { padding: 0; overflow: hidden; }
.rh-hero .rh-hero-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.rh-hero .rh-hero-head b { color: var(--txt); font-size: 11px; letter-spacing: .02em; }
.rh-hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.rh-hero-cell { padding: 12px 14px; min-width: 0; border-left: 1px solid var(--border); }
.rh-hero-cell:first-child { border-left: 0; }
.rh-hero-cell small {
  display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2); margin-bottom: 3px;
}
.rh-hero-cell strong { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.rh-hero-cell.is-main strong { color: var(--primary); }
.rh-pcs { color: var(--muted); font-weight: 800; }
.rh-hero-foot { padding: 8px 14px 10px; font-size: 10.5px; color: var(--muted-2); border-top: 1px dashed var(--border); }

/* Tabel rekap harian: angka rata kanan, garis lembut, baris total tegas */
.rh-tbl tbody td, .rhp-tbl tbody td { font-variant-numeric: tabular-nums; }
.rh-laci { color: var(--primary); }
.rh-total-row td {
  background: var(--surface-2); border-top: 1px solid var(--border-2);
  font-weight: 800; font-size: 12px;
}
.rh-total-row td.num { color: var(--txt); }

/* Ringkasan rekap handphone: 6 sel sebaris, dipisah garis tipis */
.rhp-hero {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.rhp-hero-cell { padding: 11px 13px; min-width: 0; border-left: 1px solid var(--border); }
.rhp-hero-cell:first-child { border-left: 0; }
.rhp-hero-cell small {
  display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2); margin-bottom: 2px;
}
.rhp-hero-cell strong { display: block; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.rhp-hero-cell span { display: block; font-size: 10px; color: var(--muted-2); margin-top: 1px; }
.rhp-hero-cell.is-ok strong { color: var(--ok); }
.rhp-hero-cell.is-main strong { color: var(--primary); }
.rhp-hero-cell.is-warn strong { color: var(--warn); }
/* Kolom & angka pengeluaran di tabel */
.rhp-tbl .rhp-keluar { color: var(--warn); font-weight: 700; }
.rhp-tbl tbody td { font-variant-numeric: tabular-nums; }

/* Kotak pratinjau di dalam modal */
.rh-preview, .rhp-preview {
  padding: 9px 12px; border-radius: 9px; background: var(--surface-2);
  border: 1px solid var(--border-2); font-size: 12px; color: var(--muted);
}
.rh-preview b, .rhp-preview b { color: var(--primary); font-weight: 800; }

@media (max-width: 1280px) {
  .rhp-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rhp-hero-cell:nth-child(5) { border-left: 0; }
  .rhp-hero-cell:nth-child(n+5) { border-top: 1px solid var(--border); }
}
@media (max-width: 1024px) {
  .rhp-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rhp-hero-cell:nth-child(4) { border-left: 0; }
  .rhp-hero-cell:nth-child(n+4) { border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .rh-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .rh-hero-cell { border-left: 0; border-top: 1px solid var(--border); }
  .rh-hero-cell:first-child { border-top: 0; }
  .rhp-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rhp-hero-cell { border-left: 0; border-top: 1px solid var(--border); }
  .rhp-hero-cell:nth-child(odd) { border-left: 0; }
  .rhp-hero-cell:nth-child(even) { border-left: 1px solid var(--border); }
  .rhp-hero-cell:nth-child(-n+2) { border-top: 0; }
}

/* ===== Kotak "Detail Bulanan" di Rekap Bulanan (komisi + service harian jadi satu) ===== */
.mini-detail .mini-list { display: flex; flex-direction: column; }
.mini-detail .mini-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.mini-detail .mini-row:last-child { border-bottom: 0; }
.mini-detail .mini-row .m-label { font-weight: 600; color: var(--txt); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mini-detail .mini-row .m-sub { font-size: 10.5px; color: var(--muted-2); font-weight: 600; }
.mini-detail .mini-row .m-val { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-detail .mini-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--border-2); font-weight: 800;
}
.mini-detail .mini-empty { padding: 14px 2px; font-size: 12px; color: var(--muted-2); }

/* ===== Sidebar: label menu boleh memanjang ke bawah (2 baris) =====
   Sejak revisi 14 jumlah menu bertambah (Rekap Harian & Rekap Handphone).
   Label panjang tidak dipotong/di-ellipsis lagi, tapi turun ke baris kedua,
   dan area menu bisa digulir penuh ke bawah tanpa terpotong. */
.nav { overscroll-behavior: contain; scrollbar-width: thin; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 99px; }
.nav-link { align-items: flex-start; line-height: 1.2; }
.nav-link > svg { margin-top: 1px; }
.nav-link > span {
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  min-width: 0; flex: 1;
}

/* ===== Chip bulan yang punya data (Rekap Harian & Rekap Handphone) ===== */
.month-chips {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin: 0 0 14px;
}
.month-chips .mc-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted-2);
}
.month-chips .chip { font-variant-numeric: tabular-nums; }
.month-chips .chip b { color: var(--muted); font-weight: 800; margin-left: 2px; }
.month-chips .chip.active b { color: #fff; }

/* Daftar rekap dipanjangkan ke bawah: seluruh bulan tampil, baru digulir
   kalau barisnya sudah sangat banyak. */
.rh-scroll { max-height: min(72vh, 900px); }

/* ===== Tombol & chip "Sudah diambil" (revisi 17) ===== */
.btn-ok { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
.btn-ok:hover { filter: brightness(1.06); }
.mini-chip-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-line); }
.mini-chip { border: 1px solid transparent; }

/* Kotak pengambilan barang di halaman detail service */
.pickup-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--border-2);
}
.pickup-box.is-done { background: var(--ok-soft); border-style: solid; border-color: var(--ok-line); }
.pickup-box .pk-title { font-size: 12.5px; font-weight: 800; }
.pickup-box .pk-sub { font-size: 10.5px; color: var(--muted); font-weight: 600; }

/* ==========================================================================
   REVISI 23 — Halaman setelan (Role & Pengaturan) dibuat minimalis
   Keterangan dibedakan per warna supaya mudah dibedakan sekilas.
   ========================================================================== */
.panel.mini { border-radius: 10px; }
.panel.mini .panel-head { padding: 9px 13px; }
.panel.mini .panel-head h2 { font-size: 13px; letter-spacing: -.005em; }
.panel.mini .panel-head p { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }
.panel.mini .panel-body { padding: 11px 13px 13px; }
.panel.mini .form-grid { gap: 9px 11px; }
.panel.mini .field { gap: 3px; }
.panel.mini .field > label { font-size: 9.5px; letter-spacing: .04em; }
.panel.mini .input { padding: 6px 9px; font-size: 12px; border-radius: 7px; }
.panel.mini .hint { font-size: 9.5px; line-height: 1.4; }

/* Baris setelan: label di kiri, kontrol di kanan (hemat ruang) */
.srow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--border); }
.srow:last-child { border-bottom: 0; }
.srow .s-label { font-size: 11.5px; font-weight: 800; color: var(--txt); }
.srow .s-sub { display: block; font-size: 9.5px; font-weight: 600; color: var(--muted-2); margin-top: 1px; }
.srow .s-ctrl { flex: 0 0 232px; max-width: 232px; }
.srow .s-ctrl .input { width: 100%; }
@media (max-width: 720px) {
  .srow { flex-direction: column; align-items: stretch; gap: 5px; }
  .srow .s-ctrl { flex: 1 1 auto; max-width: none; }
}

/* Keterangan berwarna (menggantikan blok notice panjang) */
.nm { display: flex; gap: 7px; align-items: flex-start; padding: 6px 9px; border-radius: 7px;
  font-size: 10.5px; line-height: 1.45; font-weight: 600; color: var(--txt);
  border: 1px solid transparent; border-left-width: 3px; }
.nm b { font-weight: 800; }
.nm .nm-ico { flex: 0 0 auto; font-size: 11px; line-height: 1.3; }
.nm-info   { background: var(--info-soft);   border-color: var(--info-line);   border-left-color: var(--info); }
.nm-ok     { background: var(--ok-soft);     border-color: var(--ok-line);     border-left-color: var(--ok); }
.nm-warn   { background: var(--warn-soft);   border-color: var(--warn-line);   border-left-color: var(--warn); }
.nm-vio    { background: var(--vio-soft);    border-color: var(--vio-line);    border-left-color: var(--vio); }
.nm-danger { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); }
.nm-stack { display: flex; flex-direction: column; gap: 6px; }
/* Keterangan kecil berwarna (dipakai di Role & Pengaturan) */
.hint-ok { color: var(--ok); font-weight: 700; }
.hint-warn { color: var(--warn); font-weight: 700; }
.hint-info { color: var(--info); font-weight: 700; }
.hint-vio { color: var(--vio); font-weight: 700; }
