/* =========================================================
   ServisPro — Desain
   ========================================================= */
:root {
  --bg: #f2f4fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6e9f2;
  --txt: #0f172a;
  --muted: #64748b;
  --c1: #6366f1;
  --c2: #a855f7;
  --c3: #06b6d4;
  --ok: #10b981;
  --warn: #f59e0b;
  --no: #f43f5e;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -18px rgba(15, 23, 42, .28);
  --r: 16px;
  --sidebar: 258px;
  --dc0: #6366f1; --dc1: #22c55e; --dc2: #f59e0b; --dc3: #ec4899; --dc4: #06b6d4; --dc5: #94a3b8;
}
html[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #131a2e;
  --surface-2: #0f1526;
  --line: #232c47;
  --txt: #e8ecf7;
  --muted: #94a3b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: clip; }
body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--txt);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60rem 32rem at 12% -8%, color-mix(in srgb, var(--c1) 16%, transparent), transparent 62%),
    radial-gradient(50rem 30rem at 92% 0%, color-mix(in srgb, var(--c2) 14%, transparent), transparent 60%),
    radial-gradient(46rem 30rem at 60% 108%, color-mix(in srgb, var(--c3) 12%, transparent), transparent 62%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.i { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.warn { color: var(--warn); }
.danger, .no { color: var(--no); }
.ok { color: var(--ok); }
.nowrap { white-space: nowrap; }
.r { text-align: right; }
.pad { padding: 16px; }
.pad-sm { padding: 10px 14px; }
.spacer { flex: 1; }
.w100 { width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: grid; place-content: center; gap: 14px;
  justify-items: center; background: var(--bg); z-index: 999;
}
.boot-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--c1); }
.boot-logo b { background: linear-gradient(90deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.boot p { color: var(--muted); font-size: 13.5px; }
.boot-bar { width: 190px; height: 5px; border-radius: 99px; background: var(--line); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 99px; background: linear-gradient(90deg, var(--c1), var(--c2)); animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(320%); } }

/* =========================================================
   AUTH
   ========================================================= */
.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 40px; align-items: center; padding: 40px 5vw;
}
.auth-art { max-width: 560px; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px 9px 12px; border-radius: 99px;
  background: var(--surface); box-shadow: var(--shadow); font-weight: 800; font-size: 17px; color: var(--c1); }
.auth-art h1 { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.12; margin: 22px 0 14px; }
.auth-art h1 span { background: linear-gradient(90deg, var(--c1), var(--c2) 60%, var(--c3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-sub { color: var(--muted); font-size: 15.5px; line-height: 1.65; max-width: 46ch; }
.auth-feat { margin-top: 26px; display: grid; gap: 12px; }
.auth-feat li { display: flex; align-items: center; gap: 11px; font-weight: 600; font-size: 14.5px;
  padding: 12px 16px; background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); }
.auth-feat li .i { color: var(--c1); }

.auth-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px; box-shadow: var(--shadow-lg); max-width: 460px; width: 100%; justify-self: center;
}
.tabs-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--surface-2);
  border: 1px solid var(--line); padding: 4px; border-radius: 13px; margin-bottom: 20px; }
.tab-a { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700;
  color: var(--muted); cursor: pointer; transition: .18s; }
.tab-a.on { background: var(--surface); color: var(--txt); box-shadow: var(--shadow); }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 20px 0 14px; }
.auth-sep::before, .auth-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.gbtn { width: 100%; justify-content: center; background: var(--surface); border: 1px solid var(--line) !important; }
.auth-note { margin-top: 14px; font-size: 12.5px; line-height: 1.6; color: var(--muted);
  padding: 11px 13px; background: var(--surface-2); border-radius: 12px; border: 1px dashed var(--line); }
