/* =====================================================================
   UDepo Control — Design System v7
   Satu file CSS untuk semua halaman. Laptop: sidebar. HP: top bar + bottom nav.
   ===================================================================== */
:root {
  --brand: #e4343c;
  --brand-600: #c9252d;
  --brand-50: #fdecec;
  --accent: #3c3a9b;
  --accent-50: #ececfa;
  --ok: #0f9d6b;
  --ok-50: #e3f6ee;
  --warn: #c77700;
  --warn-50: #fff3dc;
  --bad: #d92d3a;
  --bad-50: #fde8ea;
  --info: #1f6feb;
  --info-50: #e6f0ff;

  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e5e8f0;
  --line-strong: #d3d8e4;
  --text: #171a2b;
  --text-2: #4a5068;
  --text-3: #7b8199;
  --shadow-sm: 0 1px 2px rgba(23, 26, 43, .05), 0 1px 3px rgba(23, 26, 43, .04);
  --shadow: 0 4px 16px rgba(23, 26, 43, .07);
  --shadow-lg: 0 18px 48px rgba(23, 26, 43, .18);
  --radius: 16px;
  --radius-sm: 10px;

  --side-w: 264px;
  --side-w-mini: 76px;
  --top-h: 64px;
  --bottom-h: 68px;

  --c1: #3c3a9b;  /* seri grafik 1 */
  --c2: #e4343c;  /* seri grafik 2 */
  --c3: #0f9d6b;
  --c4: #e69a00;
  --c5: #1f9bd1;
  --c6: #8a5cf6;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --brand: #ff5a62;
  --brand-600: #ff7178;
  --brand-50: #3a1d22;
  --accent: #8c8bff;
  --accent-50: #23234a;
  --ok: #38d39f;
  --ok-50: #11302a;
  --warn: #ffb547;
  --warn-50: #382a10;
  --bad: #ff6b76;
  --bad-50: #3a1d22;
  --info: #6aa5ff;
  --info-50: #172a4a;
  --bg: #0e1019;
  --surface: #171a29;
  --surface-2: #1d2133;
  --line: #272c42;
  --line-strong: #353b57;
  --text: #eceef7;
  --text-2: #b4b9d0;
  --text-3: #8189a6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
  --c1: #8c8bff; --c2: #ff5a62; --c3: #38d39f; --c4: #ffb547; --c5: #55c0ee; --c6: #b190ff;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #ff5a62; --brand-600: #ff7178; --brand-50: #3a1d22; --accent: #8c8bff; --accent-50: #23234a;
    --ok: #38d39f; --ok-50: #11302a; --warn: #ffb547; --warn-50: #382a10; --bad: #ff6b76; --bad-50: #3a1d22;
    --info: #6aa5ff; --info-50: #172a4a; --bg: #0e1019; --surface: #171a29; --surface-2: #1d2133;
    --line: #272c42; --line-strong: #353b57; --text: #eceef7; --text-2: #b4b9d0; --text-3: #8189a6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 4px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
    --c1: #8c8bff; --c2: #ff5a62; --c3: #38d39f; --c4: #ffb547; --c5: #55c0ee; --c6: #b190ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide-mobile { } .only-mobile { display: none !important; }

.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 16px; height: 16px; }

/* ---------- LAYOUT ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40;
  transition: width .2s ease, transform .25s ease;
}
.side-brand { padding: 18px 18px 14px; display: flex; align-items: center; gap: 10px; min-height: var(--top-h); }
.side-brand img { height: 44px; width: auto; max-width: 100%; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px 8px; }
.side-section { padding: 6px 12px; flex: 1; overflow-y: auto; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 14px 12px 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; margin: 2px 0; border-radius: 12px;
  color: var(--text-2); font-weight: 600; text-decoration: none !important; position: relative;
  transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { background: var(--brand-50); color: var(--brand); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.side-foot { padding: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.user-chip .meta { min-width: 0; line-height: 1.25; }
.user-chip .meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }

.main { flex: 1; min-width: 0; margin-left: var(--side-w); transition: margin-left .2s ease; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: 14px;
  padding: 0 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-title { font-size: 18px; font-weight: 800; }
.top-sub { font-size: 12px; color: var(--text-3); }
.top-spacer { flex: 1; }
.page { padding: 24px 28px 48px; width: 100%; max-width: 1560px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { margin: 4px 0 0; color: var(--text-3); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.mobile-top, .bottom-nav, .scrim { display: none; }

/* sidebar mini (laptop, bisa dilipat) */
.side-mini .sidebar { width: var(--side-w-mini); }
.side-mini .main { margin-left: var(--side-w-mini); }
.side-mini .nav-link span, .side-mini .side-label, .side-mini .user-chip .meta, .side-mini .side-brand img.full { display: none; }
.side-mini .nav-link { justify-content: center; padding: 12px; }
.side-mini .nav-link.active::before { left: -12px; }
.side-mini .side-brand { justify-content: center; padding: 14px 8px; }
.side-mini .side-brand img.mini { display: block; }
.side-brand img.mini { display: none; height: 38px; width: 38px; object-fit: cover; object-position: left center; }
.side-mini .user-chip { justify-content: center; }

