:root {
  --brand: #1e6a6a; --brand-d: #175454; --brand-t: #e0eeee;
  --success: #2e7d32; --success-t: #e6f3e7; --success-x: #1b5e20;
  --warning: #f57f17; --warning-t: #fff1de; --warning-x: #7a4100;
  --danger: #c62828; --danger-t: #fbe9e9; --danger-x: #8e1b1b;
  --info: #1565c0; --info-t: #e2eefa; --info-x: #0d47a1;
  --bg: #f2f5f5; --surface: #fff; --side: #e9efef;
  --text: #1c2a2b; --muted: #50666a; --line: #d9e1e2; --line-s: #e8eded; --hover: #f2f6f6;
  --r-s: 4px; --r-m: 8px; --r-l: 12px;
  --ease: cubic-bezier(.25,1,.5,1);
  --z-sticky: 20; --z-drawer: 60; --z-toast: 80;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5cbcbc; --brand-d: #86d0d0; --brand-t: #183839;
    --success: #6fc274; --success-t: #17301a; --success-x: #a9dbac;
    --warning: #ffa726; --warning-t: #3a2a10; --warning-x: #ffcc80;
    --danger: #ef6b68; --danger-t: #3a1a1a; --danger-x: #f5a5a3;
    --info: #64b5f6; --info-t: #14293d; --info-x: #93caf9;
    --bg: #0e1617; --surface: #152022; --side: #111b1c;
    --text: #e8eeee; --muted: #9db3b6; --line: #2a3a3d; --line-s: #203033; --hover: #1a2a2c;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.5 "Plus Jakarta Sans", system-ui, sans-serif; word-spacing: .06em; font-variant-numeric: tabular-nums; }
button, input, select { font: inherit; word-spacing: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: var(--r-s); z-index: 100; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
#main:focus { outline: none; }

/* shell */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 12px 24px; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-m); background: var(--brand); color: #fff; flex: none; }
@media (prefers-color-scheme: dark) { .logo { color: #06201f; } }
.side-title { font-weight: 700; font-size: 15px; }
.nav-group { margin-top: 16px; }
.nav-group > p { padding: 0 8px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px; border-radius: var(--r-m); color: var(--text); text-decoration: none; transition: background-color .15s var(--ease); }
.nav-link:hover { background: var(--hover); }
.nav-link[aria-current="page"] { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 600; }
.nav-link[aria-current="page"] .fk { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { .nav-link[aria-current="page"] .fk { color: #06201f; } }
.fk { flex: none; display: grid; place-items: center; min-width: 30px; height: 22px; padding: 0 4px; border-radius: var(--r-s); background: var(--line-s); color: var(--muted); font-size: 11px; font-weight: 700; }
.nav-name { flex: 1; min-width: 0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-n { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nav-late { min-width: 20px; text-align: center; font-size: 11px; font-weight: 700; color: var(--warning-x); background: var(--warning-t); padding: 1px 6px; border-radius: 999px; }
.col { min-width: 0; }
.top { position: sticky; top: 0; z-index: var(--z-sticky); display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.filters { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); flex: 1 1 240px; max-width: 340px; color: var(--muted); }
.search:focus-within { border-color: var(--brand); outline: 3px solid var(--info); outline-offset: 1px; }
.search input { border: 0; background: none; outline: none; width: 100%; min-height: 40px; color: var(--text); }
.search input::placeholder { color: var(--muted); }
select { min-height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2350666a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; cursor: pointer; }
select:hover { border-color: var(--brand); }
main { padding: 24px; max-width: 1480px; }

/* buttons */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid transparent; font-weight: 600; cursor: pointer; touch-action: manipulation; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
@media (prefers-color-scheme: dark) { .btn.primary, .btn.primary:hover { color: #06201f; } }
.btn.line { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn.line:hover { border-color: var(--brand); background: var(--brand-t); }
.btn.quiet { background: none; color: var(--brand-d); }
.btn.quiet:hover { background: var(--brand-t); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.menu-btn { display: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* page header */
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumb a { color: var(--brand-d); text-decoration: none; }
.crumb a:hover { text-decoration: underline; }
h1 { font-size: 22px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.lead { margin-top: 4px; color: var(--muted); max-width: 68ch; text-wrap: pretty; }
.rule { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.rule b { color: var(--text); font-weight: 600; }

/* summary strip (bukan kartu metrik): satu baris ringkas */
.sum { display: flex; flex-wrap: wrap; gap: 8px 32px; padding: 12px 16px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.sum div { display: flex; align-items: baseline; gap: 8px; }
.sum dt { color: var(--muted); font-size: 13px; }
.sum dd { margin: 0; font-weight: 700; font-size: 16px; }
.sum dd.warn { color: var(--warning-x); }

/* overview layout */
.ov { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.panel-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; }
.panel-h h2 { font-size: 15px; font-weight: 700; }
.panel-h p { font-size: 12.5px; color: var(--muted); }

.fhead, .frow { display: grid; grid-template-columns: 34px 150px minmax(80px, 1fr) 36px 48px 84px; align-items: center; gap: 10px; padding: 0 16px; }
.fhead { min-height: 32px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--bg); border-block: 1px solid var(--line); }
.fhead span:nth-child(4), .fhead span:nth-child(5) { text-align: right; }
.frow { min-height: 48px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-s); transition: background-color .15s var(--ease); }
.frow:last-child { border-bottom: 0; }
.frow:hover { background: var(--hover); }
.fname { font-weight: 600; line-height: 1.25; }
.ftrack { position: relative; height: 12px; border-radius: 3px; background: var(--line-s); overflow: hidden; }
.ftrack i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; }
.ftrack .reach { background: var(--info-t); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 40%, transparent); }
.ftrack .now { background: var(--info); }
.ph-trial .ftrack .reach { background: var(--warning-t); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 45%, transparent); }
.ph-trial .ftrack .now { background: var(--warning); }
.ph-live .ftrack .reach { background: var(--success-t); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 40%, transparent); }
.ph-live .ftrack .now { background: var(--success); }
.fnum { text-align: right; font-weight: 700; font-size: 15px; }
.fconv { text-align: right; font-size: 12.5px; color: var(--muted); }
.flate { font-size: 12px; font-weight: 600; color: var(--warning-x); }
.flate.none { color: var(--muted); font-weight: 400; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 16px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }

.queue { list-style: none; margin: 0; padding: 0; }
.q-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line-s); }
.q-name { font-weight: 600; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; color: var(--text); }
.q-name:hover { text-decoration: underline; }
.q-sub { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.q-sub b { color: var(--warning-x); font-weight: 600; }
.q-item .btn { grid-column: 2; grid-row: 1 / span 2; }

/* tables */
.tw { overflow: auto; max-height: calc(100vh - 290px); min-height: 160px; }
.tw:focus-visible { outline-offset: -3px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { position: sticky; top: 0; z-index: 2; text-align: left; padding: 0 12px; height: 38px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
td { padding: 8px 12px; border-bottom: 1px solid var(--line-s); vertical-align: middle; }
tbody tr { transition: background-color .15s var(--ease); cursor: pointer; }
tbody tr:hover { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
.who { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-weight: 600; color: var(--text); line-height: 1.3; }
.who:hover { text-decoration: underline; }
.sub { display: block; font-size: 12.5px; color: var(--muted); }
.det { max-width: 240px; line-height: 1.35; }
.dwell { font-weight: 600; }
.dwell small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.dwell.late { color: var(--warning-x); }
.dwell.late small { color: var(--warning-x); }
.act { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.wa { display: inline-grid; place-items: center; width: 44px; height: 44px; margin: -4px 0; border-radius: var(--r-m); color: var(--success); transition: background-color .15s var(--ease); }
.wa:hover { background: var(--success-t); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge.info { background: var(--info-t); color: var(--info-x); } .badge.info svg { color: var(--info); }
.badge.warning { background: var(--warning-t); color: var(--warning-x); } .badge.warning svg { color: var(--warning); }
.badge.success { background: var(--success-t); color: var(--success-x); } .badge.success svg { color: var(--success); }
.badge.danger { background: var(--danger-t); color: var(--danger-x); } .badge.danger svg { color: var(--danger); }
.rating { font-weight: 700; }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty p { max-width: 48ch; margin: 0 auto 16px; }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgb(0 0 0 / .08); z-index: var(--z-drawer); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.d-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
.d-h h2 { font-size: 17px; line-height: 1.3; }
.d-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 20px; align-content: start; }
.d-f { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.next { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); }
.next p { margin: 2px 0 10px; }
.next h3, .d-body h3 { font-size: 13px; font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 8px 0 0; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; min-height: 30px; font-size: 13px; color: var(--muted); }
.steps .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; background: var(--surface); }
.steps li.done { color: var(--text); } .steps li.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.steps li.cur { color: var(--text); font-weight: 700; } .steps li.cur .dot { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-t); }
.steps li.cur .dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.steps time { font-size: 12px; font-weight: 400; color: var(--muted); }

.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: calc(var(--z-drawer) - 10); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: var(--r-m); font-weight: 600; z-index: var(--z-toast); max-width: calc(100% - 32px); }

@media (max-width: 1279px) { .ov { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: var(--z-drawer); width: 288px; transform: translateX(-100%); transition: transform .22s var(--ease); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 12px 16px; } main { padding: 16px; }
  .tw { max-height: none; }
}
@media (max-width: 767px) {
  .top { flex-wrap: wrap; }
  .filters { order: 3; flex: 1 1 100%; }
  .search { max-width: none; flex-basis: 100%; }
  .filters .sel { flex: 1 1 140px; } .filters select { width: 100%; }
  #addBtn { margin-left: auto; }
  .fhead { display: none; }
  .frow { grid-template-columns: 32px 1fr 36px; row-gap: 4px; padding: 10px 16px; }
  .frow .ftrack { grid-column: 1 / -1; grid-row: 2; }
  .frow .fconv, .frow .flate { grid-row: 3; text-align: left; }
  .frow .fconv { grid-column: 1 / 3; } .frow .flate { grid-column: 3; text-align: right; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table, tbody, tr, td { display: block; }
  tbody tr { padding: 12px 16px; border-bottom: 1px solid var(--line-s); display: grid; gap: 6px; }
  td { padding: 0; border: 0; } td.r { text-align: left; } .det { max-width: none; }
  .act { justify-content: flex-start; }
  .drawer { width: 100%; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
