/* Dashboard Assurance Soreang. Graphite ramp (unslop): permukaan netral, satu aksen biru untuk "closed" dan pilihan aktif,
   merah hanya untuk titik live dan tanda lewat TTR. */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e10;
  --surface: #161618;
  --surface-2: #202023;
  --line: rgba(237, 237, 237, .07);
  --shadow: 0 0 0 1px rgba(0, 0, 0, .2);
  --line-2: rgba(237, 237, 237, .14);
  --text: #ededed;
  --text-2: #b4b4ba;
  --muted: #8e8e94;
  --accent: #6d9eea;
  --accent-ink: #9dbcf2;
  --neutral-bar: #4a4a50;
  --neutral-bar-2: #34343a;
  --live: #e5484d;
  --bad: #f08a8e;
  --warn: #e5b43c;
  --ok: #4cc38a;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f2f2f4;
  --line: rgba(23, 23, 23, .07);
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 4px 16px -8px rgba(16, 16, 20, .06);
  --line-2: rgba(23, 23, 23, .14);
  --text: #171717;
  --text-2: #4a4a52;
  --muted: #6b6b73;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --neutral-bar: #b9b9c0;
  --neutral-bar-2: #dcdce0;
  --live: #e5484d;
  --bad: #c8282e;
  --warn: #b45309;
  --ok: #047857;
}
:root {
  --font: 'Geist', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r-card: 20px;
  --r-ctl: 12px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
  font-variant-numeric: tabular-nums;
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- bar ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar-in { max-width: 1440px; margin: 0 auto; height: 60px; padding: 0 32px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.brand img { border-radius: 6px; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; margin-right: 4px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font: 400 12px/1 var(--mono); }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.live.late i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
.live.stale i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--live) 18%, transparent); }
.live.late i { background: var(--warn); }
.live.stale i { background: var(--live); }
.icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s var(--ease), transform .1s var(--ease); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.97); }
.icon-btn .i-sun, [data-theme="light"] .icon-btn .i-moon { display: block; }
.icon-btn .i-moon, [data-theme="light"] .icon-btn .i-sun { display: none; }
.icon-btn.busy { opacity: .5; pointer-events: none; }