/* ---------- KOMPONEN ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.card-head h2, .card-title { font-size: 15px; font-weight: 800; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 16px 20px 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer;
  text-decoration: none !important; transition: transform .08s, background .15s, box-shadow .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn-primary:hover { background: var(--brand-600); }
.btn-dark { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-dark:hover { opacity: .9; background: var(--text); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; } .btn-ok:hover { filter: brightness(.95); background: var(--ok); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn-danger:hover { filter: brightness(.95); background: var(--bad); }
.btn-ghost { background: transparent; border-color: transparent; } .btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.badge-ok { background: var(--ok-50); color: var(--ok); border-color: transparent; }
.badge-bad { background: var(--bad-50); color: var(--bad); border-color: transparent; }
.badge-warn { background: var(--warn-50); color: var(--warn); border-color: transparent; }
.badge-info { background: var(--info-50); color: var(--info); border-color: transparent; }
.badge-brand { background: var(--brand-50); color: var(--brand); border-color: transparent; }
.badge-accent { background: var(--accent-50); color: var(--accent); border-color: transparent; }

.field { display: grid; gap: 6px; min-width: 0; }
.field[hidden], .hint[hidden] { display: none !important; }
.field > label, .label { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s; min-height: 42px;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.input { resize: vertical; }
input[type=file].input { padding: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.hint { font-size: 12px; color: var(--text-3); }

/* filter bar */
.filters { padding: 16px; display: grid; gap: 14px; margin-bottom: 18px; }
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 700; font-size: 12.5px; color: var(--text-2); background: var(--surface); transition: all .15s; }
.chip input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* segmented / tabs */
.seg { display: inline-flex; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { padding: 7px 14px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { padding: 18px 20px; position: relative; overflow: hidden; }
.kpi .k-label { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 8px; }
.kpi .k-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); }
.kpi .k-value { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .k-value small { font-size: 14px; font-weight: 700; color: var(--text-3); margin-left: 2px; }
.kpi .k-foot { margin-top: 8px; font-size: 12.5px; color: var(--text-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.t-brand .k-icon { background: var(--brand-50); color: var(--brand); }
.kpi.t-ok .k-icon { background: var(--ok-50); color: var(--ok); }
.kpi.t-warn .k-icon { background: var(--warn-50); color: var(--warn); }
.kpi.hero { background: linear-gradient(135deg, var(--brand), #b81e6b 55%, var(--accent)); color: #fff; border: 0; }
.kpi.hero .k-label, .kpi.hero .k-foot { color: rgba(255,255,255,.85); }
.kpi.hero .k-icon { background: rgba(255,255,255,.2); color: #fff; }
.kpi.hero .k-value small { color: rgba(255,255,255,.8); }
.trend-up { color: var(--ok); font-weight: 800; } .trend-down { color: var(--bad); font-weight: 800; }
.kpi.hero .trend-up, .kpi.hero .trend-down { color: #fff; background: rgba(255,255,255,.2); padding: 1px 8px; border-radius: 999px; }

/* tabel */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover > td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.tbl tfoot td { font-weight: 800; background: var(--surface-2); }
.tbl .sub-row > td { background: var(--surface-2); padding: 0 14px 14px; }
.tbl.inner { margin-top: 4px; }
.tbl.inner th { position: static; background: transparent; }
.tbl.inner td { padding: 8px 14px; }
.cell-title { font-weight: 700; } .cell-sub { font-size: 12px; color: var(--text-3); }
.neg { color: var(--bad); font-weight: 700; } .pos { color: var(--ok); font-weight: 700; }
.toggle-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text-2); }
.toggle-btn .i { transition: transform .2s; width: 16px; height: 16px; }
.toggle-btn[aria-expanded="true"] .i { transform: rotate(180deg); }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 4px 0; flex-wrap: wrap; color: var(--text-3); font-size: 13px; }
.pager .btns { display: flex; gap: 8px; }

/* flash / toast */
.toasts { position: fixed; top: calc(var(--top-h) + 12px); right: 20px; z-index: 90; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--info); border-radius: 12px; box-shadow: var(--shadow-lg); animation: slidein .25s ease; }
.toast.success { border-left-color: var(--ok); } .toast.danger { border-left-color: var(--bad); } .toast.warning { border-left-color: var(--warn); }
.toast .msg { flex: 1; font-weight: 600; }
.toast button { background: none; border: 0; cursor: pointer; color: var(--text-3); padding: 0; }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* modal */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 12, 24, .62); backdrop-filter: blur(4px); }
.modal.open { display: flex; animation: fade .2s ease; }
.modal-card { background: var(--surface); width: 100%; max-width: 480px; border-radius: 20px; box-shadow: var(--shadow-lg); max-height: 92vh; overflow: auto; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; gap: 10px; }
.modal-head h3 { font-size: 17px; }
.modal-body { padding: 10px 20px 4px; } .modal-foot { padding: 14px 20px 20px; display: flex; gap: 8px; justify-content: flex-end; }
.announce-text { white-space: pre-line; background: var(--surface-2); border: 1px solid var(--line); padding: 14px; border-radius: 12px; max-height: 40vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

.loading { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; background: rgba(10, 12, 24, .6); backdrop-filter: blur(3px); color: #fff; text-align: center; }
.loading.on { display: grid; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.25); border-top-color: #fff; animation: spin .8s linear infinite; margin: 0 auto 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* multi-select dropdown */
.dd { position: relative; }
.dd-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; cursor: pointer; }
.dd-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; max-height: 300px; overflow: auto; padding: 8px; display: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); }
.dd.open .dd-menu { display: block; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.dd-item:hover { background: var(--surface-2); }

/* =====================================================================
   DASHBOARD
   ===================================================================== */
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.span-8 { grid-column: span 8; } .span-4 { grid-column: span 4; } .span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-12 { grid-column: span 12; } .span-6 { grid-column: span 6; }
.period-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 12.5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--warn-50); color: var(--warn); font-weight: 600; margin-bottom: 16px; }

