:root{
  --bg:#0b0d12;
  --card:#ffffff;
  --muted:#6b7280;
  --text:#111827;
  --line:#e5e7eb;
  --accent:#d61f26;
  --accent2:#b7141b;
  --shadow: 0 12px 30px rgba(0,0,0,.14);
  --r:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 15% -10%, rgba(214,31,38,.22), transparent 60%),
              radial-gradient(900px 600px at 100% 0%, rgba(214,31,38,.12), transparent 55%),
              #f6f7fb;
  color:var(--text);
}

.topbar{
  position:sticky; top:0; z-index:20;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.topbar-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}
.brand{display:flex; align-items:center; gap:10px}
.brand-dot{width:12px;height:12px;border-radius:999px;background:var(--accent); box-shadow:0 0 0 6px rgba(214,31,38,.12)}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted)}

.nav{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.navlink{
  text-decoration:none;
  color:#111827;
  padding: 9px 12px;
  border-radius: 999px;
  border:1px solid transparent;
}
.navlink:hover{border-color: rgba(214,31,38,.25); background: rgba(214,31,38,.06)}
.container{max-width:1100px;margin:0 auto;padding:18px 16px 42px}

.grid{display:grid; gap:14px}
.grid.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
@media (max-width: 920px){ .grid.cols-3{grid-template-columns:1fr} }

.card{
  background: var(--card);
  border: 1px solid rgba(0,0,0,.06);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card-hd{
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  background: linear-gradient(180deg, rgba(214,31,38,.09), transparent);
}
.card-title{font-weight:800}
.card-sub{font-size:12px; color:var(--muted); margin-top:2px}
.card-bd{padding:14px}

.kpi{display:flex; align-items:center; justify-content:space-between}
.kpi .num{font-size:26px; font-weight:900}
.kpi .lbl{font-size:12px; color:var(--muted)}

.table{
  width:100%;
  border-collapse:collapse;
  border:1px solid var(--line);
  border-radius: 12px;
  overflow:hidden;
}
.table th, .table td{
  padding: 10px 10px;
  border-bottom:1px solid var(--line);
  font-size:14px;
  vertical-align:top;
}
.table th{background:#fafafa; text-align:left; font-size:12px; color:#374151}
.table tr:hover td{background: rgba(214,31,38,.04)}
.table td small{color:var(--muted)}

.btn{
  appearance:none; border:0; cursor:pointer;
  background: var(--accent);
  color:#fff; font-weight:800;
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(214,31,38,.22);
}
.btn:hover{background: var(--accent2)}
.btn.ghost{
  background: transparent;
  color: var(--accent);
  border:1px solid rgba(214,31,38,.25);
  box-shadow:none;
}
.btn.ghost:hover{background: rgba(214,31,38,.06)}

.input, select{
  width:100%;
  padding: 10px 11px;
  border-radius: 12px;
  border:1px solid var(--line);
  outline:none;
  background:#fff;
}
.input:focus, select:focus{
  border-color: rgba(214,31,38,.55);
  box-shadow: 0 0 0 4px rgba(214,31,38,.14);
}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.row > *{flex:1}

.toast{
  display: flow-root;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background:#fff;
}
.toast-success{border-color: rgba(16,185,129,.35); background: rgba(16,185,129,.06)}
.toast-error{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.06)}


.navform{margin:0; display:flex; align-items:center}
.navselect{
  padding: 9px 12px;
  border-radius: 999px;
  border:1px solid rgba(0,0,0,.12);
  background:#fff;
  max-width: 240px;
}
.navselect:focus{
  border-color: rgba(214,31,38,.55);
  box-shadow: 0 0 0 4px rgba(214,31,38,.14);
  outline:none;
}


.pill{
  display:inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border:1px solid rgba(214,31,38,.22);
  background: rgba(214,31,38,.06);
  color: var(--accent2);
  margin-left:8px;
}
.btn.small{padding:7px 10px; font-size: 13px}
.toast-warn{background: rgba(234,179,8,.10); border:1px solid rgba(234,179,8,.30)}


.k{font-size:12px;color:var(--muted); margin-bottom:2px}
.v{font-size:14px}
.toast-info{background: rgba(59,130,246,.10); border:1px solid rgba(59,130,246,.30)}
details summary::-webkit-details-marker{display:none}
details summary:before{content:'▸ '; display:inline-block; margin-right:6px}
details[open] summary:before{content:'▾ ';}



/* Toggle switch (vanilla) */
.switch{position:relative; display:inline-block; width:44px; height:24px; vertical-align:middle}
.switch input{opacity:0; width:0; height:0}
.slider{
  position:absolute; cursor:pointer; inset:0;
  background: rgba(0,0,0,.18);
  border-radius:999px;
  transition: .18s;
}
.slider:before{
  position:absolute; content:"";
  height:18px; width:18px; left:3px; top:3px;
  background:white; border-radius:999px;
  transition: .18s;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.switch input:checked + .slider{ background: rgba(214,31,38,.65); }
.switch input:checked + .slider:before{ transform: translateX(20px); }

.neg{color: var(--accent2); font-weight:700}

/* ===== Mobile Responsive ===== */
@media (max-width: 720px){
  .container{padding:12px 12px 34px}

  /* topbar/nav lebih rapi di mobile */
  .topbar-inner{padding:12px 12px; flex-wrap:wrap; align-items:flex-start}
  .brand{flex:1 1 100%}
  .nav{width:100%; justify-content:flex-start; gap:6px}
  .navlink{padding:8px 10px; font-size:13px}

  /* card header jangan “nge-press” */
  .card-hd{flex-direction:column; gap:10px}
  .card-hd .right{width:100%; display:flex; justify-content:flex-end; gap:8px; flex-wrap:wrap}

  /* table basic tweaks */
  .table th, .table td{padding:9px 8px}
  .table td{word-break:break-word}

  /* === stacked table mode (card per row) === */
  .table.is-stacked{
    border:0;
    border-radius:0;
    overflow:visible;
  }
  .table.is-stacked thead{display:none}
  .table.is-stacked tbody{display:block}
  .table.is-stacked tr{
    display:block;
    margin:10px 0;
    padding:10px 12px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:14px;
    box-shadow:0 6px 16px rgba(0,0,0,.06);
  }
  .table.is-stacked td{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    padding:7px 0;
    border:0;
    border-bottom:1px dashed rgba(0,0,0,.08);
    font-size:13px;
  }
  .table.is-stacked td:last-child{border-bottom:0}
  .table.is-stacked td::before{
    content:attr(data-label);
    flex:0 0 42%;
    max-width:42%;
    padding-right:8px;
    font-size:12px;
    color:var(--muted);
    font-weight:800;
  }
  .table.is-stacked td > *{max-width:58%}
}