.auth-note a { color: var(--c1); font-weight: 700; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* =========================================================
   FORM
   ========================================================= */
.stack { display: grid; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-form .w2, .grid-form .sect, .grid-form .hint { grid-column: 1 / -1; }
.fld { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.fld > span { letter-spacing: .01em; }
.fld input, .fld select, .fld textarea, .sel {
  width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--txt); font-size: 14.5px; font-weight: 600;
  transition: .16s; outline: none; font-family: inherit;
}
.fld textarea { resize: vertical; min-height: 44px; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .sel:focus {
  border-color: var(--c1); background: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 16%, transparent);
}
.fld input[readonly] { opacity: .6; cursor: not-allowed; }
.sel { min-width: 150px; width: auto; }
.pw { position: relative; display: flex; }
.pw input { flex: 1; padding-right: 44px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent;
  color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.err { color: var(--no); font-size: 13px; font-weight: 600; min-height: 1px; margin: 0; }
.err:empty { display: none; }
.sect { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; color: var(--c1);
  margin-top: 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }

/* =========================================================
   BUTTON
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--txt);
  font-weight: 700; font-size: 14px; cursor: pointer; transition: .16s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.primary { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--c1) 80%, transparent); }
.btn.success { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn.danger { background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.tiny { padding: 7px 11px; font-size: 12.5px; border-radius: 10px; }
.btn.lg { padding: 13px 20px; font-size: 15px; justify-content: center; }
.btn-file { position: relative; overflow: hidden; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--txt); border-color: var(--c1); background: color-mix(in srgb, var(--c1) 10%, var(--surface)); }
.icon-btn.tint-in:hover { color: var(--ok); border-color: var(--ok); }
.icon-btn.tint-out:hover { color: var(--c3); border-color: var(--c3); }
.icon-btn.tint-del:hover { color: var(--no); border-color: var(--no); }
.icon-btn.tint-ok:hover { color: var(--ok); border-color: var(--ok); }
.icon-btn.tint-wa:hover { color: #16a34a; border-color: #16a34a; }

/* =========================================================
   SHELL
   ========================================================= */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px;
  padding: 20px 16px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(14px); border-right: 1px solid var(--line); z-index: 40;
  overflow-y: auto; overscroll-behavior: contain;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; box-shadow: 0 10px 22px -10px var(--c1); }
.brand-txt { display: grid; line-height: 1.15; }
.brand-txt b { font-size: 17px; }
.brand-txt small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.nav { display: grid; gap: 4px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 13px;
  color: var(--muted); font-weight: 700; font-size: 14.5px; transition: .16s; position: relative; }
.nav-i:hover { background: var(--surface-2); color: var(--txt); }
.nav-i.on { background: linear-gradient(135deg, color-mix(in srgb, var(--c1) 16%, transparent), color-mix(in srgb, var(--c2) 14%, transparent));
  color: var(--txt); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c1) 26%, transparent); }
.nav-i.on .nav-ic { color: var(--c1); }
.nav-ic { display: grid; place-items: center; width: 22px; }
.nav-badge { margin-left: auto; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px;
  background: var(--no); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.nav-badge.soft { background: var(--c1); }
.side-foot { margin-top: auto; }
.plan-card { padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c1) 12%, var(--surface)), var(--surface)); }
.plan-top { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; color: var(--c1); }
.plan-card p { margin: 8px 0 10px; }

