:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface-2: #1a1a24;
  --border: #24242f;
  --border-soft: #1e1e28;
  --text: #e8e8ee;
  --muted: #8b8b9a;
  --accent: #7c5cff;
  --accent-soft: rgba(124, 92, 255, 0.12);
  --green: #2ecc71;
  --green-soft: rgba(46, 204, 113, 0.12);
  --amber: #f0b429;
  --amber-soft: rgba(240, 180, 41, 0.12);
  --red: #ef4a5a;
  --red-soft: rgba(239, 74, 90, 0.12);
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- layout ---------- */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 2.2; }
.brand-text strong { display: block; font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #5c5c6b;
  padding: 14px 12px 7px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .14s, color .14s;
  margin-bottom: 2px;
}
.nav-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: #b3a1ff; }
.nav-item .count {
  margin-left: auto;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); cursor: pointer;
  font-size: 13px; transition: .14s;
}
.logout-btn:hover { border-color: var(--red); color: var(--red); }
.logout-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.9; }

.main { flex: 1; min-width: 0; padding: 34px 40px 60px; max-width: 1400px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-title { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 14px; font-weight: 620; letter-spacing: -0.01em; }
.card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft);
}
.stat-ico svg { width: 17px; height: 17px; stroke: #b3a1ff; fill: none; stroke-width: 1.9; }
.stat-ico.green { background: var(--green-soft); }
.stat-ico.green svg { stroke: var(--green); }
.stat-ico.amber { background: var(--amber-soft); }
.stat-ico.amber svg { stroke: var(--amber); }
.stat-ico.red { background: var(--red-soft); }
.stat-ico.red svg { stroke: var(--red); }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 23px; font-weight: 680; letter-spacing: -0.025em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- table ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11px; font-weight: 620;
  text-transform: uppercase; letter-spacing: 0.055em;
  color: var(--muted); padding: 11px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 13px 20px; border-bottom: 1px solid var(--border-soft); font-size: 13px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.014); }
