/* ============================================================
   KDP 168 — Design System
   Tema: corporate dark-navy, minimal, profesional.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #080d1a;
  --bg-grad-top: #0b1426;
  --bg-grad-bottom: #070b16;
  --sidebar-top: #0c1730;
  --sidebar-bottom: #080f20;
  --surface: #0f1a30;
  --surface-2: #13203b;
  --surface-3: #182a49;

  /* Lines */
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.2);

  /* Text */
  --text: #e7ecf5;
  --text-muted: #8a99b3;
  --text-dim: #56657f;

  /* Brand / accent */
  --primary: #2f6bff;
  --primary-hover: #3f78ff;
  --primary-strong: #1d4ed8;
  --primary-soft: rgba(47, 107, 255, 0.14);
  --primary-ring: rgba(47, 107, 255, 0.35);

  /* Status */
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, 0.14);
  --success: #34c759;
  --success-soft: rgba(52, 199, 89, 0.14);
  --warning: #eab308;
  --warning-soft: rgba(234, 179, 8, 0.14);

  /* Shape */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.65), 0 8px 24px -16px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.55);

  /* Accent (untuk gradien modern pada logo & elemen utama) */
  --accent: #7c5cff;
  --accent-strong: #6038ef;
  --ease: cubic-bezier(.2, .7, .2, 1);

  --sidebar-w: 280px;
  --topbar-h: 64px;

  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(47, 107, 255, 0.1), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.3); }

/* Sembunyikan scrollbar window (scroll tetap berfungsi) agar layout tidak
   bergeser saat scrollbar muncul/hilang. Scrollbar komponen (sidebar, modal,
   tabel) tetap tampil normal. */
html { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  height: 40px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-strong);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(180deg, var(--primary-hover), var(--primary));
  border-color: var(--primary-strong);
  color: #fff;
  box-shadow: 0 8px 22px -12px var(--primary-ring);
}
.btn-primary:hover { background: linear-gradient(180deg, #4f84ff, var(--primary-hover)); }

.btn-danger { background: var(--danger-soft); border-color: rgba(229, 72, 77, 0.4); color: #ff9a9d; }
.btn-danger:hover { background: rgba(229, 72, 77, 0.2); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; }
.btn-block { width: 100%; justify-content: center; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
}
.input, .select, textarea.input {
  width: 100%;
  height: 42px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input::placeholder { color: var(--text-dim); }
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.input-group { position: relative; }
.input-group .input { padding-left: 42px; }
.input-group > i {
  position: absolute;
  left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 14px;
}
.input-group .toggle-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  width: 32px; height: 32px; border-radius: 6px;
}
.input-group .toggle-eye:hover { color: var(--text); background: var(--surface-2); }
.field-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.field-error { font-size: 12px; color: #ff9a9d; margin-top: 6px; display: none; }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

/* ---------------- Cards / panels ---------------- */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent), var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-muted);
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: #7ee59a; background: var(--success-soft); border-color: rgba(52, 199, 89, 0.3); }
.badge-muted { color: var(--text-muted); }
.badge-danger { color: #ff9a9d; background: var(--danger-soft); border-color: rgba(229, 72, 77, 0.3); }
.badge-primary { color: #9bbcff; background: var(--primary-soft); border-color: var(--primary-ring); }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
  text-align: left; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim); padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.cell-strong { font-weight: 600; color: var(--text); }
.cell-sub { font-size: 12.5px; color: var(--text-dim); }
.row-actions { display: flex; gap: 6px; justify-content: center; }
td.actions-cell, th.actions-cell { text-align: center; width: 1%; white-space: nowrap; }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tab {
  background: none; border: none; cursor: pointer;
  padding: 12px 16px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }

/* ---------------- Switch ---------------- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 999px; transition: background 0.18s ease;
}
.switch .slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 50%; transform: translateY(-50%);
  background: #cdd6e6; border-radius: 50%; transition: transform 0.18s ease, background 0.18s ease;
}
.switch input:checked + .slider { background: var(--primary); border-color: var(--primary-strong); }
.switch input:checked + .slider::before { transform: translate(18px, -50%); background: #fff; }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* ---------------- Modal ---------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 8, 16, 0.66); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-width: 520px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); transform: translateY(8px) scale(0.99);
  transition: transform 0.18s ease; max-height: 92vh; display: flex; flex-direction: column;
}
.modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--primary); border-radius: var(--radius-sm);
  padding: 13px 15px; box-shadow: var(--shadow); font-size: 14px;
  animation: toastIn 0.25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast i { margin-top: 2px; }
.toast.success i { color: #7ee59a; }
.toast.error i { color: #ff9a9d; }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ---------------- Empty state (placeholder modul) ---------------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 70px 24px; color: var(--text-muted);
}
.empty .emoji-free-icon {
  width: 72px; height: 72px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: #9bbcff; font-size: 28px;
  border: 1px solid var(--primary-ring); margin-bottom: 18px;
}
.empty h2 { margin: 0 0 8px; color: var(--text); font-size: 20px; }
.empty p { margin: 0; max-width: 460px; font-size: 14.5px; }

/* ---------------- Utilities ---------------- */
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.flex { display: flex; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Page head with actions ---------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .ph-text h1 { margin: 0 0 6px; font-size: 23px; font-weight: 800; letter-spacing: -0.2px; }
.page-head .ph-text p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.page-head .ph-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- Toolbar (search + filters) ---------------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .input-group { flex: 1; min-width: 220px; }
.toolbar .count { display: none; }
/* Label hitungan "N item" di toolbar tabel disembunyikan di SEMUA tempat. */
[data-dt-count] { display: none !important; }

/* ---------------- Form grid ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; }
.form-grid .col-span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------------- User table avatar ---------------- */
.uavatar {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: #9bbcff; border: 1px solid var(--primary-ring);
  font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.user-cell { display: flex; align-items: center; gap: 11px; }

/* ---------------- Roles grid ---------------- */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.role-card { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.role-card .rc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.role-card .rc-name { font-weight: 700; font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
.role-card .rc-name i { color: #9bbcff; }
.role-card .rc-desc { font-size: 13px; color: var(--text-muted); min-height: 18px; flex: 1 1 auto; }
.role-card .rc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.role-card .rc-actions { display: flex; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 2px; }

/* ---------------- Permission matrix ---------------- */
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 14px; overflow: hidden; }
.perm-group > .pg-title { background: var(--surface-2); padding: 11px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.perm-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--border); }
.perm-row:first-of-type { border-top: none; }
.perm-row .pr-label { font-size: 14px; }
.perm-row .pr-key { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; font-family: ui-monospace, monospace; }

/* ---------------- Misc spacing ---------------- */
.stack-12 > * + * { margin-top: 12px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.center-load { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px; color: var(--text-muted); font-size: 14px; }
.lock-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.mb { margin-bottom: 16px; }

/* ---------------- Native <dialog> (server-rendered, tanpa JS modal) ---------------- */
dialog.modal {
  display: none;
  width: calc(100% - 36px);
  max-width: 520px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  max-height: 92vh;
  overflow: hidden;
  transform: none;
}
dialog.modal[open] {
  display: flex;
  flex-direction: column;
  animation: dlgIn 0.18s ease;
}
dialog.modal::backdrop {
  background: rgba(4, 8, 16, 0.66);
  backdrop-filter: blur(3px);
}
@keyframes dlgIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
dialog.modal .modal-body { max-height: 70vh; }

/* Toast keluar (fade-out) */
.toast.hide { opacity: 0; transform: translateX(16px); transition: opacity 0.5s ease, transform 0.5s ease; }

/* ============================================================
   Tambahan: utilitas, System Status, chip koneksi, popup error, tema terang
   ============================================================ */

/* ---- Utilitas (pengganti inline style demi kepatuhan CSP) ---- */
.inline-form { display: inline; }
.ml-8 { margin-left: 8px; }
.dropdown-item-btn { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; }

/* ---- Badge warning + LIVE dot ---- */
.badge-warning { color: #e3b341; background: var(--warning-soft); border-color: rgba(234, 179, 8, 0.3); }
.live-dot { animation: livePulse 1.4s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* ---- Chip status koneksi + waktu respons (header) ---- */
.conn-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 5px 11px; margin-right: 10px; white-space: nowrap;
}
.conn-chip .fa-bolt { color: var(--primary); font-size: 11px; }
.conn-chip .conn-sep { color: var(--text-dim); }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.conn-dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.conn-dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* ---- Metric colors ---- */
.mtr-ok { color: #2ecc71; font-weight: 700; }
.mtr-warn { color: #e3b341; font-weight: 700; }
.mtr-bad { color: var(--danger); font-weight: 700; }

/* ---- System Status: kartu ringkas ---- */
.stat-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 22px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sc-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.sc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sc-dot-ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.sc-dot-bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.sc-value { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.1; }
.sc-value.value-bad { color: var(--danger); }
.sc-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ---- System Status: grid kartu besar ---- */
.ss-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.ss-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ss-card-head h3 { margin: 0; font-size: 15.5px; display: inline-flex; align-items: center; gap: 9px; }
.ss-card-head h3 i { color: var(--primary); }

/* ---- Metric + progress ---- */
.metric { margin-bottom: 18px; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.metric-sub { font-size: 12px; margin-top: 6px; }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.3s ease; }
.progress-bar.pb-ok { background: var(--success); }
.progress-bar.pb-warn { background: var(--warning); }
.progress-bar.pb-bad { background: var(--danger); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.kv-label { font-size: 12px; color: var(--text-dim); margin-bottom: 3px; }
.kv-val { font-size: 14px; font-weight: 700; }

/* ---- Endpoint code in tables ---- */
code.ep, .log-msg code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
code.ep { color: var(--text-muted); }

/* ---- Segmented filter ---- */
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.seg-btn {
  font-size: 12.5px; font-weight: 600; color: var(--text-muted); font-family: inherit;
  background: none; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.seg-btn:hover { color: var(--text); border-color: var(--primary-ring); }
.seg-btn.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.seg-count { font-size: 11px; background: rgba(255,255,255,0.18); border-radius: 999px; padding: 0 6px; }
.seg-btn:not(.active) .seg-count { background: var(--surface-3); color: var(--text-muted); }

/* ---- Log list ---- */
.log-list { max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; }
.log-row {
  display: grid; grid-template-columns: 200px 64px 1fr; gap: 12px; align-items: start;
  padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.log-row:last-child { border-bottom: none; }
.log-time { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; color: var(--text-dim); }
.log-actor { display: block; color: var(--text-muted); font-family: var(--font); margin-top: 2px; }
.log-lvl { justify-self: start; }
.log-msg { color: var(--text); word-break: break-word; }

/* ---- Popup error (overlay) ---- */
.error-overlay {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(4, 8, 16, 0.72); backdrop-filter: blur(4px);
}
.error-pop { width: 100%; max-width: 460px; padding: 30px 28px; text-align: center; }
.error-pop-icon {
  width: 66px; height: 66px; border-radius: 18px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--danger-soft); color: var(--danger); font-size: 28px;
}
.error-pop h2 { margin: 0 0 8px; font-size: 20px; }
.error-pop-msg { color: var(--text-muted); margin: 0 0 14px; font-size: 14.5px; }
.error-pop-ref {
  font-size: 13px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 12px; display: inline-block; margin-bottom: 12px;
}
.error-pop-ref strong { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; }
.error-pop-note { font-size: 12.5px; margin: 0 0 20px; }
.error-pop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---- Responsif ---- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .ss-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .log-row { grid-template-columns: 1fr; gap: 4px; }
  .conn-chip { display: none; }
}

/* ============================================================
   TEMA TERANG (data-theme="light")
   ============================================================ */
html[data-theme="light"] {
  --bg: #eef2f7;
  --bg-grad-top: #f5f8fc;
  --bg-grad-bottom: #e8eef6;
  --sidebar-top: #ffffff;
  --sidebar-bottom: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #e9eef6;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-muted: #5a6b86;
  --text-dim: #8593a8;
  --shadow: 0 20px 50px -28px rgba(15, 23, 42, 0.28);
  --shadow-sm: 0 8px 22px -16px rgba(15, 23, 42, 0.25);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(47, 107, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
}
/* Kontras teks badge/metric pada latar terang */
html[data-theme="light"] .badge-success { color: #15803d; }
html[data-theme="light"] .badge-danger { color: #b42318; }
html[data-theme="light"] .badge-warning { color: #92610a; }
html[data-theme="light"] .badge-primary { color: #1d4ed8; }
html[data-theme="light"] .mtr-ok { color: #15803d; }
html[data-theme="light"] .mtr-warn { color: #b45309; }
html[data-theme="light"] .dropdown-item.danger:hover { color: #b42318; }
/* Hover putih-pada-putih dibuat gelap tipis */
html[data-theme="light"] .nav-item:hover { background: rgba(15, 23, 42, 0.05); }
html[data-theme="light"] table.data tbody tr:hover { background: rgba(15, 23, 42, 0.03); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.16); }
html[data-theme="light"] .seg-count { background: rgba(255,255,255,0.28); }
html[data-theme="light"] .seg-btn:not(.active) .seg-count { background: var(--surface-3); }

/* Lebar progress bar (kelipatan 5) — pengganti inline style */
.progress-bar.pw-0 { width: 0%; }
.progress-bar.pw-5 { width: 5%; }
.progress-bar.pw-10 { width: 10%; }
.progress-bar.pw-15 { width: 15%; }
.progress-bar.pw-20 { width: 20%; }
.progress-bar.pw-25 { width: 25%; }
.progress-bar.pw-30 { width: 30%; }
.progress-bar.pw-35 { width: 35%; }
.progress-bar.pw-40 { width: 40%; }
.progress-bar.pw-45 { width: 45%; }
.progress-bar.pw-50 { width: 50%; }
.progress-bar.pw-55 { width: 55%; }
.progress-bar.pw-60 { width: 60%; }
.progress-bar.pw-65 { width: 65%; }
.progress-bar.pw-70 { width: 70%; }
.progress-bar.pw-75 { width: 75%; }
.progress-bar.pw-80 { width: 80%; }
.progress-bar.pw-85 { width: 85%; }
.progress-bar.pw-90 { width: 90%; }
.progress-bar.pw-95 { width: 95%; }
.progress-bar.pw-100 { width: 100%; }

/* ============================================================
   UI POLISH v2 — animasi, micro-interaction, tema terang biru
   ============================================================ */

/* ---- Transisi mulus saat ganti tema ---- */
body, .card, .stat-card, .topbar, .sidebar, .nav-item, .dropdown, .usermenu-trigger,
.conn-chip, .seg-btn, .perm-group, .perm-row, .progress, .input, .badge, table.data td, table.data th {
  transition: background-color .35s ease, color .25s ease, border-color .35s ease, box-shadow .25s ease;
}

/* ---- Entrance halaman ---- */
.content { animation: pageIn .42s cubic-bezier(.2,.7,.2,1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- Kartu ringkas: masuk bertahap + hover angkat ---- */
.stat-card { animation: cardIn .5s cubic-bezier(.2,.7,.2,1) backwards;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .35s ease; }
.stat-card:nth-child(1){animation-delay:.02s}.stat-card:nth-child(2){animation-delay:.06s}
.stat-card:nth-child(3){animation-delay:.10s}.stat-card:nth-child(4){animation-delay:.14s}
.stat-card:nth-child(5){animation-delay:.18s}.stat-card:nth-child(6){animation-delay:.22s}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--primary-ring); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---- Kartu besar System Status: hover lembut ---- */
.ss-grid > .card { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .35s ease; }
.ss-grid > .card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary-ring); }

/* ---- Tombol: tekan + sorot ---- */
.btn { transition: transform .12s ease, background .16s ease, border-color .16s ease, box-shadow .18s ease, color .16s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary:hover { box-shadow: 0 12px 26px -12px var(--primary-ring); }

/* ---- Progress bar: kilau bergerak ---- */
.progress-bar { position: relative; overflow: hidden; }
.progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
  transform: translateX(-100%); animation: shimmer 2.2s ease-in-out infinite;
}
@keyframes shimmer { 60%, 100% { transform: translateX(100%); } }

/* ---- Chip koneksi: dot online berdenyut ---- */
.conn-dot.on { animation: connPulse 2s ease-in-out infinite; }
@keyframes connPulse { 0%,100% { box-shadow: 0 0 0 3px var(--success-soft); } 50% { box-shadow: 0 0 0 5px rgba(52,199,89,.10); } }

/* ---- Tombol tema: ikon berputar saat disorot ---- */
[data-theme-icon] { transition: transform .45s cubic-bezier(.4,1.4,.4,1); display: inline-block; }
[data-theme-toggle]:hover [data-theme-icon] { transform: rotate(-25deg) scale(1.1); }

/* ---- Dropdown item: ikon ber-aksen saat sorot ---- */
.dropdown-item i { transition: color .14s ease, transform .14s ease; }
.dropdown-item:hover i { color: var(--primary); transform: translateX(2px); }
.dropdown-item.danger:hover i { color: inherit; }

/* ---- Modal hak akses: lebih rapi ---- */
.perm-group { background: var(--surface); box-shadow: var(--shadow-sm); }
.perm-group > .pr-label {
  background: var(--surface-2); padding: 12px 16px; margin: 0;
  font-size: 12.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text); border-bottom: 1px solid var(--border);
}
.perm-row { cursor: pointer; gap: 12px; }
.perm-row:hover { background: var(--surface-2); }
.perm-row input[type="checkbox"] {
  width: 18px; height: 18px; flex: none; cursor: pointer;
  accent-color: var(--primary); border-radius: 5px;
}
.perm-row .pr-key { color: var(--text-muted); font-size: 13px; transition: color .14s ease; }
.perm-row:has(input:checked) { background: var(--primary-soft); }
.perm-row:has(input:checked) .pr-key { color: var(--text); font-weight: 600; }

/* ---- Aksesibilitas: hormati prefers-reduced-motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- Responsif tambahan ---- */
@media (max-width: 920px) {
  .stat-card { padding: 14px 15px; }
  .sc-value { font-size: 23px; }
  .ss-card-head h3 { font-size: 14.5px; }
}
@media (max-width: 520px) {
  .content { padding: 16px 12px; }
  .stat-grid { gap: 12px; }
  .page-head h1 { font-size: 20px; }
  .error-pop { padding: 24px 20px; }
}

/* ============================================================
   TEMA TERANG v2 — biru (muda -> tua), bukan abu-abu
   (menimpa definisi tema terang sebelumnya)
   ============================================================ */
html[data-theme="light"] {
  --bg: #e8f0fc;
  --bg-grad-top: #eff5fe;
  --bg-grad-bottom: #d8e6f9;
  --surface: #ffffff;
  --surface-2: #eef4fd;
  --surface-3: #ddeafb;
  --border: rgba(37, 99, 235, 0.13);
  --border-strong: rgba(37, 99, 235, 0.22);
  --text: #102745;
  --text-muted: #41577c;
  --text-dim: #6a7fa3;
  --primary-soft: rgba(47, 107, 255, 0.12);
  --shadow: 0 22px 54px -28px rgba(30, 58, 138, 0.34);
  --shadow-sm: 0 10px 26px -16px rgba(30, 58, 138, 0.26);
}
html[data-theme="light"] body {
  background:
    radial-gradient(1150px 720px at 80% -10%, rgba(47, 107, 255, 0.13), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
}
/* Topbar: kaca biru terang */
html[data-theme="light"] .topbar { background: rgba(239, 245, 254, 0.82); border-bottom-color: rgba(37, 99, 235, 0.16); }
/* Sidebar: gradien biru muda -> tua dengan teks terang */
html[data-theme="light"] .sidebar { background: linear-gradient(180deg, #4380ff 0%, #2563eb 48%, #1e3a8a 100%); border-right-color: rgba(255, 255, 255, 0.10); }
html[data-theme="light"] .brand { border-bottom-color: rgba(255, 255, 255, 0.18); }
html[data-theme="light"] .sidebar .brand-logo { background: #fff; color: var(--primary); box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.35); }
html[data-theme="light"] .brand-text .name { color: #fff; }
html[data-theme="light"] .brand-text .by { color: rgba(255, 255, 255, 0.74); }
html[data-theme="light"] .nav-group-title { color: rgba(255, 255, 255, 0.64); }
html[data-theme="light"] .nav-item { color: rgba(255, 255, 255, 0.88); }
html[data-theme="light"] .nav-item i { color: rgba(255, 255, 255, 0.66); }
html[data-theme="light"] .nav-item:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
html[data-theme="light"] .nav-item:hover i { color: #fff; }
html[data-theme="light"] .nav-item.active { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.3); color: #fff; box-shadow: 0 8px 18px -12px rgba(0, 0, 0, 0.45); }
html[data-theme="light"] .nav-item.active i { color: #fff; }
html[data-theme="light"] .sidebar ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.3); }
/* Permukaan & elemen */
html[data-theme="light"] .card { background: linear-gradient(180deg, rgba(47, 107, 255, 0.035), transparent), var(--surface); }
html[data-theme="light"] .usermenu-trigger { background: #fff; }
html[data-theme="light"] .usermenu-trigger:hover { background: var(--surface-2); }
html[data-theme="light"] .conn-chip { background: rgba(255, 255, 255, 0.6); }
html[data-theme="light"] .topbar .btn-ghost { background: rgba(255, 255, 255, 0.5); }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(37, 99, 235, 0.22); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(37, 99, 235, 0.34); }
/* Kontras teks status pada latar terang */
html[data-theme="light"] .badge-success { color: #15803d; }
html[data-theme="light"] .badge-danger { color: #b42318; }
html[data-theme="light"] .badge-warning { color: #92610a; }
html[data-theme="light"] .badge-primary { color: #1d4ed8; }
html[data-theme="light"] .mtr-ok { color: #15803d; }
html[data-theme="light"] .mtr-warn { color: #b45309; }
html[data-theme="light"] table.data tbody tr:hover { background: rgba(37, 99, 235, 0.05); }
html[data-theme="light"] .dropdown-item.danger:hover { color: #b42318; }

/* ---- Util & modal konfirmasi ---- */
.hidden { display: none !important; }
.modal.modal-sm { max-width: 420px; }
.modal-head h3 i { color: var(--primary); margin-right: 2px; }
.confirm-msg { margin: 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.55; }

/* ============================================================
   REDESIGN v3 — tampilan modern (gaya React/Tailwind), animatif
   Memakai variabel tema sehingga konsisten di mode gelap & terang.
   ============================================================ */

/* ---- Latar: mesh-gradient halus ---- */
html[data-theme="dark"] body {
  background:
    radial-gradient(900px 600px at 88% -12%, rgba(47, 107, 255, 0.16), transparent 60%),
    radial-gradient(820px 560px at -8% 108%, rgba(124, 92, 255, 0.12), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
  background-attachment: fixed;
}
html[data-theme="light"] body {
  background:
    radial-gradient(980px 640px at 86% -12%, rgba(47, 107, 255, 0.16), transparent 60%),
    radial-gradient(820px 560px at -8% 110%, rgba(124, 92, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg-grad-top), var(--bg-grad-bottom));
  background-attachment: fixed;
}

/* ---- Tipografi lebih tegas ---- */
.page-head .ph-text h1, .page-header h1 { letter-spacing: -0.5px; font-weight: 800; }
.card h3, .ss-card-head h3, .modal-head h3 { letter-spacing: -0.2px; }

/* ---- Tombol modern: gradien, angkat, fokus jelas ---- */
.btn { border-radius: 12px; transition: background .18s var(--ease), border-color .18s var(--ease), transform .14s var(--ease), box-shadow .22s var(--ease), filter .18s var(--ease); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-strong));
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 24px -12px var(--primary-ring);
}
.btn-primary:hover { background: linear-gradient(135deg, #5a8bff, var(--primary)); transform: translateY(-1.5px); box-shadow: 0 16px 30px -12px var(--primary-ring); filter: saturate(1.05); }
.btn-danger { background: linear-gradient(135deg, #f0575b, var(--danger)); border-color: rgba(229, 72, 77, 0.45); color: #fff; box-shadow: 0 10px 24px -14px rgba(229, 72, 77, 0.7); }
.btn-danger:hover { transform: translateY(-1.5px); box-shadow: 0 16px 30px -14px rgba(229, 72, 77, 0.75); filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.btn-icon { border-radius: 11px; }

/* ---- Input modern ---- */
.input, .select, textarea.input { border-radius: 12px; height: 44px; background: var(--surface-2); transition: border-color .16s var(--ease), box-shadow .2s var(--ease), background .16s var(--ease); }
textarea.input { height: auto; }
.input:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); background: var(--surface); }
html[data-theme="light"] .input, html[data-theme="light"] .select, html[data-theme="light"] textarea.input { background: #fff; }

/* ---- Kartu: sudut lebih lembut, kilau tepi, hover ---- */
.card { border-radius: var(--radius-lg); position: relative; }
.card-pad { padding: 24px; }
.ss-grid > .card, .stat-card { border-radius: var(--radius-lg); }

/* ---- Sidebar modern: brand gradien + item ber-ikon ---- */
.brand-logo { background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: 0 12px 26px -10px rgba(124, 92, 255, 0.5); }
html[data-theme="light"] .sidebar .brand-logo { background: #fff; color: var(--primary); }
.nav-item { border-radius: 12px; }
.nav-item i { transition: transform .16s var(--ease), color .16s var(--ease); }
.nav-item:hover i { transform: translateX(1px) scale(1.05); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(47, 107, 255, 0.26), rgba(124, 92, 255, 0.14));
  border-color: var(--primary-ring);
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.12), 0 10px 22px -16px var(--primary-ring);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--accent));
}
.nav-item { position: relative; }

/* ---- Topbar: kaca + bayangan tipis ---- */
.topbar { backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--border); }

/* ---- Tabel modern ---- */
.table-wrap { border: 1px solid var(--border); background: var(--surface); }
table.data thead th { background: var(--surface-2); }
table.data tbody tr { transition: background .14s var(--ease); }

/* ---- Badge modern ---- */
.badge { border-radius: 999px; backdrop-filter: blur(2px); }

/* ---- Modal & dialog: sudut + masuk halus ---- */
.modal, dialog.modal { border-radius: var(--radius-lg); }
.modal-backdrop, dialog.modal::backdrop { backdrop-filter: blur(6px); }

/* ---- Toast modern ---- */
.toast { border-radius: 14px; box-shadow: var(--shadow); }

/* ---- Usermenu trigger & dropdown ---- */
.usermenu-trigger { border-radius: 999px; transition: background .16s var(--ease), border-color .16s var(--ease), transform .14s var(--ease); }
.usermenu-trigger:hover { transform: translateY(-1px); }
.dropdown { border-radius: 16px; }

/* ---- Chip koneksi & segmented modern ---- */
.conn-chip { border-radius: 999px; }
.seg-btn { border-radius: 999px; transition: all .16s var(--ease); }
.seg-btn:hover { transform: translateY(-1px); }

/* ---- Scrollbar lebih ramping ---- */
::-webkit-scrollbar { width: 9px; height: 9px; }

/* ---- Garis pemisah & detail kartu System Status ---- */
.stat-card { backdrop-filter: blur(2px); }
.progress { height: 9px; }

/* ---- Fokus aksesibel global ---- */
a:focus-visible, button:focus-visible, .nav-item:focus-visible, .seg-btn:focus-visible {
  outline: 2px solid var(--primary-ring); outline-offset: 2px; border-radius: 10px;
}

/* ---- Tambahan: profil, UI management, badge role, anti-geser tabel ---- */
.input-num { width: 88px; text-align: center; padding: 0 8px; }
.mb-12 { margin-bottom: 12px; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.reset-illus {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary); font-size: 26px;
}

/* Badge warna role */
.badge.role-dev { color: #b794ff; background: rgba(124, 92, 255, 0.16); border-color: rgba(124, 92, 255, 0.38); }
.badge.role-admin { color: #9bbcff; background: var(--primary-soft); border-color: var(--primary-ring); }
html[data-theme="light"] .badge.role-dev { color: #6d28d9; }
html[data-theme="light"] .badge.role-admin { color: #1d4ed8; }

/* Anti-"geser" saat tabel & log diperbarui live */
.ss-grid table.data { table-layout: fixed; }
.ss-grid table.data th, .ss-grid table.data td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-grid table.data .log-msg, .ss-grid table.data td.cell-strong { white-space: normal; }
.log-list { scrollbar-gutter: stable; }
code.ep { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; max-width: 100%; vertical-align: bottom; }

/* ---- UI Management: editor ikon ---- */
.icon-edit { display: flex; align-items: center; gap: 8px; }
.input-icon { max-width: 170px; }

/* ---- Slider Hue (UI Management) ---- */
.hue-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 12px; border-radius: 999px; outline: none; cursor: pointer;
  border: 1px solid var(--border);
  background: linear-gradient(to right,
    hsl(0 90% 55%), hsl(60 90% 55%), hsl(120 90% 55%), hsl(180 90% 55%),
    hsl(240 90% 55%), hsl(300 90% 55%), hsl(360 90% 55%));
  margin-top: 6px;
}
.hue-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35); cursor: pointer;
}
.hue-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--primary-strong); cursor: pointer;
}
.hue-range:focus-visible { box-shadow: 0 0 0 3px var(--primary-ring); }
[data-hue-val] { font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; }

/* ---- Simulasi sidebar (UI Management): drag, edit, reset ---- */
.sb-sim { display: flex; flex-direction: column; gap: 14px; }
.sb-section { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 12px; }
.sb-section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text-muted); }
.sb-section-head > .fa-folder { color: var(--primary); }
.sb-title { font-weight: 700; }
.sb-list {
  display: flex; flex-direction: column; gap: 8px;
  min-height: 46px; padding: 8px; border-radius: var(--radius-sm);
  border: 1px dashed var(--border-strong); background: var(--surface);
}
.sb-list.is-empty { align-items: center; justify-content: center; }
.sb-list.is-empty::after {
  content: "Seret menu ke sini"; color: var(--text-dim); font-size: 13px; padding: 8px 0;
}
.sb-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.sb-item:hover { border-color: var(--primary-ring); box-shadow: var(--shadow-sm); }
.sb-item.dragging { opacity: 0.45; border-style: dashed; }
.sb-grip { cursor: grab; color: var(--text-dim); padding: 2px 4px; touch-action: none; }
.sb-grip:active { cursor: grabbing; }
.sb-ico {
  width: 32px; height: 32px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--primary-soft); color: var(--primary); border: 1px solid var(--primary-ring);
}
.sb-name { font-weight: 600; color: var(--text); }
.sb-spacer { flex: 1 1 auto; min-width: 8px; }
.sb-lock { color: var(--text-dim); font-size: 12px; }
.sb-edit {
  flex-basis: 100%; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--border);
}
@media (max-width: 560px) { .sb-edit { grid-template-columns: 1fr; } }

/* ============================================================
   PUSAT NOTIFIKASI
   ============================================================ */
.notifmenu { position: relative; }
.notif-trigger { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; line-height: 1; color: #fff;
  background: var(--danger, #ef4444); border-radius: 999px; border: 2px solid var(--surface);
}
.notif-dropdown { width: 360px; max-width: calc(100vw - 28px); padding: 0; overflow: hidden; }
.notif-list { max-height: 380px; overflow-y: auto; scrollbar-gutter: stable; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.notif-list-full { max-height: 60vh; }
.notif-empty { padding: 22px 12px; text-align: center; color: var(--text-dim); font-size: 13px; }
.notif-more { border-top: 1px solid var(--border); justify-content: center; font-weight: 600; }

/* Kartu notifikasi */
.notif-item, .notif-row {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
}
.notif-row { background: var(--surface); }
.notif-ico {
  width: 30px; height: 30px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
  background: var(--primary-soft); border: 1px solid var(--border);
}
.notif-main { flex: 1 1 auto; min-width: 0; }
.notif-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 3px; }
.notif-from { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.notif-time { font-size: 11px; color: var(--text-dim); margin-left: auto; }
.notif-title { font-weight: 700; font-size: 13px; color: var(--text); word-break: break-word; }
.notif-body { font-size: 12px; color: var(--text-muted); margin-top: 2px; word-break: break-word; }

/* Notifikasi prioritas (alert/warning): cukup outline biru warna UI (tidak mencolok) */
.notif-pinned { border-color: var(--primary); }
.notif-row.notif-pinned { border-color: var(--primary); }
/* Notifikasi biasa & dari Developer: tanpa outline khusus */
.notif-from.is-dev { color: var(--primary); }

/* Notifikasi pinned (alert/warning) penanda samping */

/* Tab kelola notifikasi */
.ss-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .ss-grid-2 { grid-template-columns: 1fr; } }
.notif-manage { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; scrollbar-gutter: stable; }
.notif-row > .inline-form { margin-left: auto; }
.textarea { resize: vertical; min-height: 90px; padding: 10px 12px; line-height: 1.5; font-family: inherit; }

/* ---- Popup notifikasi (pojok kanan atas, auto-clear 5 detik) ---- */
.notif-pop-wrap {
  position: fixed; top: 16px; right: 16px; z-index: 80;
  width: 360px; max-width: calc(100vw - 32px);
  animation: notifPopIn 0.28s ease both;
}
.notif-pop-wrap .notif-item { box-shadow: var(--shadow); cursor: pointer; }
.notif-pop-wrap.hide { animation: notifPopOut 0.28s ease forwards; }
@keyframes notifPopIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes notifPopOut { to { opacity: 0; transform: translateX(24px); } }
@media (prefers-reduced-motion: reduce) {
  .notif-pop-wrap, .notif-pop-wrap.hide { animation: none; }
}

/* ---- Popup notifikasi: tampil di BAWAH header ---- */
.notif-pop-wrap { top: calc(var(--topbar-h) + 12px); right: 16px; }

/* ---- Header chip: status sinkronisasi ---- */
.conn-chip { position: relative; }
.conn-dot.sync { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.conn-dot.warn { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.conn-chip[data-state="failed"] [data-conn-label],
.conn-chip[data-state="failed"] [data-conn-icon] { color: var(--danger); }
.conn-chip[data-state="offline"] [data-conn-label] { color: var(--text-dim); }
.conn-bubble {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  max-width: 320px; padding: 8px 12px; font-size: 12px; line-height: 1.45;
  color: var(--text); background: var(--surface); border: 1px solid var(--danger);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); white-space: normal;
}

/* ---- Live Requests feed ---- */
.req-stage { font-variant-numeric: tabular-nums; }
.req-live { animation: reqIn 0.25s ease both; }
.req-out { opacity: 0; transition: opacity 0.3s ease; }
@keyframes reqIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .req-live { animation: none; } }

/* ---- System Logs: tampilkan response time di samping level ---- */
.log-row { grid-template-columns: 200px auto 1fr; }
.log-meta { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.log-ms { font-size: 11px; color: var(--text-dim); }
@media (max-width: 520px) { .log-row { grid-template-columns: 1fr; } }

/* ---- System Status: baris 3 kolom (Server Load · External · Active Users) ---- */
.ss-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1100px) { .ss-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .ss-grid-3 { grid-template-columns: 1fr; } }

/* ===== Master Data: tabel data (search realtime + pagination) ===== */
.dt-search { margin-bottom: 12px; }
.dt-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.dt-size { width: auto; min-width: 76px; height: 38px; padding: 6px 12px; }
.dt-info { font-size: 12.5px; color: var(--text-dim); }
.dt-hide { display: none !important; }
.dt-empty { padding: 28px 16px; text-align: center; color: var(--text-dim); font-size: 14px; }
.seg-toggle { margin-bottom: 0; }

/* ===== Halaman Offline (server KDP merah + kabel putus di tanda seru) ===== */
.off-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 22px; }
.off-illu { width: 100%; max-width: 500px; margin: 0 auto 4px; }
.off-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* Server normal (biru) */
.off-rack { fill: rgba(20, 30, 52, 0.92); stroke: var(--primary); stroke-width: 3; }
.off-rack-head { fill: rgba(47, 107, 255, 0.18); stroke: var(--primary); stroke-width: 3; }
.off-slot { fill: none; stroke: rgba(155, 188, 255, 0.5); stroke-width: 2; }
.off-base { fill: rgba(47, 107, 255, 0.35); }
.off-led { fill: var(--success); animation: offLed 1.5s steps(1, end) infinite; }

/* Server KDP (merah = offline) */
.off-rack-red { fill: rgba(60, 22, 26, 0.92); stroke: var(--danger); stroke-width: 3; }
.off-rack-red-head { fill: rgba(229, 72, 77, 0.2); stroke: var(--danger); stroke-width: 3; }
.off-base-red { fill: rgba(229, 72, 77, 0.4); }
.off-led-red { fill: var(--danger); animation: offLedRed 1s steps(1, end) infinite; }
.off-badge-bg { fill: #ffffff; }
.off-tag-red { fill: var(--danger); }
.off-tag-text { fill: #fff; font-family: var(--font); font-size: 11px; font-weight: 800; letter-spacing: 0.12em; }

.d2 { animation-delay: 0.33s; }
.d3 { animation-delay: 0.66s; }

/* Kabel putus-putus yang mentok di tengah */
.off-dash { stroke: rgba(155, 188, 255, 0.55); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 12; }
.dash-l { animation: offDashL 0.9s linear infinite; }
.dash-r { animation: offDashR 0.9s linear infinite; }

/* Tanda seru di tengah */
.off-excl { fill: var(--danger); }
.off-excl-mark { fill: #fff; font-family: var(--font); font-size: 32px; font-weight: 800; }
.off-excl-ring { fill: none; stroke: var(--danger); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; animation: offExclRing 1.6s ease-out infinite; }

@keyframes offLed { 0%, 100% { opacity: 1; } 50% { opacity: 0.18; } }
@keyframes offLedRed { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes offDashL { to { stroke-dashoffset: -14; } }
@keyframes offDashR { to { stroke-dashoffset: 14; } }
@keyframes offExclRing { 0% { transform: scale(0.7); opacity: 0.6; } 100% { transform: scale(1.5); opacity: 0; } }

/* Branding */
.off-brand { display: flex; align-items: baseline; gap: 9px; margin: 8px 0 14px; }
.off-brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.4px; color: var(--text); }
.off-brand-by { font-size: 10px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }

.off-title { font-size: 25px; margin: 0; color: var(--text); }
.off-sub { color: var(--text-muted); max-width: 440px; margin: 9px 0 15px; font-size: 14.5px; line-height: 1.55; }
.off-retry { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.off-retry .off-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim); display: inline-block; animation: offDot 1.2s ease-in-out infinite; }
.off-retry .off-dot:nth-child(2) { animation-delay: 0.2s; }
.off-retry .off-dot:nth-child(3) { animation-delay: 0.4s; }
.off-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.off-btn { min-width: 168px; justify-content: center; }
.off-note { margin: 14px 0 0; font-size: 12px; color: var(--text-dim); }
@keyframes offDot { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .off-led, .off-led-red, .off-dash, .off-excl-ring, .off-retry .off-dot { animation: none; }
  .off-excl-ring { opacity: 0.2; }
}
@media (max-width: 480px) {
  .off-title { font-size: 21px; }
  .off-btn { min-width: 140px; flex: 1 1 auto; }
}

/* ===== Stok / Inventaris ===== */
.num-cell { text-align: right; white-space: nowrap; }
.stock-amount { font-variant-numeric: tabular-nums; font-weight: 700; }
.stock-pos { color: var(--success); }
.stock-neg { color: var(--danger); }
.stock-zero { color: var(--text-dim); }

/* ===== Stok: kartu KPI sejajar header ===== */
.ph-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; min-width: 124px; box-shadow: var(--shadow-sm); }
.kpi-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.kpi-label i { color: var(--primary); }
.kpi-value { font-size: 21px; font-weight: 800; letter-spacing: -0.3px; margin-top: 3px; line-height: 1.15; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi-value.kpi-pos { color: var(--success); }
.kpi-value.kpi-neg { color: var(--danger); }
.kpi-unit { font-size: 12px; font-weight: 600; color: var(--text-muted); }
@media (max-width: 720px) {
  .ph-stats { width: 100%; }
  .kpi { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* ===== Alur Operasional: timeline / stepper ===== */
.op-flow-card { margin-bottom: 18px; padding: 6px 20px; }
.op-flow { display: flex; align-items: flex-start; gap: 0; overflow-x: auto; padding: 16px 12px 8px; }
.op-step { display: flex; flex-direction: column; align-items: center; gap: 0; text-decoration: none; min-width: 104px; flex: 0 0 auto; padding: 0 4px; border-radius: var(--radius); transition: transform .22s cubic-bezier(.2,.7,.2,1); -webkit-tap-highlight-color: transparent; }
.op-step:hover { transform: translateY(-4px); }
.op-node { position: relative; width: 58px; height: 58px; margin-bottom: 9px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; border: 2px solid var(--border); background: var(--surface); color: var(--text-dim); box-shadow: var(--shadow-sm); transition: transform .28s cubic-bezier(.2,.7,.2,1), box-shadow .28s ease, background-color .28s ease, color .28s ease, border-color .28s ease; }
.op-node > i { transition: opacity .18s ease; }
.op-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .18s ease; pointer-events: none; }
.op-step:hover .op-node > i { opacity: 0; }
.op-step:hover .op-count { opacity: 1; }
.op-step:not(.op-active):hover .op-node { border-color: var(--primary); color: var(--primary); }
.op-label { font-size: 13.5px; font-weight: 700; color: var(--text-muted); letter-spacing: -.2px; text-align: center; transition: color .25s ease; }
.op-sub { font-size: 11px; color: var(--text-dim); text-align: center; margin-top: 1px; }
.op-line { flex: 1 1 28px; min-width: 28px; height: 4px; margin-top: 27px; border-radius: 4px; background: var(--border); transition: background-color .35s ease; }
.op-line-done { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.op-done .op-node { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.op-done .op-label { color: var(--text); }
.op-active .op-node { background: linear-gradient(135deg, var(--primary), var(--accent)); border-color: transparent; color: #fff; transform: scale(1.1); animation: opPulse 2.4s ease-in-out infinite; }
.op-active .op-label { color: var(--primary); font-weight: 800; }
.op-active .op-sub { color: var(--text-muted); }
@keyframes opPulse { 0%,100% { box-shadow: 0 10px 24px var(--primary-ring), 0 0 0 4px var(--primary-ring); } 50% { box-shadow: 0 12px 28px var(--primary-ring), 0 0 0 9px transparent; } }
.op-panel { animation: pageIn .4s cubic-bezier(.2,.7,.2,1); }
@media (prefers-reduced-motion: reduce) { .op-active .op-node { animation: none; } .op-step, .op-step:hover { transition: none; transform: none; } }
@media (max-width: 720px) { .op-flow-card { padding: 6px 12px; } .op-flow { padding: 14px 10px 8px; } .op-step { min-width: 88px; } .op-node { width: 50px; height: 50px; font-size: 18px; margin-bottom: 8px; } .op-count { font-size: 16px; } .op-line { margin-top: 23px; min-width: 18px; } .op-label { font-size: 12.5px; } }

/* ===== Tombol sukses (hijau) ===== */
.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover { filter: brightness(.95); }
.btn-success:disabled { opacity: .6; cursor: not-allowed; }

/* ===== Penerimaan: modal 2 kolom ===== */
.modal.modal-wide { max-width: 1040px; width: calc(100% - 28px); }
.rcv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.rcv-col { display: flex; flex-direction: column; gap: 12px; }
.rcv-col-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; margin-bottom: 2px; }
.rcv-col-ic { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.rcv-col-ic.dark { background: var(--text); color: var(--surface); }
.rcv-col-items { border-left: 1px solid var(--border); padding-left: 22px; }
.rcv-items-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.rcv-items-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.rcv-count { color: var(--text-muted); font-weight: 700; }
.rcv-total { padding: 10px 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--primary-soft); color: var(--primary); font-weight: 800; font-variant-numeric: tabular-nums; }

/* daftar item (kanan) */
.ri-items { display: flex; flex-direction: column; gap: 8px; }
.ri-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.ri-item-main { flex: 1; min-width: 0; }
.ri-item-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.ri-item-qty { font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ri-empty { text-align: center; padding: 30px 16px; border: 1.5px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.ri-empty[hidden] { display: none; }
.ri-empty-ic { font-size: 26px; opacity: .5; margin-bottom: 8px; }
.ri-empty p { margin: 0 0 2px; font-weight: 600; }
.ri-empty span { font-size: 12px; color: var(--text-dim); }

/* detail (lihat) */
.rcv-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.rcv-meta > div { display: flex; flex-direction: column; gap: 2px; }
.rcv-meta .dim { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.rcv-note { margin: 0; padding: 10px 12px; background: var(--primary-soft); border-radius: var(--radius); font-size: 13px; color: var(--text-muted); }
table.data tfoot th { border-top: 2px solid var(--border); font-weight: 800; }

/* ===== Combobox smart-search ===== */
.combo { position: relative; }
.combo.has-error .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft, rgba(229,72,77,.18)); }
.combo-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); max-height: 240px; overflow-y: auto; padding: 4px; }
.combo-menu[hidden] { display: none; }
.combo-opt, .combo-add { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.combo-opt:hover { background: var(--primary-soft); }
.combo-add { color: var(--primary); font-weight: 700; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 2px; }
.combo-add:hover { background: var(--primary-soft); }
.combo-add.loading { opacity: .6; pointer-events: none; }
.combo-empty { padding: 9px 10px; color: var(--text-dim); font-size: 13px; }
.input.has-error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft, rgba(229,72,77,.18)); }

@media (max-width: 720px) {
  .rcv-grid { grid-template-columns: 1fr; gap: 16px; }
  .rcv-col-items { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 16px; }
  .rcv-meta { grid-template-columns: 1fr; }
}

/* ===== Penerimaan: font lebih besar di modal ===== */
.modal-rcv .modal-head h3 { font-size: 19px; }
.modal-rcv .field > label { font-size: 14.5px; font-weight: 600; }
.modal-rcv .input, .modal-rcv .select, .modal-rcv .textarea,
.modal-rcv .combo-input, .modal-rcv [data-combo-input] { font-size: 15.5px; }
.modal-rcv .field-hint { font-size: 13px; }
.modal-rcv .combo-opt, .modal-rcv .combo-add, .modal-rcv .combo-empty { font-size: 15px; }
.modal-rcv .btn { font-size: 14.5px; }
.modal-rcv .rcv-col-head, .modal-rcv .rcv-items-title { font-size: 15.5px; }
.modal-rcv .ri-item-name { font-size: 15px; }
.modal-rcv .ri-item-qty { font-size: 14px; }
.modal-rcv .badge { font-size: 12.5px; }

/* ===== Ringkasan Jumlah Item + Berat Total (atas) ===== */
.rcv-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.rcv-sum-box { border: 1px solid var(--primary-ring); border-radius: var(--radius); padding: 12px 14px; background: var(--primary-soft); display: flex; flex-direction: column; gap: 4px; }
.rcv-sum-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.rcv-sum-val { font-size: 24px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.1; }

/* ===== Toggle Kondisi (Fresh/Frozen) gaya pill ===== */
.seg-cond { display: flex; gap: 4px; width: 100%; background: var(--surface-3); border: 1px solid var(--border); border-radius: 12px; padding: 4px; margin-bottom: 0; }
.seg-cond .seg-btn { flex: 1; justify-content: center; border: 0; border-radius: 9px; padding: 12px 10px; font-size: 15.5px; font-weight: 700; background: transparent; color: var(--text-muted); }
.seg-cond .seg-btn:hover { color: var(--text); transform: none; background: transparent; }
.seg-cond .seg-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); border: 0; }

.rcv-confirm-note { margin: 0; font-size: 14.5px; color: var(--text-muted); line-height: 1.5; }

@media (max-width: 720px) {
  .rcv-summary { grid-template-columns: 1fr 1fr; }
  .rcv-sum-val { font-size: 20px; }
}

/* ===== Issues (Kontrol Penuh) ===== */
.issue-lookup { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.issue-lookup .input-group { flex: 1; min-width: 220px; }
.issue-result { border: 1px solid var(--primary-ring); background: var(--primary-soft); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.issue-notfound { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; color: var(--text-muted); }
.issue-msg { padding: 12px 14px; border-radius: var(--radius); background: var(--danger-soft, rgba(229,72,77,.12)); color: var(--danger); font-size: 14px; line-height: 1.5; word-break: break-word; }
.issue-ref { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.kdp-offscreen { position: absolute; left: -9999px; top: 0; opacity: 0; width: 1px; height: 1px; }
.error-pop-copy { vertical-align: middle; margin-left: 6px; }

/* ===== Issues: bar atas + jarak (fix nubruk) ===== */
.issues-wrap { display: flex; flex-direction: column; gap: 16px; }
.issues-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.issues-bar-hint { color: var(--text-muted); font-size: 13px; }
.issues-wrap .ph-stats { margin: 0; }
.issues-wrap .toolbar { margin-bottom: 12px; }

/* ===== Tombol hapus notifikasi (per item + clear all) ===== */
.notif-item { position: relative; }
.notif-clear { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.notif-clear:hover { background: var(--danger-soft, rgba(229,72,77,.14)); color: var(--danger); }
.notif-clearall { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; }
.notif-clearall:hover { background: var(--danger-soft, rgba(229,72,77,.14)); color: var(--danger); }
.notif-modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.notif-dropdown .dropdown-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notif-item .notif-top { padding-right: 22px; }
.center-cell { text-align: center; }
.ri-item-actions { display: flex; align-items: center; gap: 4px; }

/* Garis tipis pemisah antar kolom (khusus tabel ber-class .data-bordered) */
table.data.data-bordered thead th:not(:last-child),
table.data.data-bordered tbody td:not(:last-child) { border-right: 1px solid var(--border); }

/* Header tabel harus ikut alignment kolomnya (specificity > aturan dasar thead th) */
table.data thead th.center-cell { text-align: center; }
table.data thead th.num-cell { text-align: right; }
table.data thead th.actions-cell { text-align: center; }

/* Tombol "Cek Tally" (pill netral) */
.btn-tally { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); font-weight: 700; border-radius: 999px; }
.btn-tally i { color: var(--text-dim); }
.btn-tally:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-tally:hover i { color: var(--primary); }

/* ============================================================
   Workspace TALLY SUPERVISOR (halaman mandiri, tanpa sidebar)
   ============================================================ */
.tally-body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex;
  background: linear-gradient(160deg, #0e2148 0%, #1b3f86 55%, #2f6bff 120%); color: #eaf1ff; }
.tally-shell { width: 100%; display: flex; align-items: center; justify-content: center; padding: 28px 18px; }
.tally-card { width: min(880px, 100%); background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.16);
  border-radius: 24px; padding: clamp(22px, 4vw, 38px); box-shadow: 0 30px 90px rgba(0,0,0,0.4); backdrop-filter: blur(10px); }
.tally-head { text-align: center; }
.tally-brand { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.tally-role { margin-top: 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #b9ccf2; display: inline-flex; gap: 7px; align-items: center; }
.tally-hi { margin-top: 16px; font-size: 16px; color: #dbe6ff; }
.tally-hi strong { color: #fff; }
.tally-clock { margin-top: 6px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 34px; font-weight: 800; letter-spacing: 4px; color: #fff; }
.tally-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; margin: 26px 0; padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.tally-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 16px 18px; border-radius: 14px; font-weight: 800; font-size: 15px; cursor: pointer; border: 1px solid transparent; transition: transform .15s ease, filter .15s ease, background-color .15s ease; }
.tally-logout-form { display: contents; }
.tally-btn-logout { background: rgba(229,72,77,0.14); border-color: rgba(229,72,77,0.4); color: #ff8d90; }
.tally-btn-logout:hover { background: rgba(229,72,77,0.22); }
.tally-btn-quick { background: linear-gradient(135deg, var(--primary, #2f6bff), var(--accent, #7c5cff)); color: #fff; box-shadow: 0 12px 28px rgba(47,107,255,0.4); }
.tally-btn-quick:hover { filter: brightness(1.06); }
.tally-btn-quick.is-pulsing { transform: scale(0.97); }
.tally-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tally-cat { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 16px; padding: 18px 14px; text-align: center; transition: transform .2s ease, background-color .2s ease; }
.tally-cat:hover { transform: translateY(-3px); background: rgba(255,255,255,0.1); }
.tally-cat-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: rgba(255,255,255,0.1); color: #cfe0ff; }
.tally-cat-name { font-weight: 700; font-size: 14px; color: #fff; }
.tally-cat-status { display: inline-block; margin-top: 12px; padding: 5px 14px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; background: rgba(255,255,255,0.12); color: #b9ccf2; }
.tally-note { margin-top: 22px; padding: 14px 18px; border-radius: 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); text-align: center; font-size: 13.5px; color: #cfe0ff; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tally-foot { margin-top: 18px; text-align: center; font-size: 12px; color: #93a9d6; }
@media (max-width: 520px) { .tally-actions { grid-template-columns: 1fr; } }

/* Baris checkbox/toggle (mis. di form Role) */
.field-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text); }
.field-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; }

/* ===== Akses Cepat Tally: modal kode 5 digit (keypad web) + scan QR ===== */
.tally-modal { width: min(420px, 100%); }
.tq-hint { margin: 0 0 16px; text-align: center; font-size: 13.5px; color: var(--text-muted); }
.tq-code { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.tq-box { width: 52px; height: 62px; display: grid; place-items: center; border: 2px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; transition: border-color .15s ease, box-shadow .15s ease; }
.tq-box.is-filled { border-color: var(--primary); }
.tq-box.is-active { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tq-msg { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-size: 13px; text-align: center; background: var(--surface-3); color: var(--text-muted); }
.tq-msg-ok { background: rgba(52,199,89,.16); color: #2ea043; }
.tq-msg-warn { background: var(--warning-soft); color: #e3b341; }
.tq-keyboard { display: flex; flex-direction: column; gap: 7px; }
.tq-krow { display: flex; gap: 6px; justify-content: center; }
.tq-key { flex: 1 1 0; min-width: 0; height: 46px; padding: 0 4px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 10px; font-size: 17px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: transform .08s ease, background-color .15s ease; }
.tq-key:hover { background: var(--surface-3); }
.tq-key:active { transform: scale(0.95); }
.tq-krow-actions { margin-top: 4px; }
.tq-krow-actions .tq-key { font-size: 13.5px; height: 44px; }
.tq-key-scan { flex: 2 1 0; background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tq-key-clear { flex: 1.6 1 0; }
.tq-key-back { flex: 1 1 0; color: var(--danger); font-size: 18px; }
.tq-scan { position: relative; margin-bottom: 16px; border-radius: 14px; overflow: hidden; background: #000; }
.tq-video { width: 100%; max-height: 280px; display: block; object-fit: cover; background: #000; }
.tq-scan-frame { position: absolute; top: 50%; left: 50%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.9); border-radius: 16px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.tq-scan-stop { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.55); color: #fff; border-color: rgba(255,255,255,.3); }
@media (max-width: 420px) {
  .tq-box { width: 46px; height: 56px; font-size: 24px; }
  .tq-key { height: 42px; font-size: 15px; border-radius: 8px; }
  .tq-krow { gap: 4px; }
  .tq-keyboard { gap: 5px; }
  .tally-clock { font-size: 30px; letter-spacing: 3px; }
}

/* ============================================================
   Tally Engine — Penerimaan (work surface, tablet-fit, CSP-safe)
   ============================================================ */
.te { position: fixed; inset: 0; z-index: 60; background: #eef2f8; color: #0f172a; display: flex; flex-direction: column; overflow: hidden; font-size: 14px; }
.te[hidden] { display: none; }
body.te-open { overflow: hidden; }

.te-top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: #fff; border-bottom: 1px solid #e2e8f0; flex: 0 0 auto; flex-wrap: wrap; }
.te-back { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #d6dce8; background: #fff; color: #334155; font-weight: 700; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.te-back:hover { background: #f1f5fb; }
.te-id { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.te-id b { color: #2f6bff; }
.te-id-sup { font-weight: 600; color: #64748b; font-size: 13px; }
.te-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.te-conn { display: inline-flex; align-items: center; gap: 6px; background: rgba(52,199,89,.14); color: #1a8a3c; border: 1px solid rgba(52,199,89,.4); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; }
.te-conn.is-off { background: rgba(229,72,77,.14); color: #c0303a; border-color: rgba(229,72,77,.4); }
.te-saved { display: inline-flex; align-items: center; gap: 6px; background: #eef2ff; color: #3b5bdb; border: 1px solid #dbe3ff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; transition: background .3s, color .3s; }
.te-saved.is-flash { background: #34c759; color: #fff; border-color: #34c759; }
.te-icon-btn { width: 38px; height: 38px; border: 1px solid #d6dce8; background: #fff; border-radius: 10px; cursor: pointer; color: #334155; display: inline-flex; align-items: center; justify-content: center; }
.te-icon-btn:hover { background: #f1f5fb; }
.te-submit-btn { display: inline-flex; align-items: center; gap: 8px; background: #16a34a; color: #fff; border: none; border-radius: 10px; padding: 9px 16px; font-weight: 800; cursor: pointer; }
.te-submit-btn:hover { filter: brightness(1.05); }
.te-full-exit { display: none; }

/* mode visibility */
.te-list { display: none; }
.te-context { display: none; }
.te-work { display: none; }
.te-pick-fab { display: none; }
.te.is-list .te-list { display: block; flex: 1; overflow-y: auto; padding: 16px; }
.te.is-list .te-saved, .te.is-list .te-submit-btn, .te.is-list [data-te-full] { display: none; }
.te.is-work .te-context { display: flex; }
.te.is-work .te-work { display: flex; }

/* list */
.te-list-head { font-weight: 800; font-size: 16px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.te-list-head i { color: #2f6bff; }
.te-list-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 208px)); gap: 10px; justify-content: start; }
.te-rcard { text-align: left; background: #fff; border: 1px solid #e2e8f0; border-radius: 11px; padding: 10px 11px; cursor: pointer; transition: transform .15s, box-shadow .15s, border-color .15s; }
.te-rcard:hover { border-color: #2f6bff; box-shadow: 0 6px 16px rgba(47,107,255,.12); transform: translateY(-2px); }
.te-rcard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; gap: 6px; }
.te-rcard-code { font-weight: 800; font-size: 13.5px; }
.te-rcard-tc { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1.5px; background: #eef2ff; color: #2f6bff; padding: 1px 6px; border-radius: 5px; font-weight: 700; font-size: 11px; }
.te-rcard-sup { color: #475569; font-size: 12px; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.te-rcard-meta { display: flex; gap: 9px; font-size: 11px; color: #64748b; flex-wrap: wrap; }
.tally-cat-status.is-pending { background: var(--primary, #2f6bff); color: #fff; }
.te-list-load, .te-list-empty { text-align: center; color: #94a3b8; padding: 36px; grid-column: 1 / -1; }
.te-list-empty i { display: block; font-size: 26px; margin-bottom: 8px; opacity: .6; }

/* context */
.te-context { flex-direction: column; gap: 7px; padding: 9px 14px; background: #fff; border-bottom: 1px solid #e2e8f0; flex: 0 0 auto; }
.te-ctx-tier { display: flex; align-items: center; gap: 10px; }
.te-ctx-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; width: 74px; flex: 0 0 auto; }
.te-ctx-row { display: flex; gap: 8px; flex-wrap: wrap; }
.te-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; background: var(--gs, #cbd5e1); border: 2px solid rgba(0,0,0,.06); }
.te-fchip, .te-schip { display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 13px; cursor: pointer; color: #0f172a; }
.te-fchip .te-dot, .te-schip .te-dot { width: 13px; height: 13px; }
.te-fchip-n, .te-schip-stat { background: #f1f5f9; color: #64748b; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; }
.te-fchip.is-active, .te-schip.is-active { border-color: var(--gs); box-shadow: 0 0 0 3px var(--g); }
.te-next { font-size: 13px; color: #475569; display: flex; gap: 7px; align-items: center; }
.te-next i { color: #2f6bff; }
.te-next b { color: #0f172a; }

/* work */
.te-work { flex: 1; min-height: 0; }
.te-grid-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px 14px; min-height: 0; }
.te-grid-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; color: #475569; margin-bottom: 8px; flex: 0 0 auto; }
.te-badge { background: #fff; border: 1px solid #e2e8f0; border-radius: 999px; padding: 3px 12px; font-size: 12px; }
.te-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); grid-auto-rows: min-content; gap: 8px; align-content: start; }
.te-cell { position: relative; background: var(--g, #eef2f8); color: var(--gt, #0f172a); border: 1px solid var(--gs, #cbd5e1); border-radius: 9px; padding: 8px 6px 8px 11px; text-align: center; overflow: hidden; }
.te-cell-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--gs, #cbd5e1); }
.te-cell-no { display: block; font-size: 10.5px; font-weight: 700; opacity: .85; }
.te-cell-w { display: block; font-size: 19px; font-weight: 800; line-height: 1.15; }
.te-cell-undo { position: absolute; top: 2px; right: 3px; width: 18px; height: 18px; border: none; background: rgba(0,0,0,.18); color: #fff; border-radius: 50%; font-size: 12px; line-height: 1; cursor: pointer; opacity: .6; }
.te-cell-undo:hover { opacity: 1; background: #e5484d; }
.te-cell.is-latest { box-shadow: 0 0 0 3px rgba(47,107,255,.25); animation: te-pop .8s ease-out; }
@keyframes te-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.te-empty { grid-column: 1 / -1; text-align: center; color: #94a3b8; padding: 26px; }
.te-empty[hidden] { display: none; }
.te-empty i { display: block; font-size: 24px; margin-bottom: 8px; opacity: .6; }

.te-pad-pane { flex: 0 0 320px; display: flex; flex-direction: column; padding: 12px 14px; background: #fff; border-left: 1px solid #e2e8f0; }
.te-display { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 12px; text-align: center; margin-bottom: 10px; flex: 0 0 auto; }
.te-display-cap { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: #64748b; }
.te-display-val { font-size: 48px; font-weight: 800; line-height: 1.05; color: #0f172a; font-variant-numeric: tabular-nums; }
.te-display-unit { font-size: 12px; color: #94a3b8; }
.te-display-next { margin-top: 6px; font-weight: 700; font-size: 13px; color: #2f6bff; }
.te-display-hint { margin-top: 4px; font-size: 11px; color: #94a3b8; }
.te-numpad { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 8px; }
.te-key { border: 1px solid #d6dce8; background: #fff; border-radius: 12px; font-size: 22px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #0f172a; }
.te-key:hover { background: #f1f5fb; }
.te-key:active { transform: scale(.96); }
.te-key-del { color: #e5484d; }
.te-confirm { grid-column: span 3; background: #2f6bff; color: #fff; border: none; font-size: 17px; font-weight: 800; gap: 8px; box-shadow: 0 8px 18px rgba(47,107,255,.3); }
.te-confirm:hover { filter: brightness(1.05); }
.te-confirm:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }

/* fullscreen */
.te.is-full .te-context { display: none; }
.te.is-full .te-id-sup { display: none; }
.te.is-full [data-te-full] { display: none; }
.te.is-full .te-full-exit { display: inline-flex; }
.te.is-full .te-pick-fab { display: inline-flex; position: fixed; left: 18px; bottom: 18px; z-index: 6; align-items: center; gap: 8px; background: #2f6bff; color: #fff; border: none; border-radius: 999px; padding: 12px 20px; font-weight: 800; cursor: pointer; box-shadow: 0 8px 24px rgba(47,107,255,.4); }
.te.is-full.is-pick .te-context { display: flex; position: absolute; left: 0; right: 0; top: 55px; z-index: 7; box-shadow: 0 14px 30px rgba(0,0,0,.18); }

/* submit dialog */
.te-submit-dialog { width: min(640px, 100%); }
.tes-total { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #1e3a8a, #2f6bff); color: #fff; border-radius: 12px; padding: 14px 18px; }
.tes-total-code { font-weight: 800; font-size: 16px; display: block; }
.tes-total-sub { font-size: 12px; opacity: .85; }
.tes-total-kg { font-size: 26px; font-weight: 800; }
.tes-bd-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #64748b; margin-bottom: 6px; }
.tes-bd-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.tes-bd-row:nth-child(even) { background: var(--surface-2, #f8fafc); }
.tes-bd-row.is-zero { opacity: .5; }
.tes-bd-name { font-weight: 700; flex: 1; }
.tes-bd-val { font-weight: 700; color: var(--text-muted, #475569); font-size: 13px; }
.tes-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tes-sign { width: 100%; height: 160px; border: 2px dashed #cbd5e1; border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.tes-sign-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.tes-sign-hint { font-size: 12px; color: #94a3b8; }
.req { color: #e5484d; }
@media (max-width: 560px) { .tes-grid2 { grid-template-columns: 1fr; } }

.te-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #0f172a; color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.te-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Palet warna: 1 ikan = 1 hue (h0..h7), tiap size/variant = gradasi (s0 muda .. s3 tua) */
.tcg-h0-s0{--g:hsl(48 85% 92%);--gs:hsl(48 70% 52%);--gt:hsl(48 55% 24%);}
.tcg-h0-s1{--g:hsl(48 85% 83%);--gs:hsl(48 70% 46%);--gt:hsl(48 55% 24%);}
.tcg-h0-s2{--g:hsl(48 85% 73%);--gs:hsl(48 70% 40%);--gt:hsl(48 55% 24%);}
.tcg-h0-s3{--g:hsl(48 85% 63%);--gs:hsl(48 70% 34%);--gt:hsl(48 55% 24%);}
.tcg-h1-s0{--g:hsl(212 85% 92%);--gs:hsl(212 70% 52%);--gt:hsl(212 55% 24%);}
.tcg-h1-s1{--g:hsl(212 85% 83%);--gs:hsl(212 70% 46%);--gt:hsl(212 55% 24%);}
.tcg-h1-s2{--g:hsl(212 85% 73%);--gs:hsl(212 70% 40%);--gt:hsl(212 55% 24%);}
.tcg-h1-s3{--g:hsl(212 85% 63%);--gs:hsl(212 70% 34%);--gt:hsl(212 55% 24%);}
.tcg-h2-s0{--g:hsl(150 85% 92%);--gs:hsl(150 70% 52%);--gt:hsl(150 55% 24%);}
.tcg-h2-s1{--g:hsl(150 85% 83%);--gs:hsl(150 70% 46%);--gt:hsl(150 55% 24%);}
.tcg-h2-s2{--g:hsl(150 85% 73%);--gs:hsl(150 70% 40%);--gt:hsl(150 55% 24%);}
.tcg-h2-s3{--g:hsl(150 85% 63%);--gs:hsl(150 70% 34%);--gt:hsl(150 55% 24%);}
.tcg-h3-s0{--g:hsl(280 85% 92%);--gs:hsl(280 70% 52%);--gt:hsl(280 55% 24%);}
.tcg-h3-s1{--g:hsl(280 85% 83%);--gs:hsl(280 70% 46%);--gt:hsl(280 55% 24%);}
.tcg-h3-s2{--g:hsl(280 85% 73%);--gs:hsl(280 70% 40%);--gt:hsl(280 55% 24%);}
.tcg-h3-s3{--g:hsl(280 85% 63%);--gs:hsl(280 70% 34%);--gt:hsl(280 55% 24%);}
.tcg-h4-s0{--g:hsl(340 85% 92%);--gs:hsl(340 70% 52%);--gt:hsl(340 55% 24%);}
.tcg-h4-s1{--g:hsl(340 85% 83%);--gs:hsl(340 70% 46%);--gt:hsl(340 55% 24%);}
.tcg-h4-s2{--g:hsl(340 85% 73%);--gs:hsl(340 70% 40%);--gt:hsl(340 55% 24%);}
.tcg-h4-s3{--g:hsl(340 85% 63%);--gs:hsl(340 70% 34%);--gt:hsl(340 55% 24%);}
.tcg-h5-s0{--g:hsl(190 85% 92%);--gs:hsl(190 70% 52%);--gt:hsl(190 55% 24%);}
.tcg-h5-s1{--g:hsl(190 85% 83%);--gs:hsl(190 70% 46%);--gt:hsl(190 55% 24%);}
.tcg-h5-s2{--g:hsl(190 85% 73%);--gs:hsl(190 70% 40%);--gt:hsl(190 55% 24%);}
.tcg-h5-s3{--g:hsl(190 85% 63%);--gs:hsl(190 70% 34%);--gt:hsl(190 55% 24%);}
.tcg-h6-s0{--g:hsl(25 85% 92%);--gs:hsl(25 70% 52%);--gt:hsl(25 55% 24%);}
.tcg-h6-s1{--g:hsl(25 85% 83%);--gs:hsl(25 70% 46%);--gt:hsl(25 55% 24%);}
.tcg-h6-s2{--g:hsl(25 85% 73%);--gs:hsl(25 70% 40%);--gt:hsl(25 55% 24%);}
.tcg-h6-s3{--g:hsl(25 85% 63%);--gs:hsl(25 70% 34%);--gt:hsl(25 55% 24%);}
.tcg-h7-s0{--g:hsl(265 85% 92%);--gs:hsl(265 70% 52%);--gt:hsl(265 55% 24%);}
.tcg-h7-s1{--g:hsl(265 85% 83%);--gs:hsl(265 70% 46%);--gt:hsl(265 55% 24%);}
.tcg-h7-s2{--g:hsl(265 85% 73%);--gs:hsl(265 70% 40%);--gt:hsl(265 55% 24%);}
.tcg-h7-s3{--g:hsl(265 85% 63%);--gs:hsl(265 70% 34%);--gt:hsl(265 55% 24%);}

/* Kode Tally (operator) — tampilan di modal Cek Tally & detail */
.tcode-show { text-align: center; padding: 10px 4px; }
.tcode-show-cap { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.tcode-show-val { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 44px; font-weight: 800; letter-spacing: 6px; color: var(--primary); margin: 10px 0 6px; }
.tcode-show-note { font-size: 13px; color: var(--text-muted); max-width: 380px; margin: 0 auto; }
.tcode-inline { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 2px; }

/* QR Kode Tally di modal Cek Tally */
.tcode-qr { display: flex; justify-content: center; margin: 6px 0 14px; }
.tcode-qr .qr-svg { width: 180px; height: 180px; background: #fff; padding: 10px; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); }