/* ---------- page ---------- */
.page { max-width: 1440px; margin: 0 auto; padding: 40px 32px 56px; display: flex; flex-direction: column; gap: 20px; }
.page[aria-busy="true"] .stats, .page[aria-busy="true"] .grid, .page[aria-busy="true"] .table-card { opacity: .35; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 600; letter-spacing: -.03em; }
.sub { margin: 6px 0 0; color: var(--muted); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: 999px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
[data-theme="dark"] .seg button[aria-pressed="true"], :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #2a2a2e; box-shadow: 0 0 0 1px var(--line-2); }

.alert { padding: 12px 16px; border-radius: var(--r-ctl); border: 1px solid color-mix(in srgb, var(--live) 40%, transparent); background: color-mix(in srgb, var(--live) 8%, transparent); color: var(--text); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat .lbl { color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat .fig { margin-top: 12px; font-size: 40px; line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.stat.lead .fig { font-size: 56px; }
.stat .foot-row { margin-top: auto; padding-top: 16px; }
.stat .cmp { margin-top: auto; padding-top: 16px; color: var(--muted); font-size: 13px; }
.stat .cmp b { font-weight: 500; color: var(--text-2); }
.stat .split { margin-top: auto; padding-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.stat .split span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.stat .split span.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.stat .split span.bad b { color: inherit; }
.stat .split b { color: var(--text); font-weight: 500; }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 24px; min-width: 0; box-shadow: var(--shadow); }
.card-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.note { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mini-h { margin: 24px 0 12px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.k { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.k-in { background: var(--neutral-bar-2); }
.k-out { background: var(--accent); height: 2px; border-radius: 1px; width: 14px; }

/* main chart */
.chart { position: relative; height: 280px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--line); }
.chart .axis { fill: var(--muted); font: 400 11px var(--mono); }
.chart .col-in { fill: var(--neutral-bar-2); }
.chart .col-in:hover { fill: var(--neutral-bar); }
.chart .area-out { fill: url(#g-out); }
.chart .col-in.today { fill: transparent; stroke: var(--neutral-bar); stroke-dasharray: 3 3; }
.chart .line-out { fill: none; stroke: var(--accent); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot-out { fill: var(--surface); stroke: var(--accent); stroke-width: 2; opacity: 0; transition: opacity .15s var(--ease); }
.chart .dot-out.last, .chart .dot-out.on { opacity: 1; }
.chart .gridline { stroke-dasharray: 2 4; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .hover-band, .chart .band { fill: var(--surface-2); }
.tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .25); font-size: 12px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; }
.tip b { font-weight: 500; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.tip .r span:last-child { color: var(--text); font-family: var(--mono); }

/* matrix */
.matrix { width: 100%; border-collapse: collapse; }
.matrix th, .matrix td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: right; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix thead th { color: var(--muted); font-weight: 400; font-size: 12px; padding-top: 0; }
.matrix thead .grp { text-align: right; color: var(--text-2); }
.matrix tbody th { font-weight: 500; }
.matrix tbody th small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.matrix td { font: 400 15px var(--mono); }
.matrix td button { border: 0; background: none; padding: 2px 6px; margin-right: -6px; border-radius: 6px; font: inherit; cursor: pointer; }
.matrix td button:hover { background: var(--surface-2); }
.matrix td.closed button { color: var(--muted); }
.matrix tr.total th, .matrix tr.total td { border-bottom: 0; color: var(--text-2); }
.matrix .sep { border-left: 1px solid var(--line); padding-left: 16px; }

/* ranked lists */
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rank li { display: grid; grid-template-columns: 112px 1fr 48px; align-items: center; gap: 12px; }
.rank .name { display: flex; flex-direction: column; font-weight: 500; }
.rank .name small { color: var(--muted); font-size: 12px; }
.rank .track { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; display: flex; }
.rank .track i { display: block; height: 100%; }
.rank .track .b2b { background: var(--accent); }
.rank .track .b2c { background: var(--neutral-bar); }
.rank .v { text-align: right; font-family: var(--mono); }
.rank.compact li { grid-template-columns: 112px 1fr 48px; }
.rank-legend { display: flex; gap: 16px; color: var(--muted); font-size: 12px; margin-top: 16px; }
.rank-legend span { display: inline-flex; align-items: center; gap: 8px; }
.rank-legend i { width: 10px; height: 6px; border-radius: 3px; }

/* age */
.age-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; gap: 3px; }
.age-bar i { display: block; height: 100%; }
.age-rows { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.age-rows div { display: flex; flex-direction: column; gap: 2px; }
.age-rows span { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.age-rows span i { width: 8px; height: 8px; border-radius: 2px; }
.age-rows b { font: 500 22px var(--font); letter-spacing: -.03em; }

/* table */
.list-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.search input { border: 0; background: none; outline: none; width: 200px; color: var(--text); }
.search:focus-within { border-color: var(--line-2); }
.table-wrap { overflow-x: auto; margin: 0 -24px; padding: 0 24px; }
.list { width: 100%; border-collapse: collapse; font-size: 13px; }
.list th { position: sticky; top: 0; text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 0 12px 12px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.list tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.list .num { text-align: right; white-space: nowrap; }
.list .mono { font-family: var(--mono); font-size: 12px; }
.list .cust { max-width: 260px; }
.list .cust small, .list .muted { color: var(--muted); }
.list .cust small { display: block; font-family: var(--mono); font-size: 12px; }
.list .owner { max-width: 220px; color: var(--text-2); }
.tag { display: inline-block; font-size: 12px; color: var(--text-2); padding: 2px 8px; border-radius: 999px; background: var(--surface-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--neutral-bar); }
.chip.done::before { background: var(--ok); }
.chip.late::before { background: var(--bad); }
.tag.b2b { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.over { color: var(--bad); }
.more { display: block; margin: 20px auto 0; padding: 8px 20px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; background: transparent; color: var(--text-2); cursor: pointer; }
.more:hover { background: var(--surface-2); }
[hidden] { display: none !important; }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }
.foot { margin: 0; color: var(--muted); font-size: 12px; text-align: center; }

.page:not([aria-busy="true"]) .stats, .page:not([aria-busy="true"]) .grid { animation: rise .5s var(--ease) both; }
.page:not([aria-busy="true"]) .grid { animation-delay: .06s; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }


/* ---------- kinerja TTR ---------- */
.ttr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px; align-items: start; }
.ttr-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
.ttr-figs .lbl { color: var(--muted); font-size: 13px; }
.ttr-figs .fig { margin-top: 6px; font-size: 32px; line-height: 1; font-weight: 500; letter-spacing: -.04em; }
.ttr-figs .fig small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.ttr-figs .sub2 { margin-top: 6px; color: var(--muted); font-size: 12px; }
.ttr-figs .good { color: var(--ok); }
.ttr-figs .badc { color: var(--bad); }
.ttr-wrap { margin: 0; padding: 0; }
.ttr-sto td, .ttr-sto th { padding-right: 16px; }
.ttr-sto .bar-cell { width: 30%; }
.ttr-sto .mini { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.ttr-sto .mini i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.ttr-sto .mini i.low { background: var(--bad); }

/* ---------- gangguan berulang ---------- */
.rep { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rep li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.rep li:last-child { border-bottom: 0; }
.rep li:hover .who b { text-decoration: underline; text-underline-offset: 3px; }
.rep .x { width: 36px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-2); font: 500 13px var(--mono); }
.rep .x.hot { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }
.rep .who { min-width: 0; }
.rep .who b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep .who small { color: var(--muted); font: 400 12px var(--mono); }
.rep .st { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.rep .st .chip { justify-content: flex-end; }
.rank.wide li { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 48px; }
.rank.wide .name { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

/* ---------- jam lapor ---------- */
.hours { position: relative; height: 180px; }
.hours svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hours .hcol { fill: var(--neutral-bar-2); }
.hours .hcol.peak { fill: var(--accent); }
.hours .axis { fill: var(--muted); font: 400 11px var(--mono); }
.hours .hv { fill: var(--text-2); font: 500 11px var(--mono); }

/* ---------- tombol & detail ---------- */
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 500; cursor: pointer; }
.pill-btn:hover { background: var(--surface-2); }
.list tbody tr { cursor: pointer; }
.drawer { margin: 0 0 0 auto; height: 100%; max-height: 100%; width: min(480px, 100%); padding: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--text); box-shadow: -16px 0 48px -16px rgba(0, 0, 0, .3); }
.drawer::backdrop { background: rgba(10, 10, 12, .35); backdrop-filter: blur(2px); }
.drawer[open] { animation: slide .25s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.dw-in { min-height: 100%; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.dw-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.dw-h h2 { font-size: 20px; margin-top: 4px; }
.dw-list { margin: 0; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13px; }
.dw-list dt { color: var(--muted); }
.dw-list dd { margin: 0; word-break: break-word; }
.dw-list dd.mono { font-family: var(--mono); font-size: 12px; }
.dw-hist h3 { margin: 0 0 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.dw-hist ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
.dw-hist li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--surface-2); }
.dw-hist li span:first-child { font-family: var(--mono); }
@media (max-width: 1100px) { .ttr { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .grid, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bar-in { padding: 0 16px; gap: 12px; }
  .brand span, .live #live-text { display: none; }
  .page { padding: 24px 16px 40px; }
  h1 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat .fig { font-size: 28px; }
  .stat.lead { grid-column: 1 / -1; }
  .stat.lead .fig { font-size: 36px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .rank li { grid-template-columns: 88px 1fr 40px; }
  .age-rows { grid-template-columns: 1fr 1fr; }
  .search input { width: 120px; }
  .chart { height: 220px; }
}

/* ---------- login ---------- */
.login-page { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.lg-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; }
.lg { width: 100%; max-width: 1040px; margin: 0 auto; padding: 24px 32px 64px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 48px 96px; align-content: center; }
.lg-intro { align-self: center; }
.lg-intro h1 { font-size: clamp(32px, 4vw, 48px); line-height: 1.1; letter-spacing: -.02em; }
.lg-intro p { margin: 16px 0 0; max-width: 40ch; color: var(--muted); font-size: 15px; }
.lg-form { align-self: center; padding: 32px; box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); display: flex; flex-direction: column; gap: 16px; }
.lg-form h2 { font-size: 18px; }
.lg-hint { margin: -12px 0 4px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; }
.field input { height: 42px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; }
.field input:focus { outline: none; border-color: var(--accent); }
.pw { position: relative; display: block; }
.pw input { width: 100%; padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle.on { color: var(--text); }
.login-error { margin: 0; color: var(--bad); font-size: 13px; }
.btn-login { height: 42px; border: 0; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-login:disabled { opacity: .6; cursor: default; }
.lg-spin { display: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; }
.btn-login.busy .lg-spin { display: block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lg-foot { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }
@media (max-width: 820px) {
  .lg { grid-template-columns: minmax(0, 1fr); align-content: start; gap: 24px; padding: 8px 20px 48px; }
  .lg-top { padding: 16px 20px; }
  .lg-form { padding: 24px 20px; }
}

/* ---------- angka yang bisa diklik → popup daftar tiket ---------- */
.pick { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: 6px;
  text-decoration: underline dotted color-mix(in srgb, currentColor 35%, transparent); text-decoration-thickness: 1px; text-underline-offset: .18em; transition: color .15s var(--ease); }
.pick:hover { color: var(--accent); text-decoration-color: currentColor; }
.pick:disabled { cursor: default; text-decoration: none; color: inherit; }
.pick.bad { color: var(--bad); }
.fig .pick small { font-size: inherit; }
.ttr-figs .fig .pick small { font-size: 15px; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.stat .split .chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 13px; text-decoration: none; }
.stat .split .chip-btn b { color: var(--text); font-weight: 500; }
.stat .split .chip-btn:hover { background: var(--surface-3, var(--line)); color: var(--text-2); }
.stat .split .chip-btn.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.stat .split .chip-btn.bad b { color: inherit; }
.hours .hhit { fill: transparent; cursor: pointer; }
.hours .hcol { pointer-events: none; }
.hours .hhit:hover + .hcol { fill: var(--neutral-bar); }
.hours .hhit:hover + .hcol.peak { fill: var(--accent); opacity: .85; }

.back-btn { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px -4px; padding: 4px 8px 4px 4px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.back-btn:hover { background: var(--surface-2); color: var(--text); }
.dw-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.dw-rows li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.dw-rows li:last-child { border-bottom: 0; }
.dw-rows li:hover .who b { text-decoration: underline; text-underline-offset: 3px; }
.dw-rows .who { min-width: 0; }
.dw-rows .who b { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dw-rows .who small { color: var(--muted); font: 400 12px var(--mono); }
.dw-rows .st { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }
.dw-rows .st > span { color: var(--text-2); }
.dw-rows .st > span.over { color: var(--bad); }
.dw-rows .st .chip { font-family: var(--font); }
.dw-rows .empty { color: var(--muted); cursor: default; }
.dw-hist li[data-inc] { cursor: pointer; }
.dw-hist li[data-inc]:hover span:first-child { text-decoration: underline; text-underline-offset: 3px; }

/* customer type */
.ct { display: inline-block; font-size: 12px; white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.ct.mid { background: color-mix(in srgb, #b8862e 14%, transparent); color: color-mix(in srgb, #b8862e 85%, var(--text)); }
.ct.top { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* ---------- layout padat (4 Des): 3 kolom, TTR + jam/gejala, berulang 2 kolom ---------- */
.page { max-width: 1680px; padding: 24px 24px 40px; gap: 16px; }
.bar-in { max-width: 1680px; padding: 0 24px; height: 56px; }
.head { margin-bottom: 0; }
h1 { font-size: 26px; }
.stat { padding: 20px; }
.stat .fig { margin-top: 10px; font-size: 36px; }
.stat.lead .fig { font-size: 48px; }
.stat .cmp, .stat .split { padding-top: 12px; }
.card { padding: 20px; }
.card-h { margin-bottom: 14px; }
.mini-h { margin: 18px 0 10px; }
.rank { gap: 10px; }
.chart { height: 260px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-ttr { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.col > .grow { flex: 1; }
.ttr { grid-template-columns: 1fr; gap: 16px; }
.ttr-figs { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.ttr-figs > div { padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); }
.ttr-figs .fig { font-size: 30px; }
.ttr-sto td, .ttr-sto th { padding-top: 8px; padding-bottom: 8px; }
.list td { padding: 10px 12px 10px 0; }
.table-wrap { margin: 0 -20px; padding: 0 20px; }
.ttr-wrap { margin: 0; padding: 0; }
.rep.two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
.rep.two li:last-child { border-bottom: 1px solid var(--line); }
.rep li { padding: 8px 0; }
.hours { height: 160px; }
@media (max-width: 1280px) { .grid-3 { grid-template-columns: 1fr 1fr; } .grid-ttr { grid-template-columns: 1fr; } }
@media (max-width: 1100px) { .ttr-figs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .grid-3, .rep.two { grid-template-columns: 1fr; } }

/* ---------- KPI, penyebab, gamas, teknisi (fungsi ala AMEL ROC3) ---------- */
.kpi td, .kpi th, .sebab td, .sebab th, .tek td, .tek th { padding: 8px 10px 8px 0; vertical-align: middle; }
.kpi td b { display: block; font-weight: 500; }
.kpi td small { display: block; color: var(--muted); font-size: 12px; }
.kpi-real { display: inline-block; min-width: 56px; padding: 2px 8px; border-radius: 999px; font-weight: 600; text-align: center; }
.kpi-real.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.kpi-real.no { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.ok-t { color: var(--ok); }
.bad-t { color: var(--bad); }
.sebab-k { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep.gm li { grid-template-columns: 44px minmax(0, 1fr); cursor: default; }
.rep.gm .x { width: 44px; }
.rep.gm .x .pick { width: 100%; height: 100%; }
.age-rows { grid-template-columns: repeat(5, 1fr); }
.note .pick.bad { color: var(--bad); }
.rep li.empty { display: block; grid-column: 1 / -1; padding: 12px 0; border-bottom: 0; text-align: left; cursor: default; }

/* ---------- KPI tile (presisi 2 desimal, garis target) ---------- */
.kpi-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-tiles .empty { grid-column: 1 / -1; }
.kt { padding: 18px 20px; border-radius: 18px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.kt-h b { display: block; font-weight: 600; font-size: 15px; }
.kt-h span { color: var(--muted); font-size: 12px; }
.kt-fig { font: 600 34px/1 var(--display, var(--font)); letter-spacing: -.02em; }
.kt-fig small { font-size: 17px; color: var(--muted); margin-left: 2px; font-weight: 500; }
.kt.ok .kt-fig { color: var(--ok); }
.kt.no .kt-fig { color: var(--bad); }
.kt-bar { position: relative; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); }
.kt-bar i { display: block; height: 100%; border-radius: 3px; background: var(--ok); }
.kt.no .kt-bar i { background: var(--bad); }
.kt-bar u { position: absolute; top: -4px; width: 2px; height: 14px; margin-left: -1px; border-radius: 1px; background: var(--text); text-decoration: none; }
.kt-f { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.kt-f .gap { font-weight: 600; }
.kt.ok .kt-f .gap { color: var(--ok); }
.kt.no .kt-f .gap { color: var(--bad); }
.kt-n { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.kt-n > span { color: var(--muted); }
/* Penyebab + Gamas sejajar, Gamas dua kolom supaya tinggi seimbang */
.grid-2.eq { align-items: stretch; }
.gm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mini-h.first { margin-top: 0; }
.rep.gm li { padding: 8px 0; }
.sebab td, .sebab th { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 1100px) { .kpi-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .kpi-tiles, .gm-cols { grid-template-columns: 1fr; } }
.rank li.rank-more { display: block; font-size: 13px; color: var(--text-2); }
/* kolom kanan TTR: kartu Jam lapor menyerap sisa tinggi (grafik ikut memanjang) */
.col > .grow { display: flex; flex-direction: column; }
.col > .grow .hours { flex: 1; min-height: 160px; height: auto; }
/* baris sejajar: isi kartu yang lebih pendek dibagi rata, bukan menyisakan lubang di bawah */
.matrix-card, .grid-3 > .card { display: flex; flex-direction: column; }
.matrix-card .matrix { flex: 1; }
.grid-3 > .card > .mini-h { margin-top: auto; padding-top: 20px; }
.grid-2.eq > .card { display: flex; flex-direction: column; }
.grid-2.eq > .card > .ttr-wrap { flex: 1; display: flex; flex-direction: column; }
.grid-2.eq .sebab { flex: 1; }
/* tabel KPI FBB / BGES ala AMEL */
.kpi-wrap { overflow-x: auto; }
.kpi-t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.kpi-t th, .kpi-t td { padding: 10px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
.kpi-t .num { text-align: right; }
.kpi-t thead th { font-weight: 600; font-size: 12px; color: var(--text-2); vertical-align: bottom; }
.kpi-t thead th small { display: block; font-weight: 400; color: var(--muted); }
.kpi-t .kt-tgt th { font-size: 13px; color: var(--muted); font-weight: 500; padding-top: 4px; }
.kpi-t tbody th { font-weight: 500; }
.kpi-t td small { display: block; font-size: 12px; color: var(--muted); }
.kpi-t .kv { font-weight: 600; font-size: 15px; }
.kpi-t .kv.none { color: var(--muted); font-weight: 400; }
.kpi-t td.no .kv { color: var(--bad); }
.kpi-t .kt-total th, .kpi-t .kt-total .kv { font-weight: 700; }
.kpi-t .kt-total { background: var(--surface-2); }
.kpi-t .kt-sto th { padding-left: 32px; color: var(--muted); font-weight: 400; }
.kpi-t .kt-sto .kv { font-weight: 500; }
.kt-tog { all: unset; cursor: pointer; font-weight: 600; }
.kt-tog::before { content: '›'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.kt-tog[aria-expanded="true"]::before { transform: rotate(90deg); }
.kt-tog:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
/* matrix: pemisah Customer | Proactive cukup jarak (tanpa garis vertikal), judul kelompok bergaris bawah tipis */
.matrix .sep { border-left: 0; padding-left: 32px; }
.matrix thead .grp { background: linear-gradient(var(--line-2), var(--line-2)) right bottom / 100% 1px no-repeat; }
.matrix thead .grp.sep { background-size: calc(100% - 32px) 1px; }

/* ================= atas ala dashboard provisioning: kartu HSA, hero, klasemen, strip ================= */
:root, [data-theme="light"] {
  --h-banjaran: #0e7490; --h-majalaya: #6d28d9; --h-majalengka: #be185d; --h-njg: #b45309; --h-kpo: #15803d; --h-lain: #6e6e73;
}
[data-theme="dark"] {
  --h-banjaran: #4fbdd1; --h-majalaya: #a596ea; --h-majalengka: #e07fac; --h-njg: #e8b54a; --h-kpo: #5fc77f; --h-lain: #98989d;
}
.hbar, .hero, .strip { --ease: cubic-bezier(.22, 1, .36, 1); }
.hbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.htab { all: unset; box-sizing: border-box; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.htab:hover { transform: translateY(-2px); }
.htab:active { transform: scale(.985); }
.htab:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.htab[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--c); }
.htab-n small, .htab-v small { display: block; font-size: 12px; color: var(--muted); }
.htab-n b { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin-top: 2px; }
.htab-n b i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.htab-v { text-align: right; }
.htab-v b { font: 600 24px/1.1 var(--display, var(--font)); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.eyebrow { margin: 0; font-size: 13px; color: var(--muted); }
.hero-main .giant { margin-top: 12px; font: 600 112px/.95 var(--display, var(--font)); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.hero-main .giant em { font-style: normal; font-size: .42em; color: var(--c); margin-left: 4px; letter-spacing: 0; }
.giant-sub { margin: 12px 0 0; color: var(--text-2); font-size: 15px; }
.giant-sub b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.giant-sub .delta { margin-left: 8px; font-size: 13px; font-weight: 600; }
.giant-sub .delta.up { color: var(--ok); }
.giant-sub .delta.down { color: var(--bad); }
.meter { position: relative; height: 10px; margin: 36px 0 20px; border-radius: 5px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; transition: width 1s var(--ease); }
.meter .m-fill { background: var(--c); }
.meter .m-est { background: color-mix(in srgb, var(--c) 28%, transparent); }
.meter .m-mark { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--text); text-decoration: none; }
.meter .m-mark span { position: absolute; bottom: calc(100% + 4px); right: 0; font-size: 12px; color: var(--muted); white-space: nowrap; }
.hero-figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.hero-figs > div { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); transition: transform .25s var(--ease); }
.hero-figs > div:hover { transform: translateY(-2px); }
.hero-figs .pick { font: 600 30px/1.1 var(--display, var(--font)); letter-spacing: -.02em; font-variant-numeric: tabular-nums; padding: 0; }
.hero-figs span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.hero-figs .bad .pick { color: var(--bad); }
.hero-figs .ok .pick { color: var(--ok); }

.race .card-h { align-items: flex-start; }
.race-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.race-row { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px 12px; border-radius: 16px; transition: background .25s var(--ease); }
.race-row:hover { background: var(--surface-2); }
.race-row:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.race-row[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 10%, transparent); }
.race-rank { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-weight: 600; background: var(--surface-2); }
.race-list li:first-child .race-rank { background: var(--c); color: #fff; }
.race-name { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.race-name b { font-size: 16px; font-weight: 600; }
.race-stats { display: flex; gap: 12px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.race-stats em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); margin-right: 4px; }
.race-stats .bad { color: var(--bad); }
.race-track { position: relative; display: block; height: 8px; margin-top: 10px; border-radius: 4px; background: color-mix(in srgb, var(--text) 8%, transparent); }
.race-track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; transition: width 1s var(--ease); }
.race-track .r-fill { background: var(--c); }
.race-track .r-est { background: color-mix(in srgb, var(--c) 28%, transparent); }
.race-track u { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 1px; }
.race-val { text-align: right; }
.race-val b { display: block; font: 600 28px/1.1 var(--display, var(--font)); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.race-val small { font-size: 12px; color: var(--muted); }

.strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 16px 16px 14px; border-radius: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; min-width: 0;
  transition: transform .25s var(--ease); }
.tile:hover { transform: translateY(-2px); }
.tile-l { font-size: 13px; color: var(--text-2); }
.tile-n, .tile-n .pick { font: 600 34px/1 var(--display, var(--font)); letter-spacing: -.02em; font-variant-numeric: tabular-nums; padding: 0; }
.tile-n small { font-size: .5em; color: var(--muted); margin-left: 2px; }
.tile.bad .tile-n .pick { color: var(--bad); }
.tile-split { display: flex; gap: 2px; height: 4px; border-radius: 2px; overflow: hidden; }
.tile-split i { min-width: 2px; transition: opacity .25s, flex-grow .8s var(--ease); }
.tile-sa { display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; padding-top: 6px; border-top: 1px solid var(--line); }
.tile-sa span { display: inline-flex; align-items: center; gap: 4px; transition: opacity .25s; }
.tile-sa i { width: 6px; height: 6px; border-radius: 50%; }
.dim { opacity: .3; }

@media (max-width: 1400px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .hero { grid-template-columns: 1fr; } .hero-main .giant { font-size: 88px; } }
@media (max-width: 640px) { .strip { grid-template-columns: 1fr 1fr; } .hero-figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero-main .giant { font-size: 64px; } }
@media (prefers-reduced-motion: reduce) { .htab, .hero-figs > div, .tile, .meter i, .race-track i, .race-row { transition: none; } .htab:hover, .tile:hover, .hero-figs > div:hover { transform: none; } }
.page:not([aria-busy="true"]) .hbar, .page:not([aria-busy="true"]) .hero, .page:not([aria-busy="true"]) .strip { animation: rise .5s var(--ease) both; }
.page:not([aria-busy="true"]) .hero { animation-delay: .05s; }
.page:not([aria-busy="true"]) .strip { animation-delay: .1s; }
.page[aria-busy="true"] .hbar, .page[aria-busy="true"] .hero, .page[aria-busy="true"] .strip { opacity: .35; }
/* hero: rincian tiap poin KPI */
.kpi-figs .pick { font-size: 24px; }
.kpi-figs .none { opacity: .55; }
.kpi-figs .none > :first-child { font: 600 24px/1.1 var(--display, var(--font)); color: var(--muted); }
.race-miss { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter .m-mark span { right: 0; }