.t-mono { font-family: "SF Mono", ui-monospace, "Cascadia Code", monospace; font-size: 12px; color: var(--muted); }
.t-strong { font-weight: 560; }
.t-name { display: flex; align-items: center; gap: 10px; }
.t-name img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.t-name-ph {
  width: 30px; height: 30px; border-radius: 7px; background: var(--surface-2);
  display: grid; place-items: center; flex-shrink: 0;
}
.t-name-ph svg { width: 14px; height: 14px; stroke: var(--muted); fill: none; stroke-width: 1.9; }
.trunc { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.err { background: var(--red-soft); color: var(--red); }
.badge.info { background: var(--accent-soft); color: #b3a1ff; }
.badge.mute { background: var(--surface-2); color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px; font-weight: 550;
  cursor: pointer; transition: .14s;
  white-space: nowrap;
}
.btn:hover { border-color: #35354a; background: #202030; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #6b4bf0; border-color: #6b4bf0; }
.btn-danger { background: transparent; border-color: #3a2027; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 560; color: var(--muted); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color .14s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 90px; font-family: ui-monospace, "Cascadia Code", monospace; font-size: 12.5px; line-height: 1.6; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.search-form { display: flex; gap: 8px; align-items: center; }

/* ---------- toast ---------- */
.toast {
  display: flex; align-items: center; gap: 9px;
  background: var(--green-soft); border: 1px solid rgba(46,204,113,0.3);
  color: var(--green); border-radius: 9px; padding: 10px 15px;
  font-size: 13px; margin-bottom: 18px;
}
.toast svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* ---------- pagination ---------- */
.pager {
  display: flex; gap: 5px; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2);
}
.pager-info { font-size: 12px; color: var(--muted); }
.pager-info b { color: var(--text); font-weight: 600; }
.pager-nav { display: flex; gap: 5px; align-items: center; }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px; font-size: 12.5px; font-weight: 560;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--accent); color: var(--text); }
.pager .cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager .pg svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.pager .pg.disabled { opacity: 0.4; cursor: not-allowed; }
.pager .dots { border: 0; color: var(--muted); }

/* ---------- filter bar & chips ---------- */
.page-head { align-items: center; }
.filter-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 8px; justify-content: flex-end;
}
.filter-bar > .input,
.filter-bar > select.input,
.filter-bar > input.input { width: auto; height: 36px; padding: 0 12px; border-radius: 8px; background: var(--bg); }
.filter-bar .btn { height: 36px; }
.search-input { position: relative; display: flex; align-items: center; flex: 1 1 260px; min-width: 220px; }
.search-input svg {
  position: absolute; left: 12px; width: 15px; height: 15px;
  stroke: var(--muted); fill: none; stroke-width: 2; pointer-events: none;
}
.search-input .input { padding-left: 36px; width: 100%; }
.input-date { width: 140px; color-scheme: dark; }
.input-select { min-width: 112px; cursor: pointer; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); font-size: 12.5px; font-weight: 540;
  text-transform: capitalize; transition: .14s; cursor: pointer;
}
.chip .c { min-width: 22px; text-align: center; }
.chip:hover { border-color: #35354a; color: var(--text); }
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: #b3a1ff; }
.chip .c {
  font-size: 11px; background: var(--surface-2); color: var(--muted);
  padding: 1px 7px; border-radius: 999px; font-variant-numeric: tabular-nums;
}
.chip.active .c { background: rgba(124,92,255,0.25); color: #cbb8ff; }

/* ---------- links & rows ---------- */
.link { color: #b3a1ff; font-weight: 560; }
.link:hover { text-decoration: underline; }
.row-link { cursor: pointer; }
.dot-ok { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: middle; }
.copyable { cursor: pointer; border-bottom: 1px dashed var(--border); }
.copyable:hover { color: var(--text); }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: #b3a1ff; }
.breadcrumb span { margin: 0 6px; opacity: 0.5; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 11px 18px; }
.kv-k { font-size: 12.5px; color: var(--muted); font-weight: 520; }
.kv-v { font-size: 13.5px; word-break: break-word; }
.desc-box { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; max-height: 240px; overflow-y: auto; }
.data-pre {
  background: var(--bg); border: 1px solid var(--border-soft); border-radius: 9px;
  padding: 14px; font-family: "SF Mono", ui-monospace, monospace; font-size: 12.5px;
  color: #c7d2fe; white-space: pre-wrap; word-break: break-all; line-height: 1.65;
  max-height: 400px; overflow-y: auto;
}

/* ---------- user block ---------- */
.user-block { display: flex; align-items: center; gap: 13px; }
.user-ava {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0,0,0,0.62); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
}
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: 620px; max-height: 82vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 14px; font-weight: 620; }
.modal-pre {
  margin: 0; padding: 18px; overflow: auto; flex: 1;
  font-family: "SF Mono", ui-monospace, monospace; font-size: 12.5px;
  color: #c7d2fe; white-space: pre-wrap; word-break: break-all; line-height: 1.7;
}

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 34px 30px;
}
.login-mark {
  width: 46px; height: 46px; border-radius: 12px; margin-bottom: 20px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  display: grid; place-items: center;
}
.login-mark svg { width: 23px; height: 23px; stroke: #fff; fill: none; stroke-width: 2.1; }
.login-card h1 { font-size: 19px; font-weight: 660; letter-spacing: -0.02em; }
.login-card p.sub { color: var(--muted); font-size: 13px; margin: 5px 0 24px; }
.login-err { background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 9px 13px; font-size: 12.5px; margin-bottom: 16px; }

/* ---------- chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%; max-width: 44px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #4c3a99);
  min-height: 3px; transition: .2s;
}
.bar:hover { filter: brightness(1.25); }
.bar-day { font-size: 10.5px; color: var(--muted); }

/* ---------- misc ---------- */
.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty svg { width: 34px; height: 34px; stroke: #3a3a48; fill: none; stroke-width: 1.5; margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
details.product-desc summary { cursor: pointer; color: var(--muted); font-size: 12px; }
details.product-desc p { margin-top: 8px; font-size: 12.5px; color: var(--muted); white-space: pre-wrap; max-height: 220px; overflow-y: auto; background: var(--bg); padding: 10px; border-radius: 8px; }

/* ---------- tabel responsif ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 720px; }
.inline-markup { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.input-sm { padding: 6px 8px !important; font-size: 12px !important; width: 92px; }
.badge-soft { background: var(--surface-2); color: var(--muted); font-size: 10.5px; padding: 2px 7px; border-radius: 999px; }

@media (max-width: 760px) {
  .table-wrap table.responsive { min-width: 0; }
  table.responsive thead { display: none; }
  table.responsive tbody tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.responsive tbody tr:last-child { border-bottom: 0; }
  table.responsive td {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 14px; width: auto; padding: 6px 0; border: 0; text-align: right;
  }
  table.responsive td::before {
    content: attr(data-label); flex: 0 0 44%;
    font-weight: 600; font-size: 12px; color: var(--muted); text-align: left;
  }
  table.responsive td:empty { display: none; }
  table.responsive td .t-name { text-align: left; }
  table.responsive td.right { justify-content: flex-end; }
  table.responsive td.right::before { text-align: left; }
  .inline-markup { justify-content: flex-end; }
}

@media (max-width: 1024px) {
  .sidebar { width: 68px; }
  .brand-text, .nav-label, .nav-item span:not(.count), .sidebar-foot .logout-btn span { display: none; }
  .nav-item { justify-content: center; }
  .main { padding: 24px 20px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .row2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
}

/* =========================================================
   LAYOUT v2 — halaman Orders & Users
   ========================================================= */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph-title { font-size: 24px; font-weight: 700; letter-spacing: -0.025em; }
.ph-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi {
  display: flex; flex-direction: column; gap: 4px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
}
.kpi-label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi-value { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-foot { font-size: 12px; color: var(--muted); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-red { color: var(--red); }

/* Toolbar */
.toolbar {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px; margin-bottom: 14px;
}
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search {
  position: relative; flex: 1 1 340px; min-width: 240px; display: flex; align-items: center;
}
.search svg { position: absolute; left: 13px; width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; pointer-events: none; }
.search input {
  width: 100%; height: 40px; padding: 0 36px 0 40px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; outline: none;
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: #5c5c6b; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 8px; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 6px; color: var(--muted); font-size: 18px; line-height: 1;
}
.search-clear:hover { background: var(--surface-2); color: var(--text); }
.select {
  height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; outline: none; cursor: pointer; color-scheme: dark;
}
.select:focus, .date-field input:focus { border-color: var(--accent); }
.date-field {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.date-field span { font-size: 12px; color: var(--muted); }
.date-field input {
  background: transparent; border: 0; outline: none; font-size: 13px; color-scheme: dark; width: 128px;
}

.btn-solid, .btn-ghost {
  height: 40px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-solid { background: linear-gradient(135deg, var(--accent), #8b6bff); border: 1px solid transparent; color: #fff; box-shadow: 0 6px 18px -8px rgba(124,92,255,.7); }
.btn-solid:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: #3a3a4d; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px;
  border-radius: 9px; font-size: 12.5px; font-weight: 550; color: var(--muted);
  border: 1px solid transparent; transition: .15s;
}
.tab span {
  font-size: 11px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab.on { background: var(--accent-soft); border-color: rgba(124,92,255,.45); color: #c6b8ff; }
.tab.on span { background: rgba(124,92,255,.3); color: #e4dcff; }

/* Panel & table */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
table.grid { min-width: 860px; }
table.grid th { background: transparent; padding: 13px 18px; font-size: 11px; border-bottom: 1px solid var(--border); }
table.grid td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
table.grid tbody tr { transition: background .12s; }
table.grid tbody tr:hover { background: rgba(124,92,255,0.04); }
table.grid th.num, table.grid td.num { text-align: right; }
table.grid th.right, table.grid td.right { text-align: right; }

.cell-main { font-weight: 560; color: var(--text); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.mono { font-family: "SF Mono", ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.oid { font-family: "SF Mono", ui-monospace, monospace; font-size: 12.5px; font-weight: 600; color: #b3a1ff; }
.oid:hover { text-decoration: underline; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.pill.err { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--accent-soft); color: #b3a1ff; }
.pill.mute { background: var(--surface-2); color: var(--muted); }

.reveal {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--accent-soft); border: 1px solid rgba(124,92,255,.35); color: #c6b8ff; transition: .15s;
}
.reveal svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.reveal:hover { background: rgba(124,92,255,.24); }

.acts { display: inline-flex; gap: 6px; justify-content: flex-end; }
.act {
  width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; transition: .15s;
}
.act svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.act:hover { color: var(--text); border-color: #3a3a4d; }
.act.ok:hover { color: var(--green); border-color: rgba(46,204,113,.5); background: var(--green-soft); }
.act.danger:hover { color: var(--red); border-color: rgba(239,74,90,.5); background: var(--red-soft); }
form { display: inline; }

.person { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(167,139,250,.2)); color: #d8ccff; font-weight: 700; font-size: 14px;
}
.btn-mini {
  height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: .15s;
}
.btn-mini:hover { border-color: #3a3a4d; }
.btn-mini.danger { color: var(--red); background: transparent; border-color: rgba(239,74,90,.35); }
.btn-mini.danger:hover { background: var(--red-soft); border-color: var(--red); }

/* Empty */
.blank { padding: 56px 20px; text-align: center; }
.blank-ico {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.blank-ico svg { width: 24px; height: 24px; stroke: var(--muted); fill: none; stroke-width: 1.8; }
.blank-title { font-weight: 600; font-size: 14px; }
.blank-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* Pager (refresh) */
.pager { background: var(--surface-2); border-top: 1px solid var(--border); padding: 12px 18px; }
.pager a, .pager span { min-width: 34px; height: 34px; border-radius: 9px; font-size: 13px; }

/* Modal (refresh) */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(4,4,10,.7); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-box {
  width: 100%; max-width: 640px; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15px; font-weight: 650; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.icon-btn:hover { color: var(--text); border-color: #3a3a4d; }
.modal-pre {
  margin: 0; padding: 18px 20px; overflow: auto; flex: 1; min-height: 120px;
  font-family: "SF Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.7;
  color: #d6dcff; background: var(--bg); white-space: pre-wrap; word-break: break-all;
}
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }

@media (max-width: 760px) {
  .toolbar-right { width: 100%; }
  .toolbar-right > * { flex: 1 1 auto; }
  .date-field input { width: 100%; }
  table.grid { min-width: 0; }
}

/* =========================================================
   THEME v3 — colorful glassmorphism (Orders & Users)
   ========================================================= */
body {
  background:
    radial-gradient(900px 500px at -10% -10%, rgba(124,92,255,.28), transparent 60%),
    radial-gradient(800px 500px at 110% 0%, rgba(56,189,248,.20), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(244,114,182,.16), transparent 60%),
    #07070d;
  background-attachment: fixed;
}

/* Komponen glass: variabel lokal */
.gx { --glass: rgba(255,255,255,0.055); --glass-br: rgba(255,255,255,0.10); }

.ph-title {
  font-size: 26px; background: linear-gradient(90deg,#c4b5fd,#7dd3fc 60%,#f0abfc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* KPI glass + gradient tint */
.kpi {
  position: relative; overflow: hidden;
  background: rgba(255,255,255,0.05); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.08);
}
.kpi::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: linear-gradient(180deg,#a78bfa,#38bdf8,#f472b6);
}
.kpi { padding-left: 22px; }
.kpi:nth-child(2)::before { background: linear-gradient(180deg,#34d399,#38bdf8); }
.kpi:nth-child(3)::before { background: linear-gradient(180deg,#34d399,#a3e635); }
.kpi:nth-child(4)::before { background: linear-gradient(180deg,#fbbf24,#fb7185); }
.kpi-label { color: #9d9db0; }
.kpi-value { font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }

/* Toolbar glass */
.toolbar {
  background: rgba(255,255,255,0.05); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.10); border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.07);
  padding: 12px;
}
.search input, .select, .date-field {
  background: rgba(0,0,0,0.28); border: 1px solid rgba(255,255,255,0.10);
}
.search input:focus { border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(167,139,250,.18); }
.select:focus, .date-field input:focus { border-color: transparent; }
.btn-solid {
  background: linear-gradient(135deg,#8b5cf6,#6366f1 45%,#06b6d4);
  border: 0; box-shadow: 0 8px 24px -8px rgba(99,102,241,.8), inset 0 1px 0 rgba(255,255,255,.25);
  font-weight: 700;
}
.btn-ghost { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); }

/* Tabs glass */
.tab { border-radius: 12px; height: 36px; }
.tab span { background: rgba(255,255,255,0.08); }
.tab:hover { background: rgba(255,255,255,0.06); }
.tab.on {
  background: linear-gradient(135deg, rgba(139,92,246,.35), rgba(56,189,248,.25));
  border-color: rgba(167,139,250,.45); color: #e6dcff;
  box-shadow: 0 4px 16px -6px rgba(139,92,246,.6), inset 0 1px 0 rgba(255,255,255,.15);
}
.tab.on span { background: rgba(139,92,246,.45); color: #f1eaff; }

/* Panel glass */
.panel {
  background: rgba(255,255,255,0.045); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.09); border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.07);
}
table.grid th {
  background: rgba(255,255,255,0.03); color: #9d9db0; border-bottom: 1px solid rgba(255,255,255,0.08);
}
table.grid td { border-bottom: 1px solid rgba(255,255,255,0.06); }
table.grid tbody tr:hover { background: linear-gradient(90deg, rgba(139,92,246,.08), rgba(56,189,248,.05)); }
table.grid tbody tr:last-child td { border-bottom: 0; }

/* Pills colorful soft gradients */
.pill { height: 26px; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.pill.ok { background: linear-gradient(135deg, rgba(52,211,153,.25), rgba(52,211,153,.10)); color: #6ee7b7; border: 1px solid rgba(52,211,153,.35); }
.pill.warn { background: linear-gradient(135deg, rgba(251,191,36,.22), rgba(251,146,60,.08)); color: #fcd34d; border: 1px solid rgba(251,191,36,.3); }
.pill.err { background: linear-gradient(135deg, rgba(251,113,133,.25), rgba(251,113,133,.08)); color: #fda4af; border: 1px solid rgba(251,113,133,.35); }
.pill.info { background: linear-gradient(135deg, rgba(167,139,250,.3), rgba(56,189,248,.15)); color: #c4b5fd; border: 1px solid rgba(167,139,250,.4); }
.pill.mute { background: rgba(255,255,255,0.07); color: #9d9db0; border: 1px solid rgba(255,255,255,0.1); }

/* Tombol reveal / acts */
.reveal {
  background: linear-gradient(135deg, rgba(139,92,246,.30), rgba(56,189,248,.18));
  border: 1px solid rgba(167,139,250,.45); color: #ddd0ff;
}
.reveal:hover { box-shadow: 0 4px 16px -4px rgba(139,92,246,.7); }
.act {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px;
}
.act:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(0,0,0,.6); }
.act.ok:hover { background: rgba(52,211,153,.18); color: #6ee7b7; border-color: rgba(52,211,153,.4); }
.act.danger:hover { background: rgba(251,113,133,.16); color: #fda4af; border-color: rgba(251,113,133,.4); }

/* Avatar gradient colorful */
.avatar {
  background: linear-gradient(135deg,#8b5cf6,#ec4899 70%); color: #fff;
  box-shadow: 0 4px 14px -4px rgba(139,92,246,.8), inset 0 1px 0 rgba(255,255,255,.3);
}

.btn-mini { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 9px; }
.btn-mini.danger { color: #fda4af; border-color: rgba(251,113,133,.4); }
.btn-mini.danger:hover { background: rgba(251,113,133,.14); }

/* Pager glass */
.pager { background: rgba(255,255,255,0.03); border-top: 1px solid rgba(255,255,255,0.08); }
.pager a, .pager span { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); color: #b9b9cc; }
.pager a:hover { border-color: rgba(167,139,250,.6); color: #fff; }
.pager .cur {
  background: linear-gradient(135deg,#8b5cf6,#6366f1); border-color: transparent; color: #fff;
  box-shadow: 0 4px 12px -4px rgba(139,92,246,.8);
}
.pager .pg.disabled { opacity: .35; }
.pager .dots { border: 0; background: transparent; }

/* Modal glass */
.modal { background: rgba(5,5,12,.65); backdrop-filter: blur(10px); }
.modal-box {
  background: rgba(20,20,32,0.9); backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 20px;
  box-shadow: 0 40px 100px rgba(0,0,0,.65), 0 0 0 1px rgba(139,92,246,.15), inset 0 1px 0 rgba(255,255,255,.12);
}
.modal-pre { background: rgba(0,0,0,0.35); }

/* Scrollbar webkit */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(167,139,250,0.4); background-clip: content-box; }

/* ---------- v3.1: responsive polish (Orders & Users) ---------- */
.th-sort { color: inherit; display: inline-flex; align-items: center; gap: 5px; }
.th-sort:hover { color: #c4b5fd; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table.grid { min-width: 860px; }
table.grid thead th {
  position: sticky; top: 0; z-index: 5;
  background: rgba(14,14,24,0.9); backdrop-filter: blur(12px);
}

.reveal, .act { min-width: 38px; min-height: 38px; }
.reveal { height: 36px; padding: 0 13px; }
.act { width: 36px; height: 36px; }

@media (max-width: 760px) {
  .main { padding: 20px 14px 44px; }
  .ph-title { font-size: 22px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px 12px 18px; border-radius: 14px; }
  .kpi-value { font-size: 19px; }

  .toolbar { flex-direction: column; align-items: stretch; padding: 12px; gap: 12px; }
  .toolbar-right { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .btn-solid, .btn-ghost { height: 42px; }

  .tabs { gap: 5px; }
  .tab { height: 32px; font-size: 12px; }

  table.grid { min-width: 0; border-collapse: separate; border-spacing: 0; }
  table.grid thead th { position: static; background: rgba(14,14,24,0.9); }

  .acts { flex-direction: row; gap: 7px; }
  .reveal { width: 100%; justify-content: center; }
  .act { width: 34px; height: 34px; }

  .cell-main { max-width: none; white-space: normal; }
  .modal-box { max-width: 92vw; max-height: 80vh; }

  .pager { flex-wrap: wrap; justify-content: center; }
  .pager-nav { flex-wrap: wrap; justify-content: center; }
}
