/* ================================================================
   P3K168 — Design System v1.0
   Premium, modern, tanpa emoji. Ikon: Lucide (stroke).
   Tema: dark (default) / light — html[data-theme]
   ================================================================ */

/* ---------- Font: Inter (self-hosted) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --brand-1: #5b5ef0;
  --brand-2: #8b34f4;
  --brand-grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --brand: #6d6ff3;

  --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-full: 999px;
  --tr: .16s cubic-bezier(.4, 0, .2, 1);

  --good: #34d399; --warn: #fbbf24; --bad: #fb7185; --info: #60a5fa;
}

:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0c12;
  --bg-2: #0d1017;
  --card: #12151f;
  --elev: #181c2a;
  --elev-2: #1e2333;
  --border: rgba(148, 163, 184, .13);
  --border-strong: rgba(148, 163, 184, .22);
  --text: #e9ebf5;
  --muted: #9aa3b8;
  --faint: #646d83;
  --brand-soft: rgba(109, 111, 243, .14);
  --good-soft: rgba(52, 211, 153, .13);
  --warn-soft: rgba(251, 191, 36, .13);
  --bad-soft: rgba(251, 113, 133, .13);
  --info-soft: rgba(96, 165, 250, .13);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 12px 32px -16px rgba(0,0,0,.55);
  --shadow-lg: 0 24px 64px -24px rgba(0,0,0,.7);
  --glow: 0 6px 24px -6px rgba(109,111,243,.5);
  --backdrop: rgba(5, 7, 13, .66);
  --topbar-bg: rgba(10, 12, 18, .82);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa;
  --bg-2: #eef1f8;
  --card: #ffffff;
  --elev: #f5f6fb;
  --elev-2: #eceef7;
  --border: rgba(30, 41, 72, .1);
  --border-strong: rgba(30, 41, 72, .18);
  --text: #161b2c;
  --muted: #5b647c;
  --faint: #98a0b6;
  --brand-soft: rgba(91, 94, 240, .1);
  --good-soft: rgba(5, 150, 105, .1);
  --warn-soft: rgba(217, 119, 6, .12);
  --bad-soft: rgba(225, 29, 72, .09);
  --info-soft: rgba(37, 99, 235, .09);
  --good: #059669; --warn: #d97706; --bad: #e11d48; --info: #2563eb;
  --shadow: 0 1px 2px rgba(23, 27, 44, .06), 0 12px 32px -18px rgba(23, 27, 44, .18);
  --shadow-lg: 0 24px 64px -28px rgba(23, 27, 44, .28);
  --glow: 0 6px 20px -6px rgba(91, 94, 240, .45);
  --backdrop: rgba(23, 27, 44, .4);
  --topbar-bg: rgba(243, 245, 250, .85);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }
img { display: block; }
.ic { flex: none; display: inline-block; vertical-align: -0.14em; }
.row .ic, .row-between .ic, .btn .ic, .tile .ic, .menu-item .ic, .sb-link .ic { vertical-align: baseline; }

/* ---------- Brand: styled text (tanpa logo) ---------- */
.brand { font-weight: 800; letter-spacing: -.02em; white-space: nowrap; line-height: 1.1; }
.brand .b2 { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

::selection { background: rgba(109, 111, 243, .35); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Util ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.semibold { font-weight: 600; }
.mono { font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, Consolas, monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 26px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.text-good { color: var(--good); } .text-warn { color: var(--warn); } .text-bad { color: var(--bad); } .text-brand { color: var(--brand); }
.grad-text { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; display: flex; align-items: center; gap: 9px; }
.card-head h3 .ic { color: var(--muted); }
.card-body { padding: 20px; }
.card-hover { transition: transform var(--tr), box-shadow var(--tr), border-color var(--tr); }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: all var(--tr); text-decoration: none; color: var(--text); background: transparent;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand-grad); color: #fff; box-shadow: var(--glow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: rgba(109, 111, 243, .22); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn-ghost:hover { background: var(--elev); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: rgba(251, 113, 133, .22); }
.btn-good { background: var(--good-soft); color: var(--good); }
.btn-good:hover { background: rgba(52, 211, 153, .22); }
.btn-sm { height: 33px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; gap: 6px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14.5px; border-radius: 14px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; color: var(--muted); }
.btn-icon:hover { background: var(--elev); color: var(--text); }
.btn-block { width: 100%; }

/* ---------- Badge / chip ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: var(--r-full); font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  background: var(--elev-2); color: var(--muted); border: 1px solid transparent; white-space: nowrap;
}
.badge .ic { width: 12px; height: 12px; }
.b-good { background: var(--good-soft); color: var(--good); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-brand { background: var(--brand-soft); color: var(--brand); }
.b-neutral { background: var(--elev-2); color: var(--muted); }
.b-outline { background: transparent; border-color: var(--border-strong); }
.chip-code {
  font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; letter-spacing: .04em;
  background: var(--elev-2); border: 1px solid var(--border); color: var(--muted);
  padding: 3px 8px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}

/* ---------- Dot status ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-good { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.dot-warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot-bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }

/* ---------- Form ---------- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.input, .select, textarea.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  background: var(--elev); border: 1px solid var(--border); color: var(--text);
  font-size: 13.5px; font-family: inherit; transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
textarea.input { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--card);
}
.select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input-wrap { position: relative; }
.input-wrap .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-wrap .input { padding-left: 40px; }
.input-wrap .input-trail { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.input-sm { height: 36px; border-radius: 10px; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
kbd {
  font-family: inherit; font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: var(--elev-2); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 6px;
}

/* ---------- Switch ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px; background: var(--elev-2);
  border: 1px solid var(--border-strong); transition: all var(--tr); cursor: pointer;
}
.switch .track::before {
  content: ''; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  background: var(--muted); top: 2px; left: 2px; transition: all var(--tr);
}
.switch input:checked + .track { background: var(--brand-grad); border-color: transparent; }
.switch input:checked + .track::before { transform: translateX(17px); background: #fff; }

/* ---------- Segmented ---------- */
.seg { display: inline-flex; background: var(--elev); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button, .seg a {
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 500;
  padding: 7px 14px; border-radius: 9px; cursor: pointer; transition: all var(--tr);
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-family: inherit;
}
.seg .active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a {
  border: 0; background: none; font-family: inherit; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; font-size: 13.5px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--tr); text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.tabs .active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Table ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
  white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--tr); }
.tbl tbody tr:hover { background: var(--elev); }
.tbl th:first-child, .tbl td:first-child { padding-left: 20px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 20px; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-sm { font-size: 12.5px; }
.tbl-sm th { padding: 10px 10px; }
.tbl-sm td { padding: 9px 10px; }

/* ---------- Avatar ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brand-grad); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  flex: none; letter-spacing: .02em;
}
.avatar-sm { width: 30px; height: 30px; font-size: 11px; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }

/* ---------- Icon tile ---------- */
.tile {
  width: 42px; height: 42px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; background: var(--brand-soft); color: var(--brand);
}
.tile-sm { width: 36px; height: 36px; border-radius: 11px; }
.tile-good { background: var(--good-soft); color: var(--good); }
.tile-warn { background: var(--warn-soft); color: var(--warn); }
.tile-bad { background: var(--bad-soft); color: var(--bad); }
.tile-info { background: var(--info-soft); color: var(--info); }
.tile-neutral { background: var(--elev-2); color: var(--muted); }
.tile-grad { background: var(--brand-grad); color: #fff; box-shadow: var(--glow); }

/* ---------- Stat card ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; }
.stat .val { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ---------- Progress bar ---------- */
.bar { height: 7px; border-radius: 99px; background: var(--elev-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--brand-grad); transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar-fill.good { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.bad { background: linear-gradient(90deg, #f43f5e, #fb7185); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  z-index: 90; display: grid; place-items: center; padding: 20px; overflow-y: auto;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 20px;
  width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); animation: popIn .22s cubic-bezier(.34,1.4,.64,1);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
}
.modal-lg { max-width: 640px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 22px 20px; }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Dropdown menu ---------- */
.dd { position: relative; }
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 210px; z-index: 60;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: 6px; animation: menuIn .16s cubic-bezier(.34,1.3,.64,1); transform-origin: top right;
}
.menu-left { right: auto; left: 0; transform-origin: top left; }
@keyframes menuIn { from { opacity: 0; transform: scale(.95) translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 9px;
  background: none; border: 0; color: var(--text); font-size: 13px; font-family: inherit; cursor: pointer;
  text-align: left; text-decoration: none; transition: background var(--tr);
}
.menu-item:hover { background: var(--elev); }
.menu-item .ic { color: var(--muted); }
.menu-item.danger, .menu-item.danger .ic { color: var(--bad); }
.menu-item.danger:hover { background: var(--bad-soft); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 8px; }
.menu-label { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 8px 11px 4px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
  animation: toastIn .25s cubic-bezier(.34,1.3,.64,1); font-size: 13px;
}
.toast .ic { margin-top: 1px; }
.toast.out { animation: toastOut .2s ease forwards; }
.toast-good .ic { color: var(--good); } .toast-bad .ic { color: var(--bad); }
.toast-warn .ic { color: var(--warn); } .toast-info .ic { color: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 46px 20px; }
.empty .tile { width: 56px; height: 56px; border-radius: 17px; margin: 0 auto 14px; }
.empty h4 { font-size: 15px; margin-bottom: 5px; }
.empty p { color: var(--muted); font-size: 13px; max-width: 340px; margin: 0 auto; }

/* ---------- Skeleton ---------- */
.sk { position: relative; overflow: hidden; background: var(--elev); border-radius: 8px; }
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(148,163,184,.09), transparent);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 14px 0 0; }
.pager a, .pager span.cur {
  min-width: 34px; height: 34px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; font-size: 13px; color: var(--muted); border: 1px solid transparent; text-decoration: none;
}
.pager a:hover { background: var(--elev); color: var(--text); }
.pager span.cur { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ================================================================
   LAYOUT DESKTOP
   ================================================================ */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 262px; z-index: 50;
  background: var(--bg-2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sb-brand { padding: 22px 22px 16px; }
.sb-brand .tg { font-size: 10.5px; color: var(--faint); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-top: 5px; }
.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.sb-sec { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); padding: 16px 10px 7px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 9.5px 11px; border-radius: 11px;
  color: var(--muted); font-size: 13.5px; font-weight: 500; text-decoration: none; transition: all var(--tr);
  margin-bottom: 2px; position: relative;
}
.sb-link .ic { color: var(--faint); transition: color var(--tr); }
.sb-link:hover { background: var(--elev); color: var(--text); }
.sb-link:hover .ic { color: var(--muted); }
.sb-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.sb-link.active .ic { color: var(--brand); }
.sb-link .cnt { margin-left: auto; font-size: 10.5px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 99px; min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.sb-user { border-top: 1px solid var(--border); padding: 14px 16px; display: flex; align-items: center; gap: 11px; }
.sb-user .nm { font-size: 13px; font-weight: 600; line-height: 1.2; }
.sb-user .rl { font-size: 11px; color: var(--faint); }

.main { margin-left: 262px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 62px; padding: 0 26px;
  display: flex; align-items: center; gap: 14px;
  background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 16.5px; font-weight: 600; }
.topbar .crumb { color: var(--faint); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.search-btn {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 13px; min-width: 210px;
  background: var(--elev); border: 1px solid var(--border); border-radius: 11px; cursor: pointer;
  color: var(--faint); font-size: 13px; font-family: inherit; transition: border-color var(--tr);
}
.search-btn:hover { border-color: var(--border-strong); }
.search-btn kbd { margin-left: auto; }
.content { padding: 26px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Banner impersonasi / admin mode */
.imp-banner {
  display: flex; align-items: center; gap: 10px; padding: 9px 26px; font-size: 12.5px; font-weight: 500;
  background: linear-gradient(90deg, rgba(251,191,36,.14), rgba(251,146,60,.1)); color: var(--warn);
  border-bottom: 1px solid rgba(251,191,36,.25);
}
.imp-banner form { margin-left: auto; }

/* Notif dropdown */
.notif-list { max-height: 400px; overflow-y: auto; min-width: 340px; }
.notif-item { display: flex; gap: 11px; padding: 11px; border-radius: 10px; text-decoration: none; color: var(--text); transition: background var(--tr); }
.notif-item:hover { background: var(--elev); }
.notif-item.unread { background: var(--brand-soft); }
.notif-item.unread:hover { background: rgba(109,111,243,.2); }
.notif-item .t { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: block; }
.notif-item .b { font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 1px; display: block; }
.notif-item .w { font-size: 10.5px; color: var(--faint); margin-top: 3px; display: block; }
.notif-item .badge, .notif-item .tile { flex: none; }

/* ---------- Kit card ---------- */
.kits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kit-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.kit-card .loc { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.kit-type {
  width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; background: var(--brand-soft); color: var(--brand); flex: none;
}
.kit-issues { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Command palette ---------- */
.palette-backdrop { position: fixed; inset: 0; background: var(--backdrop); backdrop-filter: blur(5px); z-index: 100; animation: fadeIn .15s ease; }
.palette {
  position: fixed; top: 12vh; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow-lg);
  z-index: 101; overflow: hidden; animation: popIn .2s cubic-bezier(.34,1.4,.64,1);
}
.palette input {
  width: 100%; border: 0; background: transparent; color: var(--text); font-size: 15px; font-family: inherit;
  padding: 17px 18px; outline: none; border-bottom: 1px solid var(--border);
}
.palette-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.pal-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; cursor: pointer;
  color: var(--text); text-decoration: none;
}
.pal-item.sel { background: var(--brand-soft); }
.pal-item .t { font-size: 13.5px; font-weight: 500; }
.pal-item .s { font-size: 11.5px; color: var(--faint); }
.pal-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11px; align-items: center; }

/* ================================================================
   LAYOUT MOBILE
   ================================================================ */
.m-shell { min-height: 100vh; min-height: 100dvh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.m-top {
  position: sticky; top: 0; z-index: 40; height: 58px; padding: 0 16px;
  display: flex; align-items: center; gap: 12px;
  background: var(--topbar-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.m-top h1 { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-content { padding: 16px; max-width: 640px; margin: 0 auto; }
.m-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: calc(66px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--topbar-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
}
.m-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); text-decoration: none; font-size: 10px; font-weight: 600; letter-spacing: .01em;
  transition: color var(--tr); position: relative;
}
.m-nav a.active { color: var(--brand); }
.m-nav .fab-slot { position: relative; }
.m-fab {
  position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 19px; background: var(--brand-grad); color: #fff;
  display: grid; place-items: center; box-shadow: var(--glow), 0 8px 20px -6px rgba(0,0,0,.4);
  border: 4px solid var(--bg); transition: transform var(--tr);
}
.m-fab:active { transform: translateX(-50%) scale(.94); }
.m-nav .fab-slot span { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 10px; font-weight: 600; color: var(--faint); }

/* Bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 90; animation: fadeIn .18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 88vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border-strong); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  animation: sheetIn .26s cubic-bezier(.34,1.2,.64,1); box-shadow: var(--shadow-lg);
}
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 99px; background: var(--border-strong); margin: 6px auto 14px; }
@keyframes sheetIn { from { transform: translateY(60%); opacity: .5; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .sheet { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: 22px; bottom: 20px; border-bottom: 1px solid var(--border-strong); } @keyframes sheetIn { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } } }

/* Mobile list rows */
.mlist { display: flex; flex-direction: column; gap: 10px; }
.mrow {
  display: flex; align-items: center; gap: 13px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; transition: transform var(--tr), border-color var(--tr);
}
.mrow:active { transform: scale(.985); }
.mrow .t { font-size: 14px; font-weight: 600; line-height: 1.3; }
.mrow .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Qty stepper */
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--elev); border: 1px solid var(--border); border-radius: 11px; padding: 3px; }
.stepper button {
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer; transition: all var(--tr); font-family: inherit;
}
.stepper button:hover { background: var(--elev-2); color: var(--text); }
.stepper button:active { transform: scale(.9); }
.stepper button:disabled { opacity: .35; pointer-events: none; }
.stepper .qv { min-width: 38px; text-align: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Qty besar di baris item */
.qty-big { text-align: right; }
.qty-big .n { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.qty-big .u { font-size: 10.5px; color: var(--faint); font-weight: 500; }

/* ================================================================
   HALAMAN LOGIN
   ================================================================ */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-brand {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 44px 48px; background:
    radial-gradient(800px 500px at -10% -20%, rgba(91,94,240,.35), transparent 60%),
    radial-gradient(700px 500px at 110% 120%, rgba(139,52,244,.3), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--border);
}
.login-brand .grid-deco {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(600px 400px at 30% 30%, black, transparent);
  -webkit-mask-image: radial-gradient(600px 400px at 30% 30%, black, transparent);
}
.login-feat { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; position: relative; }
.login-feat .t { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.login-feat .s { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.login-form-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(400px, 100%); }
.login-brand-sm { display: none; }
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-brand-sm { display: block; }
}

/* ================================================================
   HALAMAN SCAN PUBLIK
   ================================================================ */
.scan-shell { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.scan-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 22px;
  background: linear-gradient(140deg, rgba(91,94,240,.22), rgba(139,52,244,.14)), var(--card);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.scan-hero .deco { position: absolute; right: -30px; top: -30px; opacity: .08; pointer-events: none; }
.item-row {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  background: var(--card); border: 1px solid var(--border); border-radius: 15px;
  transition: border-color var(--tr), background var(--tr);
}
.item-row.selected { border-color: var(--brand); background: var(--brand-soft); }
.item-row .nm { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.item-row .cat { font-size: 11px; color: var(--faint); margin-top: 1px; }
.take-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  background: var(--topbar-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.take-bar .inner { max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }

/* Sukses check animation */
.success-check { width: 74px; height: 74px; border-radius: 50%; background: var(--good-soft); display: grid; place-items: center; margin: 0 auto 16px; color: var(--good); animation: popIn .4s cubic-bezier(.34,1.5,.64,1); }

/* ================================================================
   LABEL QR (cetak)
   ================================================================ */
.label-card {
  background: #fff; color: #10131c; border-radius: 14px; overflow: hidden;
  border: 1px solid #d8dcea; width: 100%; max-width: 300px;
  box-shadow: var(--shadow); page-break-inside: avoid; break-inside: avoid;
}
.label-strip { background: linear-gradient(135deg, #5b5ef0, #8b34f4); color: #fff; padding: 10px 14px; display: flex; align-items: center; justify-content: center; }
.label-strip .an { font-size: 13.5px; font-weight: 800; letter-spacing: .1em; }
.label-qr { display: grid; place-items: center; padding: 14px 14px 6px; }
.label-qr svg, .label-qr img { width: 148px; height: 148px; }
.label-code { text-align: center; font-family: ui-monospace, Menlo, monospace; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: #3f3fc9; }
.label-meta { text-align: center; padding: 6px 14px 4px; }
.label-meta .n { font-size: 13px; font-weight: 700; line-height: 1.25; }
.label-meta .l { font-size: 10px; color: #5b647c; margin-top: 2px; }
.label-hint { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 8.5px; color: #6b7390; padding: 7px 12px 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

.labels-print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }

@media print {
  body { background: #fff !important; }
  .no-print, .sidebar, .topbar, .m-nav, .m-top, .toasts { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .labels-print-grid { grid-template-columns: repeat(2, 1fr); gap: 10mm; }
  .label-card { box-shadow: none; border: 1px dashed #bbb; }
  @page { margin: 12mm; }
}

/* ---------- Responsif desktop kecil ---------- */
@media (max-width: 1000px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s cubic-bezier(.4,0,.2,1); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .sb-toggle { display: inline-flex !important; }
  .search-btn { min-width: 0; }
  .search-btn .sb-txt, .search-btn kbd { display: none; }
}
.sb-toggle { display: none; }
.sb-overlay { position: fixed; inset: 0; z-index: 49; background: var(--backdrop); animation: fadeIn .2s ease; }

/* ---------- Chart ---------- */
.chart-wrap { position: relative; }
.chart-tip {
  position: absolute; pointer-events: none; background: var(--elev-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 7px 11px; font-size: 12px; box-shadow: var(--shadow-lg);
  transform: translate(-50%, -110%); white-space: nowrap; z-index: 5; display: none;
}
.chart-tip .v { font-weight: 700; font-size: 13px; }
.chart-tip .d { color: var(--muted); font-size: 10.5px; }

/* ---------- Icon picker ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; max-height: 220px; overflow-y: auto; padding: 4px; }
.icon-grid button {
  aspect-ratio: 1; border-radius: 11px; border: 1px solid var(--border); background: var(--elev);
  color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: all var(--tr);
}
.icon-grid button:hover { border-color: var(--brand); color: var(--brand); }
.icon-grid button.sel { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

/* ---------- Timeline riwayat ---------- */
.tl { position: relative; padding-left: 24px; }
.tl::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding: 8px 0 14px; }
.tl-item::before {
  content: ''; position: absolute; left: -22.5px; top: 13px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--faint); border: 2px solid var(--bg-2);
}
.tl-item.use::before { background: var(--bad); }
.tl-item.restock::before { background: var(--good); }
.tl-item.adjust::before { background: var(--warn); }