.backdrop { display: none; }
.main { display: flex; flex-direction: column; min-width: 0; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 14px clamp(14px, 2.6vw, 28px); background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.tt { min-width: 0; }
.tt h1 { font-size: clamp(17px, 2.1vw, 21px); }
.tt p { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search-box { position: relative; display: flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); min-width: 250px; transition: .16s; }
.search-box:focus-within { border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 14%, transparent); }
.search-box input { border: 0; outline: none; background: transparent; width: 100%; font-size: 14px; font-weight: 600; color: var(--txt); }
/* ---------- dropdown hasil pencarian ---------- */
.sdrop { position: absolute; top: calc(100% + 10px); right: 0; width: min(340px, calc(100vw - 24px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 8px; z-index: 80; max-height: min(60vh, 420px); overflow-y: auto; }
.sdrop-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; margin: 6px 8px 4px; }
.sdrop-i { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0;
  background: transparent; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-family: inherit; }
.sdrop-i:hover { background: var(--surface-2); }
.sdrop-i .i { color: var(--c1); flex: none; }
.sdrop-i span { display: grid; min-width: 0; }
.sdrop-i b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdrop-i small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sdrop-empty { padding: 10px 8px; font-size: 13px; color: var(--muted); margin: 0; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 5px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); }
.uc-txt { display: grid; line-height: 1.2; padding-right: 4px; }
.uc-txt b { font-size: 13px; }
.uc-txt small { color: var(--muted); font-size: 11px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.only-mobile { display: none; }

.page { padding: clamp(14px, 2.6vw, 26px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: start; }

/* =========================================================
   KARTU & STATISTIK
   ========================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card.pad0 { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { font-size: 15.5px; }
.card-h .i { color: var(--muted); margin-left: auto; }
.card-h .badge { margin-left: auto; }
.card-h .link { margin-left: auto; color: var(--c1); font-weight: 700; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1050px) { .grid-2 { grid-template-columns: 1fr; } }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1180px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }
.stat { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.stat::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c1), var(--c2)); opacity: .85; }
.stat-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px;
  background: color-mix(in srgb, var(--c1) 13%, transparent); color: var(--c1); flex: none; }
.stat div { display: grid; gap: 2px; min-width: 0; }
.stat b { font-size: clamp(19px, 2.3vw, 25px); letter-spacing: -.03em; }
.stat span { font-size: 13px; font-weight: 700; color: var(--muted); }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.violet .stat-ic { background: color-mix(in srgb, #8b5cf6 14%, transparent); color: #8b5cf6; }
.stat.emerald .stat-ic { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.stat.amber .stat-ic { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.stat.rose .stat-ic { background: color-mix(in srgb, var(--no) 14%, transparent); color: var(--no); }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .mini-stats { grid-template-columns: repeat(2, 1fr); } }
.mini { display: flex; align-items: center; gap: 11px; padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); }
.mini span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px;
  background: var(--surface-2); color: var(--muted); }
.mini b { display: block; font-size: 16px; }
.mini small { color: var(--muted); font-size: 12px; }
.mini.emerald span { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.mini.rose span { color: var(--no); background: color-mix(in srgb, var(--no) 13%, transparent); }
.mini.indigo span { color: var(--c1); background: color-mix(in srgb, var(--c1) 14%, transparent); }

/* =========================================================
   TOOLBAR
   ========================================================= */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 3px; padding: 4px; border-radius: 13px; background: var(--surface);
  border: 1px solid var(--line); overflow-x: auto; max-width: 100%; }
.seg-b { border: 0; background: transparent; padding: 8px 13px; border-radius: 10px; font-weight: 700;
  font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: .15s; }
.seg-b:hover { color: var(--txt); }
.seg-b.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; }

/* =========================================================
   TABEL
   ========================================================= */
.tbl-wrap { overflow-x: auto; }
.card.pad0.tbl-wrap { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 13px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { transition: .14s; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--c1) 5%, transparent); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td b { display: block; font-size: 13.8px; }
.tbl td small { display: block; font-size: 11.8px; color: var(--muted); }
.tbl .up { color: var(--ok); font-weight: 700; }
.tbl .down { color: var(--no); font-weight: 700; }
.row-danger td { background: color-mix(in srgb, var(--no) 6%, transparent); }
.tbl .r { text-align: right; }
.tbl th.r { text-align: right; }

.dev { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); margin-right: 8px; vertical-align: middle; }
.chip { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.chip-row { display: flex; gap: 7px; flex-wrap: wrap; }
.chip-b { padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2);
  font-weight: 700; font-size: 12.5px; cursor: pointer; color: var(--muted); transition: .15s; }