.chart-box { position: relative; width: 100%; height: 300px; }
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-box .tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-lg); transform: translate(-50%, -100%); opacity: 0; transition: opacity .12s; white-space: nowrap; z-index: 5; }
.chart-box .tip.on { opacity: 1; }
.chart-box .tip b { display: block; margin-bottom: 2px; }
.ax text { fill: var(--text-3); font-size: 11px; }
.ax line, .grid-line { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.split-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.split-bar > div { height: 100%; transition: width .5s ease; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.stat-row:last-child { border-bottom: 0; }
.stat-row .l { color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat-row .v { font-weight: 800; font-variant-numeric: tabular-nums; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.hbar { display: grid; grid-template-columns: minmax(74px, 130px) 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.hbar .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; display: flex; gap: 2px; }
.hbar .fill { height: 100%; border-radius: 999px; transition: width .5s ease; min-width: 2px; }
.hbar .track2 { display: grid; gap: 3px; }
.hbar .track2 .line { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar .track2 .fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.hbar .val { font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.hbar.click { cursor: pointer; border-radius: 10px; padding: 6px 8px; margin: 0 -8px; }
.hbar.click:hover, .hbar.click.sel { background: var(--surface-2); }
.hbar.click.sel .name { color: var(--accent); }

.wh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.wh-card { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.wh-card .n { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; color: var(--text-3); text-transform: uppercase; }
.wh-card .v { font-size: 19px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(145deg, #1b1a4e, #3c3a9b 45%, #e4343c); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before, .auth-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-art::before { width: 520px; height: 520px; right: -180px; top: -160px; }
.auth-art::after { width: 360px; height: 360px; left: -120px; bottom: -120px; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo-plate { background: #fff; border-radius: 18px; padding: 14px 20px; display: inline-block; box-shadow: var(--shadow-lg); }
.auth-art .logo-plate img { height: 54px; display: block; }
.auth-art h2 { font-size: 36px; line-height: 1.15; font-weight: 800; max-width: 440px; }
.auth-art p { opacity: .85; max-width: 420px; font-size: 15px; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 28px; font-weight: 800; }
.auth-logo-mobile { display: none; }

.err-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.err-code { font-size: 96px; font-weight: 900; letter-spacing: -.04em; background: linear-gradient(135deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1; }

/* settings tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab-btn { padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-pane { display: none; gap: 16px; } .tab-pane.active { display: grid; }
.danger-zone { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad-50) 40%, var(--surface)); }

/* =====================================================================
   RESPONSIF
   ===================================================================== */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-8, .span-4, .span-7, .span-5 { grid-column: span 12; }
}
@media (max-width: 1023px) {
  .hide-mobile { display: none !important; } .only-mobile { display: initial !important; }
  /* Menu HP: lihat bagian "Menu HP (gelembung kaca)" di akhir file */
  .main, .side-mini .main { margin-left: 0; }
  .side-mini .nav-link span, .side-mini .side-label, .side-mini .user-chip .meta, .side-mini .side-brand img.full { display: initial; }
  .side-mini .side-brand img.mini { display: none; }
  .topbar { display: none; }
  .mobile-top {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; height: 58px; padding: 0 14px;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .mobile-top .mt-title { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mobile-top img { height: 30px; }
  .page { padding: 16px 14px calc(var(--bottom-h) + 28px); }
  .page-head h1 { font-size: 21px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 36;
    height: var(--bottom-h); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(23, 26, 43, .06);
  }
  .bn-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; background: none; color: var(--text-3); font-size: 10.5px; font-weight: 700; border-radius: 12px; text-decoration: none !important; cursor: pointer; }
  .bn-item.active { color: var(--brand); }
  .bn-item.active .bn-ico { background: var(--brand-50); }
  .bn-ico { width: 46px; height: 28px; border-radius: 999px; display: grid; place-items: center; transition: background .15s; }
  .toasts { top: 66px; right: 12px; left: 12px; width: auto; }
  .kpi .k-value { font-size: 22px; }
  .kpi { padding: 14px 14px; }
  .kpi-grid { gap: 10px; }
  .chart-box { height: 240px; }
  .dash-grid { gap: 12px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-logo-mobile { display: block; margin: 0 auto 18px; height: 56px; }
  .hbar { grid-template-columns: minmax(64px, 96px) 1fr auto; }
  /* tabel -> kartu pada layar kecil */
  .tbl.cards thead { display: none; }
  .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; }
  .tbl.cards tr.row { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 6px 4px; box-shadow: var(--shadow-sm); }
  .tbl.cards td { border: 0; padding: 6px 12px; display: flex; justify-content: space-between; gap: 14px; align-items: baseline; text-align: right; }
  .tbl.cards td::before { content: attr(data-label); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); text-align: left; flex: none; }
  .tbl.cards td.first { display: block; text-align: left; padding-top: 10px; }
  .tbl.cards td.first::before { display: none; }
  .tbl.cards td.no-label::before { display: none; }
  .tbl.cards tr.sub-row { margin: -8px 0 12px; padding: 0; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; }
  .tbl.cards tr.sub-row > td { display: block; padding: 6px 10px 12px; text-align: left; }
  .tbl.cards tr.sub-row > td::before { display: none; }
  .tbl.cards tfoot { display: block; } .tbl.cards tfoot tr { display: block; }
  .table-card-wrap { background: transparent; border: 0; box-shadow: none; }
  .tbl.inner thead { display: none; }
  .tbl.inner td { padding: 4px 6px; }
  .tbl.inner tr { display: block; border-bottom: 1px dashed var(--line); padding: 6px 0; }
  .tbl.inner td.first { font-weight: 700; }
  .filters { padding: 14px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { max-width: 100%; border-radius: 22px 22px 0 0; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .kpi .k-value { font-size: 19px; }
  .kpi .k-label { font-size: 10.5px; }
}
@media print { .sidebar, .topbar, .mobile-top, .bottom-nav, .filters, .actions { display: none !important; } .main { margin: 0; } }
/* fix: baris detail tetap tersembunyi di tampilan kartu HP */
.tbl.cards tr.sub-row[hidden], .tbl.cards tr.sub-row[hidden] > td { display: none !important; }

/* fix: header kolom angka rata kanan */
.tbl th.right, .tbl td.right { text-align: right; }
.tbl th.center, .tbl td.center { text-align: center; }

/* ===== v7: target, CO outstanding, riwayat RO, analisa ===== */
.tbl.cards tr.sub-row[hidden], .tbl.cards tr.sub-row[hidden] > td { display: none !important; }
.pbar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; min-width: 80px; }
.pbar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s; }
.pbar.tone-ok > i { background: var(--ok, #16a34a); }
.pbar.tone-warn > i { background: var(--warn, #d97706); }
.pbar.tone-bad > i { background: var(--bad, #dc2626); }
.pbar.tone-muted > i { background: var(--text-3); }
.tg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tg-pct { display: flex; align-items: center; gap: 10px; font-size: 20px; }
.badge-muted { background: var(--surface-2); color: var(--text-3); }
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link.is-on { outline: 2px solid var(--accent); }
.ro-hist { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.ro-hist-title { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 6px; }
.ro-hist ul { list-style: none; margin: 0; padding: 0; max-height: 190px; overflow-y: auto; display: grid; gap: 8px; }
.ro-hist li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.ro-hist-meta { font-size: 11.5px; color: var(--text-3); }
.ro-hist-note { font-size: 13px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.ro-hist-fu { font-size: 12px; margin-top: 2px; font-weight: 700; color: var(--accent); }


/* ===== Chat ===== */
.nav-badge { margin-left: auto; min-width: 20px; justify-content: center; }
[data-chat-badge][hidden] { display: none !important; }
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 150px); min-height: 440px; overflow: hidden; padding: 0; }
.chat-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.chat-search { padding: 12px; border-bottom: 1px solid var(--line); }
.chat-contacts { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.chat-contact { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 12px; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.chat-contact:hover { background: var(--surface); }
.chat-contact.active { background: var(--accent-50); }
.chat-av { position: relative; width: 38px; height: 38px; }
.chat-av-g { background: var(--accent); }
.chat-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--text-3); border: 2px solid var(--surface); }
.chat-dot.on { background: var(--ok); }
.chat-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-meta strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta small { font-size: 11.5px; color: var(--text-3); text-transform: capitalize; }
.chat-unread { flex: none; }
.chat-empty { padding: 18px; color: var(--text-3); font-size: 13px; text-align: center; }
.chat-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 58px; }
.chat-title { display: flex; flex-direction: column; min-width: 0; }
.chat-title strong { font-size: 15px; }
.chat-title span { font-size: 12px; }
.chat-back { display: none; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); overscroll-behavior: contain; }
.chat-placeholder { margin: auto; text-align: center; color: var(--text-3); max-width: 260px; font-size: 13.5px; }
.chat-placeholder.small { margin: 24px auto; font-size: 12.5px; }
.chat-placeholder .i-lg { width: 40px; height: 40px; opacity: .5; }
.chat-day { align-self: center; margin: 10px 0 4px; padding: 3px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 11px; font-weight: 700; color: var(--text-3); }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-end; }
.chat-bubble { max-width: min(560px, 82%); padding: 8px 12px 6px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.chat-row.mine .chat-bubble { border-radius: 16px 16px 4px 16px; background: var(--accent); border-color: var(--accent); color: #fff; }
.chat-from { font-size: 11.5px; font-weight: 800; color: var(--accent); margin-bottom: 2px; }
.chat-text { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.chat-time { display: block; text-align: right; font-size: 10.5px; opacity: .65; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); position: relative; background: var(--surface); }
.chat-form[hidden] { display: none; }
.chat-form textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; line-height: 1.4; }
.chat-count { position: absolute; right: 100px; top: -18px; font-size: 11px; color: var(--text-3); }
@media (max-width: 760px) {
  .chat { grid-template-columns: 1fr; height: calc(100dvh - 58px - var(--bottom-h) - 120px); min-height: 380px; }
  .chat-pane { display: none; }
  .chat.in-room .chat-list { display: none; }
  .chat.in-room .chat-pane { display: flex; }
  .chat-back { display: inline-flex; }
  .chat-bubble { max-width: 88%; }
}

/* ===== Menu HP (gelembung kaca) =====
   Menu muncul sebagai gelembung yang membesar dari titik yang disentuh (tombol garis 3 / Lainnya),
   latar kaca transparan (konten di belakang tetap terlihat samar), ikon menu "meletup" satu per satu. */
.side-close { display: none; }
@media (max-width: 1023px) {
  .sidebar, .side-mini .sidebar {
    inset: 0; width: 100%; transform: none; border: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 48%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(1.5); backdrop-filter: blur(10px) saturate(1.5);
    clip-path: circle(0px at var(--ox, 28px) var(--oy, 28px));
    visibility: hidden; pointer-events: none; overflow: hidden;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
    transition: clip-path .5s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .5s;
  }
  body.drawer-open .sidebar {
    clip-path: circle(var(--r, 150vmax) at var(--ox, 28px) var(--oy, 28px));
    visibility: visible; pointer-events: auto;
    transition: clip-path .62s cubic-bezier(.2, .9, .25, 1), visibility 0s;
  }
  body.drawer-open { overflow: hidden; }
  .scrim { display: none !important; }
  /* gelembung dekoratif yang melayang pelan di latar */
  .sidebar::before, .sidebar::after {
    content: ""; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1; filter: blur(2px); opacity: .55;
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, #fff 55%, transparent), color-mix(in srgb, var(--brand) 35%, transparent) 60%, transparent 72%);
  }
  .sidebar::before { width: 220px; height: 220px; right: -60px; top: 12%; animation: bubbleFloat 9s ease-in-out infinite; }
  .sidebar::after { width: 150px; height: 150px; left: -40px; bottom: 18%; animation: bubbleFloat 11s ease-in-out infinite reverse;
    background: radial-gradient(circle at 30% 30%, color-mix(in srgb, #fff 55%, transparent), color-mix(in srgb, var(--accent) 40%, transparent) 60%, transparent 72%); }
  .side-brand { justify-content: space-between; min-height: 0; padding: 14px 16px 6px; }
  .side-brand img.full { height: 38px; }
  .side-close {
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--text); cursor: pointer;
  }
  .side-section { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-content: start; padding: 4px 16px 12px; }
  .side-label { grid-column: 1 / -1; padding: 10px 2px 2px; }
  .nav-link, .side-mini .nav-link {
    flex-direction: column; justify-content: center; text-align: center; gap: 6px; margin: 0; padding: 14px 6px 12px;
    min-height: 82px; border-radius: 18px; font-size: 12px; line-height: 1.2; color: var(--text);
    background: color-mix(in srgb, var(--surface) 62%, transparent); border: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
    box-shadow: 0 6px 18px rgba(10, 12, 30, .10);
    opacity: 0; transform: scale(.4) translateY(14px);
  }
  .nav-link .i { width: 24px; height: 24px; }
  .nav-link.active { background: color-mix(in srgb, var(--brand) 16%, var(--surface)); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
  .nav-link.active::before { display: none; }
  .nav-link .badge { position: absolute; top: 6px; right: 6px; margin: 0; padding: 1px 6px; font-size: 10.5px; }
  body.drawer-open .nav-link { animation: bubblePop .5s cubic-bezier(.34, 1.56, .64, 1) forwards; animation-delay: calc(var(--i, 0) * 40ms + 140ms); }
  .side-foot { border-top: 0; padding: 10px 16px 18px; grid-template-columns: 1fr auto; align-items: center; }
  .side-foot .user-chip { background: color-mix(in srgb, var(--surface) 62%, transparent); border: 1px solid color-mix(in srgb, var(--line) 85%, transparent); }
  .side-foot form .btn { width: auto; }
  body.drawer-open .side-foot { animation: fadeUp .45s ease forwards .35s; opacity: 0; }
}
@media (max-width: 360px) {
  .side-section { gap: 8px; padding: 4px 12px 10px; }
  .nav-link, .side-mini .nav-link { min-height: 74px; font-size: 11.5px; padding: 12px 4px 10px; }
}
@keyframes bubblePop { 0% { opacity: 0; transform: scale(.4) translateY(14px); } 70% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bubbleFloat { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-18px, 22px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) {
  .sidebar, body.drawer-open .sidebar { transition: none !important; }
  body.drawer-open .nav-link, body.drawer-open .side-foot { animation: none !important; opacity: 1 !important; transform: none !important; }
  .sidebar::before, .sidebar::after { animation: none !important; }
}
@media (max-width: 1023px) {
  body.drawer-closing .nav-link, body.drawer-closing .side-foot { opacity: 1; transform: none; animation: none; }
}

/* ===== Gelembung chat (bisa digeser) + popup chat ===== */
.chatfab {
  position: fixed; left: -200px; top: -200px; z-index: 55; width: 56px; height: 56px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; -webkit-tap-highlight-color: transparent;
  color: #fff; background: radial-gradient(circle at 30% 25%, color-mix(in srgb, #fff 35%, var(--brand)) 0%, var(--brand) 45%, var(--accent) 100%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 40%, transparent), 0 2px 6px rgba(0, 0, 0, .2), inset 0 1px 1px rgba(255, 255, 255, .35);
  opacity: 0; transition: transform .2s ease, box-shadow .2s ease, opacity .25s ease;
}
.chatfab.ready { opacity: 1; }
.chatfab.snap { transition: left .45s cubic-bezier(.34, 1.56, .64, 1), top .45s cubic-bezier(.34, 1.56, .64, 1), transform .2s ease, opacity .25s; }
.chatfab:hover { transform: scale(1.05); }
.chatfab.dragging { cursor: grabbing; transform: scale(1.12); box-shadow: 0 18px 40px color-mix(in srgb, var(--brand) 45%, transparent), 0 4px 10px rgba(0, 0, 0, .25); }
.chatfab::before {           /* kilau kaca */
  content: ""; position: absolute; inset: 6px 14px auto 10px; height: 14px; border-radius: 50%;
  background: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); pointer-events: none;
}
.chatfab-ico { position: absolute; display: grid; place-items: center; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; }
.chatfab-ico .i { width: 26px; height: 26px; }
.chatfab-close { opacity: 0; transform: rotate(-90deg) scale(.5); }
body.chatpop-open .chatfab-open { opacity: 0; transform: rotate(90deg) scale(.5); }
body.chatpop-open .chatfab-close { opacity: 1; transform: none; }
.chatfab-badge {
  position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg); box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.chatfab-badge[hidden] { display: none; }
.chatfab:has(.chatfab-badge:not([hidden]))::after {       /* denyut lembut saat ada pesan baru */
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--brand); animation: fabPulse 1.8s ease-out infinite; pointer-events: none;
}
@keyframes fabPulse { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }

.chatpop {
  position: fixed; z-index: 54; display: flex; border-radius: 22px; overflow: hidden;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent);
  box-shadow: 0 24px 60px rgba(10, 12, 30, .35), 0 2px 8px rgba(10, 12, 30, .15);
  opacity: 0; visibility: hidden; pointer-events: none; transform: scale(.15);
  transition: transform .42s cubic-bezier(.34, 1.4, .64, 1), opacity .25s ease, visibility 0s linear .42s;
}
.chatpop.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), opacity .2s ease, visibility 0s; }

/* isi popup: satu kolom (daftar  <->  percakapan) */
.chat.chat-popup { display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.chat-popup .chatpop-head { min-height: 54px; padding: 8px 8px 8px 14px; gap: 6px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 16%, transparent), color-mix(in srgb, var(--accent) 16%, transparent)); }
.chat-popup .chat-title { flex: 1; }
.chat-popup .chat-title strong { font-size: 15px; }
.chat-popup .chat-title span { font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chatpop-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer;
  background: color-mix(in srgb, var(--surface) 65%, transparent); color: var(--text); text-decoration: none !important;
}
.chatpop-btn:hover { background: var(--surface); }
.chat-popup .chat-back { display: none; margin-left: -6px; }
.chat-popup.in-room .chat-back { display: grid; }
.chat-popup .chat-list { flex: 1; min-height: 0; border: 0; background: transparent; }
.chat-popup .chat-search { padding: 10px 12px 6px; border: 0; }
.chat-popup .chat-search .input { height: 38px; border-radius: 999px; padding: 0 14px; font-size: 13px; }
.chat-popup .chat-contacts { padding: 4px 8px 10px; }
.chat-popup .chat-contact { padding: 8px; gap: 10px; }
.chat-popup .chat-av { width: 34px; height: 34px; font-size: 13px; }
.chat-popup .chat-meta strong { font-size: 13px; }
.chat-popup .chat-meta small { font-size: 11px; }
.chat-popup .chat-pane { display: none; flex: 1; min-height: 0; }
.chat-popup.in-room .chat-list { display: none; }
.chat-popup.in-room .chat-pane { display: flex; }
.chat-popup .chat-msgs { padding: 12px; gap: 5px; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.chat-popup .chat-bubble { max-width: 84%; padding: 7px 11px 5px; }
.chat-popup .chat-text { font-size: 13.5px; }
.chat-popup .chat-form { padding: 8px 10px; gap: 6px; background: color-mix(in srgb, var(--surface) 70%, transparent); }
.chat-popup .chat-form textarea { min-height: 40px; border-radius: 20px; padding: 9px 14px; font-size: 13.5px; }
.chatpop-send { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none; }
.chat-popup .chat-count { right: 60px; }
@media (max-width: 1023px) { .chatfab { width: 52px; height: 52px; } .chatfab-ico .i { width: 24px; height: 24px; } }
@media (max-width: 560px) { body.chatpop-open .chatfab { opacity: 0; pointer-events: none; } }   /* di HP popup punya tombol tutup sendiri */
@media (prefers-reduced-motion: reduce) { .chatpop, .chatpop.open, .chatfab.snap { transition: opacity .15s !important; } .chatfab::after { animation: none !important; } }

/* ===== Panduan (/panduan) ===== */
.note[hidden] { display: none !important; }
.g-welcome { align-items: center; }
.g-welcome > div { flex: 1; }
.public .public-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.public .public-logo img { height: 38px; background: #fff; border-radius: 8px; padding: 3px 6px; }
.guide { max-width: 920px; margin: 0 auto; display: grid; gap: 16px; }
.g-hero { display: flex; gap: 16px; align-items: center; padding: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), color-mix(in srgb, var(--accent) 12%, var(--surface))); }
.g-hero h1 { font-size: 22px; font-weight: 800; }
.g-hero p { margin: 4px 0 0; color: var(--text-2); }
.g-hero-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--brand); color: #fff; }
.g-hero-ico .i { width: 28px; height: 28px; }
.g-toc { display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: calc(var(--top-h) + 6px); z-index: 5; padding: 10px; border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 85%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.g-toc a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.g-toc a:hover { background: var(--accent-50); color: var(--accent); }
.g-sec { padding: 20px 22px; scroll-margin-top: 140px; }
.g-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin-bottom: 10px; }
.g-sec h2 .i { color: var(--brand); }
.g-sec h3 { font-size: 14px; font-weight: 800; margin: 16px 0 8px; display: flex; align-items: center; gap: 6px; }
.g-sec p { margin: 0 0 10px; color: var(--text-2); line-height: 1.6; }
.g-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.g-steps li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.55; }
.g-num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); margin-top: 1px; }
.g-steps .i, .g-list .i { vertical-align: -3px; }
.g-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; line-height: 1.55; color: var(--text-2); }
.g-list b, .g-steps b, .g-sec p b { color: var(--text); }
.g-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; margin-top: 6px; }
.g-tip .i { flex: none; margin-top: 2px; }
.g-info { background: var(--info-50); color: var(--text); } .g-info .i { color: var(--info); }
.g-warn { background: var(--warn-50); color: var(--text); } .g-warn .i { color: var(--warn); }
.g-table-wrap { overflow-x: auto; }
.g-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.g-table th, .g-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.g-table th { width: 150px; white-space: nowrap; font-weight: 800; color: var(--text); }
.g-table td { color: var(--text-2); }
.g-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.g-box { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.g-box h3 { margin-top: 0; }
.g-faq { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin-bottom: 8px; background: var(--surface-2); }
.g-faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after { content: "+"; font-weight: 800; color: var(--brand); }
.g-faq[open] summary::after { content: "−"; }
.g-faq p { margin: 0 0 12px; }
.g-foot { margin: 4px 0 20px; }
@media (max-width: 1023px) {
  .g-toc { top: 64px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .g-toc::-webkit-scrollbar { display: none; }
  .g-sec { padding: 16px; }
  .g-hero { padding: 16px; }
  .g-hero h1 { font-size: 19px; }
  .g-grid2 { grid-template-columns: 1fr; }
  .g-table th { width: auto; white-space: normal; min-width: 92px; }
}

/* ===== Kartu total laporan (Daily Sales / Service Level): rapi di semua lebar layar ===== */
.kpi-r { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi-mini { padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.kpi-mini .k-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-mini .k-icon { flex: none; }
.kpi-mini .k-titles { min-width: 0; }
.kpi-mini .k-label { display: block; font-size: 11.5px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.kpi-mini .k-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.kpi-mini .k-value { font-size: clamp(20px, 2.1vw, 28px); white-space: nowrap; margin-top: 12px; }
.kpi-mini .k-value small { font-size: .55em; font-weight: 800; color: var(--text-3); margin: 0 2px 0 0; }
@media (max-width: 1023px) {
  .kpi-r { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-r-1 { grid-template-columns: 1fr; }
  .kpi-mini { padding: 12px 13px; border-radius: 14px; }
  .kpi-mini .k-icon { width: 28px; height: 28px; border-radius: 8px; }
  .kpi-mini .k-label, .kpi-mini .k-sub { font-size: 10.5px; }
  .kpi-mini .k-value { font-size: 20px; margin-top: 8px; }
}
@media (max-width: 360px) { .kpi-mini .k-value { font-size: 17px; } }

/* ===== Transisi ringan antar halaman ===== */
.page { animation: pageIn .32s cubic-bezier(.2, .8, .2, 1) backwards; }   /* backwards: setelah selesai tidak ada transform (modal fixed tetap normal) */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.nav-leaving .page { opacity: .45; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease; pointer-events: none; }
.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, var(--brand), var(--accent)); box-shadow: 0 0 10px color-mix(in srgb, var(--brand) 60%, transparent); }
body.nav-leaving .nav-progress { opacity: 1; animation: navProgress 2.4s cubic-bezier(.1, .7, .2, 1) forwards; }
@keyframes navProgress { 0% { width: 0; } 30% { width: 45%; } 100% { width: 88%; } }
@media (prefers-reduced-motion: reduce) { .page, body.nav-leaving .nav-progress { animation: none !important; } body.nav-leaving .page { transition: none; } }

/* ===== Foto profil & halaman Akun Saya ===== */
.avatar { overflow: hidden; position: relative; }
.avatar > img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.chat-av > img { position: absolute; inset: 0; }
a.user-chip { color: inherit; text-decoration: none !important; transition: background .15s; }
a.user-chip:hover { background: var(--accent-50); }
.acct { max-width: 980px; margin: 0 auto; display: grid; gap: 16px; }
.acct-hero { display: flex; align-items: center; gap: 20px; padding: 22px; flex-wrap: wrap;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 12%, var(--surface)), color-mix(in srgb, var(--accent) 14%, var(--surface))); }
.acct-avatar { position: relative; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: 40px; font-weight: 800;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 35%, transparent); border: 4px solid var(--surface); }
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.acct-avatar-edit { position: absolute; right: -2px; bottom: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.acct-avatar:hover .acct-avatar-edit { background: var(--accent); color: #fff; }
.acct-id { min-width: 0; flex: 1; }
.acct-id h1 { font-size: 22px; font-weight: 800; overflow-wrap: anywhere; }
.acct-id .muted { margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.acct-photo-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.acct-grid > section:last-child { grid-column: 1 / -1; }
.acct-form { display: grid; gap: 12px; margin-top: 12px; }
.acct-inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.acct-code { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; margin-top: 12px; }
.acct-code > div { flex: 1; }
.acct-code.ok { background: var(--ok-50); } .acct-code.ok > .i { color: var(--ok); }
.acct-code.wait { background: var(--warn-50); } .acct-code.wait > .i { color: var(--warn); }
@media (max-width: 1023px) {
  .acct-grid { grid-template-columns: 1fr; }
  .acct-hero { padding: 16px; gap: 14px; }
  .acct-avatar { width: 84px; height: 84px; font-size: 32px; }
  .acct-id h1 { font-size: 19px; }
  .acct-inline { grid-template-columns: 1fr; }
}

/* ===== Pemilih rentang tanggal (1 kolom) ===== */
.drp { position: relative; }
.drp-btn { display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer; width: 100%; min-width: 0; }
.drp-btn .i { color: var(--text-3); flex: none; }
.drp-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.drp.has-value .drp-label { color: var(--text); font-weight: 600; }
.drp.has-value .drp-btn .i, .drp.open .drp-btn .i { color: var(--accent); }
.drp-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 300px; max-width: calc(100vw - 24px); padding: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: drpIn .16s ease-out;
}
.drp-pop.right { left: auto; right: 0; }
.drp-pop[hidden] { display: none; }
@keyframes drpIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.drp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.drp-head strong { font-size: 14px; }
.drp-nav { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; font-size: 18px; line-height: 1; color: var(--text); }
.drp-nav:hover { background: var(--accent-50); color: var(--accent); }
.drp-hint { font-size: 11.5px; color: var(--text-3); text-align: center; margin: 2px 0 8px; }
.drp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.drp-dow { font-size: 10.5px; font-weight: 800; color: var(--text-3); text-align: center; padding: 4px 0; text-transform: uppercase; }
.drp-day { height: 36px; border: 0; background: transparent; color: var(--text); font-size: 13px; cursor: pointer; border-radius: 0; font-variant-numeric: tabular-nums; }
.drp-day:hover { background: var(--surface-2); border-radius: 10px; }
.drp-day.today { font-weight: 800; color: var(--accent); }
.drp-day.in { background: var(--accent-50); color: var(--accent); }
.drp-day.edge { background: var(--accent); color: #fff; font-weight: 800; }
.drp-day.lo { border-radius: 10px 0 0 10px; } .drp-day.hi { border-radius: 0 10px 10px 0; } .drp-day.lo.hi { border-radius: 10px; }
.drp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.drp-chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.drp-chip:hover { background: var(--accent-50); color: var(--accent); border-color: transparent; }
.drp-clear { color: var(--bad); }
.drp-pop { scroll-margin: 70px 0 16px; }
@media (max-width: 1023px) { .drp-pop { scroll-margin-bottom: calc(var(--bottom-h) + 16px); } }

/* ===== Hapus pesan chat ===== */
.chat-row { position: relative; align-items: center; gap: 6px; transition: opacity .2s, transform .2s; }
.chat-row.mine { flex-direction: row-reverse; justify-content: flex-start; }
.chat-row.gone { opacity: 0; transform: scale(.96); }
.chat-del { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--bad);
  display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s; flex: none; padding: 0; }
.chat-del:hover { background: var(--bad-50); }
@media (hover: hover) { .chat-row.deletable:hover .chat-del { opacity: 1; pointer-events: auto; } }
.chat-row.act .chat-del { opacity: 1; pointer-events: auto; }
.chat-row.deletable .chat-bubble { cursor: pointer; }
@media (hover: hover) { .chat-row.deletable .chat-bubble { cursor: default; } }
/* tombol hapus selalu terlihat samar di laptop (lebih mudah ditemukan), jelas saat kursor di atas pesan */
@media (hover: hover) { .chat-row.deletable .chat-del { opacity: .35; pointer-events: auto; } .chat-row.deletable:hover .chat-del, .chat-del:focus-visible { opacity: 1; } }
.chat-clear { color: var(--bad); flex: none; }
.chat-clear[hidden] { display: none !important; }
.chat-head .chat-title { flex: 1; min-width: 0; }
.app-version { font-size: 10.5px; color: var(--text-3); text-align: center; letter-spacing: .04em; opacity: .75; font-variant-numeric: tabular-nums; }
.side-mini .app-version { display: none; }
@media (max-width: 1023px) { .side-foot .app-version { grid-column: 1 / -1; } }

/* ===== UOM & stok karton ===== */
.uom-stat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.uom-stat > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.uom-stat b { font-size: 20px; font-weight: 800; }
.uom-stat span { font-size: 11.5px; color: var(--text-3); }
.uom-stat .warn { background: var(--warn-50); border-color: transparent; } .uom-stat .ok { background: var(--ok-50); border-color: transparent; }
.stok-unit-note { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--warn-50); font-size: 13px; margin-bottom: 14px; }
@media (max-width: 560px) { .uom-stat { grid-template-columns: 1fr; } }
.seg-sm button, .seg-sm a { padding: 5px 11px; font-size: 12.5px; }
.seg-sm { padding: 3px; }
.uom-dl { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--info-50); display: grid; gap: 8px; }
.uom-dl-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl-dl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--info-50); }
.tpl-dl-label { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; margin-right: 4px; }

/* ===== Monitoring CO ===== */
.mco-status { padding: 14px 18px; margin-bottom: 14px; display: grid; gap: 10px; }
.mco-status-main { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.mco-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.mco-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: mcoPulse 1.8s ease-out infinite; }
@keyframes mcoPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.mco-newbar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 12px; background: var(--info-50); font-weight: 700; font-size: 13px; }
.mco-newbar[hidden] { display: none; }
.mco-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.mco-hist summary { cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.pos { color: var(--ok); } .neg { color: var(--bad); font-weight: 700; } .warnc { color: var(--warn); font-weight: 700; }
.mco-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.mco-chip { padding: 6px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; font-weight: 700; text-decoration: none !important; }
.mco-chip:hover { background: var(--accent-50); color: var(--accent); }
.mco-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.mco-chip.kat-ok.on { background: var(--ok); border-color: var(--ok); } .mco-chip.kat-masalah.on { background: var(--bad); border-color: var(--bad); } .mco-chip.kat-tunggu.on { background: var(--warn); border-color: var(--warn); }
.mco-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
.mco-q { grid-column: span 2; }
.mco-check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin: 10px 0 2px; }
.kat-b { border-color: transparent; }
.kat-b.kat-ok { background: var(--ok-50); color: var(--ok); } .kat-b.kat-tunggu { background: var(--warn-50); color: var(--warn); } .kat-b.kat-masalah { background: var(--bad-50); color: var(--bad); }
.src { font-weight: 800; font-size: 10.5px; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.src-sfa { color: var(--accent); }
.mco-row { cursor: pointer; } .mco-row:hover { background: var(--surface-2); } .mco-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.mco-charts { display: grid; grid-template-columns: 1.4fr 1.2fr 1fr; gap: 14px; margin-bottom: 14px; }
.mco-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 12px; }
.mco-bar { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mco-bar i { display: block; width: 100%; max-width: 22px; min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent)); }
.mco-bar span { font-size: 9.5px; color: var(--text-3); height: 12px; line-height: 12px; }
.mco-bars.thin .mco-bar i { max-width: 14px; background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--brand) 55%, transparent)); }
.mco-hbars { display: grid; gap: 7px; margin-top: 12px; }
.mco-hb { display: grid; grid-template-columns: 82px 1fr 34px; gap: 8px; align-items: center; font-size: 12px; color: inherit; text-decoration: none !important; }
.mco-hb .b { height: 9px; border-radius: 999px; background: var(--surface-2); overflow: hidden; } .mco-hb .b i { display: block; height: 100%; border-radius: 999px; background: var(--c3); }
.mco-hb .v { text-align: right; font-weight: 800; } .mco-hb .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.co-head { display: grid; gap: 4px; margin-bottom: 12px; } .co-cust { font-size: 16px; font-weight: 800; } .co-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.co-timeline { display: grid; gap: 0; margin: 12px 0 16px; padding-left: 4px; }
.co-step { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.co-step:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line-strong); }
.co-step .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); flex: none; margin-top: 2px; }
.co-step.done .dot { background: var(--ok); border-color: var(--ok); } .co-step.wait .dot { background: var(--warn-50); border-color: var(--warn); }
.co-step .txt { display: flex; flex-direction: column; gap: 1px; font-size: 13px; } .co-step em { font-style: normal; font-size: 12px; color: var(--accent); }
.co-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.co-line { display: flex; flex-direction: column; font-size: 13px; border-bottom: 1px dashed var(--line); padding-bottom: 5px; min-width: 0; }
.co-line .k { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); } .co-line .v { overflow-wrap: anywhere; }
@media (max-width: 1023px) {
  .mco-charts { grid-template-columns: 1fr; }
  .mco-q { grid-column: auto; } .mco-upload { grid-template-columns: 1fr; } .co-grid { grid-template-columns: 1fr; }
}

/* Mode pemeliharaan (saat admin sinkron database) */
.maint-spin { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--line, rgba(128,128,128,.3)); border-top-color: var(--brand); animation: maint-rot 1s linear infinite; }
@keyframes maint-rot { to { transform: rotate(360deg); } }
.maint-overlay { position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; padding: 24px; text-align: center; background: rgba(8, 10, 20, .86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); color: #fff; }
.maint-box { max-width: 440px; }
.maint-box h2 { margin: 16px 0 8px; font-size: 22px; }
.maint-box p { margin: 6px 0; opacity: .85; line-height: 1.5; }
@media (prefers-reduced-motion: reduce) { .maint-spin { animation-duration: 3s; } }

/* Monitoring CO: kolom Status SO (alasan CO belum diproses) */
.so-txt { font-weight: 600; line-height: 1.35; }
.so-txt.so-masalah { color: var(--bad); } .so-txt.so-tunggu { color: var(--warn); } .so-txt.so-ok { color: var(--ok); }
.mco-so { min-width: 130px; }