.chip-b:hover { color: var(--txt); border-color: var(--c1); }
.chip-b.on { background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border-color: transparent; }
code.pola { display: inline-block; padding: 3px 9px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 16%, transparent);
  color: color-mix(in srgb, var(--warn) 70%, var(--txt)); font-weight: 700; font-size: 12.5px; }

/* =========================================================
   BADGE & AVATAR
   ========================================================= */
.badge { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 800;
  letter-spacing: .01em; border: 1px solid transparent; white-space: nowrap; }
.b-emerald { background: color-mix(in srgb, var(--ok) 15%, transparent); color: #047857; border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.b-amber { background: color-mix(in srgb, var(--warn) 17%, transparent); color: #b45309; border-color: color-mix(in srgb, var(--warn) 32%, transparent); }
.b-rose { background: color-mix(in srgb, var(--no) 14%, transparent); color: #be123c; border-color: color-mix(in srgb, var(--no) 28%, transparent); }
.b-sky { background: color-mix(in srgb, #0ea5e9 15%, transparent); color: #0369a1; border-color: color-mix(in srgb, #0ea5e9 28%, transparent); }
.b-indigo { background: color-mix(in srgb, var(--c1) 15%, transparent); color: #4338ca; border-color: color-mix(in srgb, var(--c1) 30%, transparent); }
.b-violet { background: color-mix(in srgb, #8b5cf6 16%, transparent); color: #6d28d9; border-color: color-mix(in srgb, #8b5cf6 30%, transparent); }
.b-slate { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
html[data-theme="dark"] .b-emerald { color: #6ee7b7; }
html[data-theme="dark"] .b-amber { color: #fcd34d; }
html[data-theme="dark"] .b-rose { color: #fda4af; }
html[data-theme="dark"] .b-sky { color: #7dd3fc; }
html[data-theme="dark"] .b-indigo { color: #c7d2fe; }
html[data-theme="dark"] .b-violet { color: #ddd6fe; }

.avatar { display: grid; place-items: center; border-radius: 99px; font-weight: 800; color: #fff; flex: none;
  background: linear-gradient(135deg, hsl(var(--h, 235) 78% 60%), hsl(calc(var(--h, 235) + 42) 76% 52%)); }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
#userChip .avatar { --h: 250; width: 30px; height: 30px; font-size: 12px; }

/* =========================================================
   LIST / ROW
   ========================================================= */
.list { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 12px;
  border: 0; background: transparent; text-align: left; cursor: pointer; transition: .14s; width: 100%; }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row:hover { background: var(--surface-2); }
.row-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; flex: none;
  background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); }
.row-ic.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.row-ic.no { background: color-mix(in srgb, var(--no) 13%, transparent); color: var(--no); }
.row-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.row-main b { font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: grid; justify-items: end; gap: 2px; flex: none; }
.row-end b { font-size: 13.5px; }
.row-end small { font-size: 11.5px; }

/* =========================================================
   GRAFIK
   ========================================================= */
.chart { width: 100%; height: 150px; display: block; }
.cgrid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; }
.cax { fill: var(--muted); font-size: 11px; font-weight: 700; }
.cbar:hover rect { opacity: .82; }
.donut-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut-wrap { flex: none; }
.donut-num { fill: var(--txt); font-size: 30px; font-weight: 800; }
.donut-lbl { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.legend { display: grid; gap: 8px; flex: 1; min-width: 150px; }
.legend li { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.legend li b { margin-left: auto; color: var(--txt); font-size: 13px; }
.legend li em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.dot { width: 10px; height: 10px; border-radius: 4px; flex: none; }
.empty-mini { color: var(--muted); font-size: 13px; padding: 20px 0; }

.bar-list { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 132px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row span { color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row b { text-align: right; }
.bar-track { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c1), var(--c2)); }

.empty { display: grid; justify-items: center; gap: 8px; padding: 38px 20px; text-align: center; color: var(--muted); }
.empty .i { color: var(--c1); opacity: .8; }
.empty h4 { color: var(--txt); font-size: 15px; }
.empty p { font-size: 13px; max-width: 40ch; }
.empty .btn { margin-top: 8px; }

.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* =========================================================
   CUSTOMER
   ========================================================= */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; }
.cust { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow); display: grid; gap: 12px; transition: .18s; }
.cust:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c1) 34%, var(--line)); }
.cust header { display: flex; align-items: center; gap: 11px; }
.cust-id { min-width: 0; flex: 1; display: grid; }
.cust-id b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cust-id small { color: var(--muted); font-size: 12px; }
.cust-act { display: flex; gap: 5px; }
.addr { display: flex; gap: 7px; align-items: flex-start; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.addr .i { margin-top: 2px; flex: none; }
.cust-stat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.cust-stat div { display: grid; justify-items: center; gap: 1px; }
.cust-stat b { font-size: 15px; }
.cust-stat small { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.hutang { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted);
  padding: 8px 11px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 13%, transparent); }
.hutang b { margin-left: auto; color: #b45309; }
.last-srv { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  border: 1px dashed var(--line); background: transparent; cursor: pointer; text-align: left; transition: .15s; width: 100%; }
.last-srv:hover { border-color: var(--c1); background: color-mix(in srgb, var(--c1) 6%, transparent); }
.last-srv > span:first-child { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: color-mix(in srgb, var(--c1) 12%, transparent); color: var(--c1); flex: none; }
.last-srv > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.last-srv b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last-srv small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   DETAIL SERVIS
   ========================================================= */
.detail { display: grid; gap: 16px; }
.d-head { display: flex; align-items: center; gap: 12px; }
.d-head div { flex: 1; min-width: 0; display: grid; }
.d-head b { font-size: 16px; }
.d-head small { color: var(--muted); font-size: 12.5px; }
.d-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.d-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.d-grid > div { display: grid; gap: 3px; min-width: 0; }
.d-grid span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.d-grid b { font-size: 13.8px; word-break: break-word; }
.d-box { padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--surface-2); }
.d-box span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; }
.d-box p { font-size: 14px; font-weight: 600; margin-top: 5px; }
.d-box.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 26%, transparent); }
.d-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.d-money div { padding: 11px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 3px; }
.d-money span { font-size: 11px; color: var(--muted); font-weight: 700; }
.d-money b { font-size: 14.5px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 12px;
  background: color-mix(in srgb, var(--c1) 9%, transparent); font-size: 13px; font-weight: 600; }
.count { display: flex; gap: 10px; margin: 14px 0 10px; }
.count div { flex: 1; text-align: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.count b { display: block; font-size: 20px; }
.count small { color: var(--muted); font-size: 11.5px; }
.acct { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.acct div { display: grid; gap: 2px; }
.acct b { font-size: 15px; }
.acct small { color: var(--muted); font-size: 12.5px; }
.steps { padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.steps li::marker { color: var(--c1); font-weight: 800; }
.steps code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 12.5px; color: var(--c1); }

/* =========================================================
   MODAL & TOAST
   ========================================================= */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); backdrop-filter: blur(3px);
  opacity: 0; transition: .2s; }
.modal { position: relative; width: min(520px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.98); opacity: 0; transition: .22s cubic-bezier(.2, .9, .3, 1); }
.modal.md { width: min(620px, 100%); }
.modal.lg { width: min(760px, 100%); }
.modal.xl { width: min(940px, 100%); }
.modal.sm { width: min(420px, 100%); }
.modal-wrap.show .modal-backdrop { opacity: 1; }
.modal-wrap.show .modal { transform: none; opacity: 1; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-head .icon-btn { margin-left: auto; border: 0; background: transparent; font-size: 20px; width: 32px; height: 32px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line);
  background: var(--surface-2); border-radius: 0 0 19px 19px; flex-wrap: wrap; }
.modal-foot .btn.danger { margin-right: auto; }

#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: grid; gap: 9px; max-width: min(370px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  font-size: 13.5px; font-weight: 600; animation: pop .22s ease-out; }
.toast .i { color: var(--ok); }
.toast.err .i { color: var(--no); }
.toast.info .i { color: var(--c1); }
.toast.out { opacity: 0; transform: translateY(8px); transition: .28s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* =========================================================
   TAB BAR MOBILE
   ========================================================= */
.tabbar { display: none; }

@media (max-width: 1000px) {
  .auth { grid-template-columns: 1fr; padding: 28px 20px; gap: 24px; }
  .auth-art { max-width: none; }
  .auth-feat { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 276px; transform: translateX(-104%);
    transition: transform .26s cubic-bezier(.2, .9, .3, 1); box-shadow: var(--shadow-lg);
    z-index: 47; /* di atas tabbar(45) agar tombol bawah sidebar bisa diklik saat menu terbuka */
  }
  .sidebar.open { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
    opacity: 0; pointer-events: none; transition: .2s; z-index: 46; }
  .backdrop.on { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-grid; }
  .search-box { min-width: 0; width: 42px; padding: 9px; }
  .search-box:focus-within, .search-box.open { width: min(260px, 52vw); position: absolute; right: 12px; }
  .search-box input { display: none; }
  .search-box:focus-within input, .search-box.open input { display: block; }
  .top-actions .btn.primary { padding: 10px 12px; }
  .top-actions .btn.primary span, .top-actions .btn.primary { font-size: 0; gap: 0; }
  .top-actions .btn.primary .i { width: 18px; height: 18px; }
  .uc-txt { display: none; }
  .page { padding: 14px 14px 96px; }
  .grid-form { grid-template-columns: 1fr; }
  .modal-foot { justify-content: stretch; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  .modal-foot .btn.danger { margin-right: 0; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  }
  .tab-i { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border-radius: 11px;
    color: var(--muted); font-size: 10.5px; font-weight: 700; transition: .15s; }
  .tab-i span { max-width: 68px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-i.on { color: var(--c1); background: color-mix(in srgb, var(--c1) 12%, transparent); }
  .stat b { font-size: 20px; }
  .d-badges { justify-content: flex-start; }
  .bar-row { grid-template-columns: 104px 1fr 30px; font-size: 12px; }
}
@media (max-width: 620px) {
  .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 11px 10px; }
  .card { padding: 15px; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
  #toasts { left: 12px; right: 12px; bottom: 78px; max-width: none; }
}

/* ---------- cetak ---------- */
@media print {
  body { background: #fff; }
  body::before { display: none; }
  .sidebar, .topbar, .tabbar, .backdrop, #toasts { display: none !important; }
  .shell { grid-template-columns: 1fr; }
  .card { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}

/* ---------- sinkron cloud ---------- */
.chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--txt);
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; }
.chk input { width: 17px; height: 17px; accent-color: var(--c1); }
.code-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px;
  font-size: 11.5px; line-height: 1.55; max-height: 280px; overflow: auto; white-space: pre; margin: 12px 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- lupa sandi ---------- */
.link-lupa { background: none; border: 0; padding: 0; color: var(--c1); font-weight: 700;
  font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-lupa:hover { color: var(--c2); }
.lupa-pane .err:not(:empty) { margin-bottom: 4px; }

/* ---------- banner peringatan cloud ---------- */
.warn-banner { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.warn-banner .i { color: var(--warn); flex: none; }
.warn-banner div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.warn-banner b { font-size: 13.5px; }
.warn-banner small { color: var(--muted); font-size: 12px; }
@media (max-width: 620px) { .warn-banner { flex-wrap: wrap; } .warn-banner .btn { width: 100%; justify-content: center; } }
