:root {
  --bg: #0f172a;
  --panel: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #1d4ed8;
  --brand-2: #0ea5e9;
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --ink: #0f172a;
  --soft: #f8fafc;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f1f5f9; color: var(--ink); font-size: 14px; line-height: 1.45;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; background: linear-gradient(180deg, #0b1220 0%, #111c34 100%);
  color: #cbd5e1; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; padding: 0 6px; }
.brand-logo { width: 69px; height: 57px; object-fit: contain; flex: 0 0 69px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.login-logo { width: 96px; height: 79px; object-fit: contain; flex: 0 0 96px; }
html.sidebar-collapsed .brand-logo { width: 60px; height: 49.5px; flex-basis: 60px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: .5px;
}
.brand-title { color: #fff; font-weight: 700; font-size: 15px; line-height: 1.1; }
.brand-sub { color: #94a3b8; font-size: 11px; }
.nav-section { color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; margin: 18px 8px 6px; }
.nav a {
  display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px;
  color: #cbd5e1; font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: #1e293b; text-decoration: none; color: #fff; }
.nav a.active { background: #1d4ed8; color: #fff; }
.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 17px; margin: 0; }
.topbar .who { color: var(--muted); font-size: 12px; }
.content { width: 100%; max-width: none; padding: 24px 26px 60px; }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) { .layout { display: block; } .sidebar { width: auto; height: auto; position: static; } .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.card h2, .card h3 { margin: 0 0 10px; }
.card h2 { font-size: 15px; }
.card h3 { font-size: 13px; }
.stat { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: #e2e8f0; color: #334155;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }
.badge.info { background: #dbeafe; color: #1e40af; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--soft); }
.table tr:hover td { background: #f8fafc; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; background: var(--brand); color: #fff;
  border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn.danger { background: var(--err); }
.btn.warn { background: var(--warn); }
.btn.sm { padding: 5px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.form-row { display: grid; gap: 6px; margin-bottom: 12px; }
.form-row label { font-size: 12px; font-weight: 600; color: #334155; }
input, select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 120px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #bfdbfe; border-color: var(--brand); }
.inline { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.inline > * { flex: 0 0 auto; }
.grow { flex: 1 1 220px; }
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.flash.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash.error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash.info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 7px 12px; border: 1px solid var(--line); background: #fff; border-radius: 999px; font-weight: 600; font-size: 12px; }
.tab.active { background: #0f172a; color: #fff; border-color: #0f172a; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.code { background: #0b1220; color: #e2e8f0; padding: 12px; border-radius: 10px; overflow: auto; font-size: 12px; }
.hint { font-size: 12px; color: var(--muted); }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.empty { padding: 24px; text-align: center; color: var(--muted); border: 1px dashed #cbd5e1; border-radius: 10px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: var(--brand); border-radius: 50%; animation: sp 1s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(900px 500px at 20% 10%, #1e3a8a55, transparent), #0b1220; }
.login-card { width: min(400px, 92vw); background: #fff; border-radius: 16px; padding: 26px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 42px; }
.pw-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; cursor: pointer; font-size: 16px;
  padding: 4px 7px; border-radius: 6px; line-height: 1;
}
.pw-eye:hover { background: #e2e8f0; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); display: none;
  place-items: center; z-index: 50; padding: 20px;
}
.modal-backdrop.show { display: grid; }
.modal-card {
  background: #fff; border-radius: 14px; padding: 20px; width: min(460px, 94vw);
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
}
.secret-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px;
  background: #0b1220; color: #e2e8f0; padding: 12px 14px; border-radius: 10px;
  word-break: break-all; margin: 12px 0;
}
.avatar-wrap {
  position: relative; width: 48px; height: 48px; flex: 0 0 48px;
  border-radius: 50%; overflow: hidden; background: #e2e8f0;
  display: grid; place-items: center; border: 1px solid #fff;
  box-shadow: 0 1px 4px rgba(15,23,42,.10);
}
.avatar-wrap .initials { font-weight: 800; color: #475569; font-size: 14px; }
.avatar-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person-head { display: flex; gap: 10px; align-items: flex-start; }
.range-value {
  display: inline-block; min-width: 38px; text-align: center;
  font-weight: 700; font-size: 12px; color: #fff;
  background: #16a34a; border-radius: 999px; padding: 2px 8px;
}
input[type="range"].score-range {
  width: 100%; height: 6px; padding: 0; border: 0; background: transparent;
  accent-color: #16a34a; cursor: pointer;
}
/* SIPK context header */
.sipk-switcher { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.sipk-switcher label { font-size:12px; color:#64748b; }
.sipk-switcher select { width:auto; min-width:260px; }
.sipk-head {
  background:#fff; border:1px solid #e2e8f0; border-radius:14px; overflow:hidden;
  box-shadow: 0px 0px 0px 1px rgba(0,0,0,.03), 0px 1px 1px -.5px rgba(0,0,0,.04),
              0px 3px 3px -1.5px rgba(0,0,0,.04), 0px 6px 6px -3px rgba(0,0,0,.04),
              0px 12px 12px -6px rgba(0,0,0,.04);
}
.sipk-head-top { display:flex; align-items:center; justify-content:flex-end; gap:18px; padding:10px 14px; }
.sipk-kicker { font-size:11px; color:#64748b; letter-spacing:.02em; }
.sipk-title { font-size:20px; font-weight:750; letter-spacing:-.02em; line-height:1.2; margin-top:2px; }
.sipk-sub { display:flex; align-items:center; gap:7px; margin-top:4px; font-size:12px; color:#475569; }
.sipk-dot { width:8px; height:8px; border-radius:50%; background:#94a3b8; display:inline-block; }
.sipk-dot.ok { background:#16a34a; }
.sipk-dot.warn { background:#d97706; }
.sipk-dot.err { background:#dc2626; }
.sipk-tools { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.sipk-period { display:flex; gap:6px; margin:0; }
.sipk-period select { width:auto; }
.sipk-context { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid #e2e8f0; }
.sipk-person { display:flex; gap:12px; padding:16px 18px; align-items:flex-start; }
.sipk-person.sipk-pp { border-left:1px solid #e2e8f0; }
.sipk-person-body { min-width:0; flex:1; }
.sipk-label { font-size:11px; color:#64748b; margin-bottom:3px; }
.sipk-name { font-size:15px; font-weight:700; letter-spacing:-.01em; line-height:1.25; }
.sipk-meta { font-size:12px; color:#64748b; line-height:1.5; margin-top:2px; overflow-wrap:break-word; }
.sipk-change { margin-top:6px; }
.sipk-change summary { font-size:12px; color:var(--brand); cursor:pointer; }
.sipk-tabs { display:flex; gap:20px; border-bottom:1px solid #e2e8f0; margin:18px 0 16px; }
.sipk-tab { padding:9px 1px 10px; font-size:13px; font-weight:600; color:#475569; border-bottom:2px solid transparent; }
.sipk-tab:hover { color:#0f172a; text-decoration:none; }
.sipk-tab.active { color:#0f172a; border-bottom-color:#1d4ed8; }
@media (max-width: 820px) {
  .sipk-head-top { flex-direction:column; }
  .sipk-tools { justify-content:flex-start; }
  .sipk-context { grid-template-columns:1fr; }
  .sipk-person.sipk-pp { border-left:0; border-top:1px solid #e2e8f0; }
}
.metric-band {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr));
  background:#fff; border:1px solid #e2e8f0; border-radius:12px; overflow:hidden;
}
.metric { padding:14px 16px; border-left:1px solid #e2e8f0; }
.metric:first-child { border-left:0; }
.metric span { display:block; font-size:11px; color:#64748b; }
.metric strong { display:block; font-size:24px; line-height:1.2; letter-spacing:-.02em; font-variant-numeric:tabular-nums; }
.metric small { display:block; font-size:11px; color:#64748b; margin-top:2px; }
@media (max-width: 820px) {
  .metric-band { grid-template-columns:1fr 1fr; }
  .metric:nth-child(3) { border-left:0; }
  .metric:nth-child(n+3) { border-top:1px solid #e2e8f0; }
}
.menu-dot {
  width: 8px; height: 8px; border-radius: 50%; margin-left: auto;
  background: #475569; display: inline-block; flex: 0 0 8px;
}
.menu-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.menu-dot.warn { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.16); }
.menu-dot.off { background: #475569; }
.sipk-dot.off { background: #94a3b8; }
.menu-dot.err { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.16); }
.score-badge {
  display: inline-flex; align-items: center; padding: 2px 9px;
  border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff;
}
.score-badge.red { background: #dc2626; }
.score-badge.orange { background: #ea580c; }
.score-badge.green { background: #16a34a; }
.sipk-error {
  display: inline-flex; align-items: center; gap: 6px; max-width: 480px;
  color: #b91c1c; font-size: 12px; line-height: 1.35;
}
.sipk-error a { color: #b91c1c; text-decoration: underline; white-space: nowrap; }

/* Kategori resmi ABK (Perkap 9/2021) */
.cat-badge { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:999px; font-weight:700; font-size:12px; }
.cat-badge.cat-a { background:#dcfce7; color:#14532d; border:1px solid #86efac; }
.cat-badge.cat-b { background:#d1fae5; color:#065f46; border:1px solid #6ee7b7; }
.cat-badge.cat-c { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.cat-badge.cat-d { background:#ffedd5; color:#9a3412; border:1px solid #fdba74; }
.cat-badge.cat-e { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }
.abk-score { display:flex; align-items:center; gap:14px; }
.abk-score-code { width:58px; height:58px; border-radius:16px; display:flex; align-items:center; justify-content:center; font-size:30px; font-weight:800; }
.abk-score-code.cat-a { background:#dcfce7; color:#14532d; }
.abk-score-code.cat-b { background:#d1fae5; color:#065f46; }
.abk-score-code.cat-c { background:#fef3c7; color:#92400e; }
.abk-score-code.cat-d { background:#ffedd5; color:#9a3412; }
.abk-score-code.cat-e { background:#fee2e2; color:#991b1b; }
.abk-score-value { font-size:26px; font-weight:800; line-height:1.1; }

.table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }

/* Cegah grid item melebar mengikuti tabel lebar */
.grid > * { min-width: 0; }

/* Sidebar collapse */
.sidebar { transition: width .2s ease, padding .2s ease; }
.brand-text { min-width: 0; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-label { white-space: nowrap; }
.nav a { position: relative; }
.sidebar-toggle {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  margin: 0 0 14px auto; padding: 0; border: 1px solid #334155; border-radius: 8px;
  background: #1e293b; color: #cbd5e1; cursor: pointer; flex: 0 0 36px;
}
.sidebar-toggle:hover { background: #273449; color: #fff; }
.sidebar-toggle:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
html.sidebar-collapsed .sidebar { width: 88px; padding-left: 10px; padding-right: 10px; }
html.sidebar-collapsed .brand { justify-content: center; padding: 0; }
html.sidebar-collapsed .brand-text,
html.sidebar-collapsed .nav-section,
html.sidebar-collapsed .nav-label { display: none; }
html.sidebar-collapsed .sidebar-toggle { margin: 0 auto 14px; padding: 0; }
html.sidebar-collapsed .sidebar-toggle .nav-icon { transform: rotate(180deg); }
html.sidebar-collapsed .nav a { justify-content: center; padding: 10px 0; }
html.sidebar-collapsed .menu-dot { position: absolute; top: 8px; right: 10px; }
@media (max-width: 720px) {
  .sidebar-toggle { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* Loading overlay untuk operasi AI / proses panjang */
.bdo-loading {
  position: fixed; inset: 0; z-index: 9999;
  display: none; align-items: center; justify-content: center;
  padding: 20px; background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(3px);
}
.bdo-loading.show { display: flex; }
.bdo-loading-card {
  width: min(360px, 100%); padding: 26px 24px; border-radius: 16px;
  background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  text-align: center;
}
.bdo-spinner {
  width: 38px; height: 38px; margin: 0 auto 14px;
  border: 3px solid #dbeafe; border-top-color: #2563eb;
  border-radius: 50%; animation: bdo-spin .8s linear infinite;
}
.bdo-loading-text { font-weight: 700; color: #0f172a; margin-bottom: 4px; }
@keyframes bdo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .bdo-spinner { animation-duration: 1.6s; }
}

/* Toast untuk pesan flash (mis. hasil draft AI) */
.bdo-toast-wrap {
  position: fixed; top: 18px; right: 18px; z-index: 9998;
  width: min(440px, calc(100vw - 28px));
}
.bdo-toast {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 12px 12px 14px; border-radius: 12px;
  background: #fff; border: 1px solid #e2e8f0;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .18);
  animation: bdo-toast-in .22s ease-out;
}
.bdo-toast.hide { opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease; }
.bdo-toast-mark { width: 4px; align-self: stretch; border-radius: 999px; background: #2563eb; flex: 0 0 4px; }
.bdo-toast.success .bdo-toast-mark { background: #16a34a; }
.bdo-toast.warning .bdo-toast-mark { background: #d97706; }
.bdo-toast.error .bdo-toast-mark { background: #dc2626; }
.bdo-toast.info .bdo-toast-mark { background: #2563eb; }
.bdo-toast-body { flex: 1; font-size: 13px; line-height: 1.45; color: #0f172a; }
.bdo-toast-close {
  border: 0; background: transparent; color: #64748b; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 0 2px; min-width: 28px; min-height: 28px;
}
.bdo-toast-close:hover { color: #0f172a; }
@keyframes bdo-toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 720px) {
  .bdo-toast-wrap { top: 10px; right: 10px; left: 10px; width: auto; }
}

/* Pemilih unit ringkas di card periode */
.abk-unit-select { width: 160px; font-weight: 600; }
@media (max-width: 720px) {
  .abk-unit-select { width: 100%; }
}

.abk-menu-item:disabled { opacity: .45; cursor: not-allowed; }

.abk-datecheck { margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.abk-row-datecheck td:first-child { box-shadow: inset 3px 0 #dc2626; }

.bdo-loading-cancel { margin-top: 12px; width: 100%; }

.abk-day-all { font-weight: 600; color: #b91c1c; }

.abk-unit { display: block; margin-top: 2px; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: #64748b; }

.abk-day-holiday { background: #fff7ed; border-color: #fdba74; }
.abk-holiday-label { color: #b45309; font-weight: 700; line-height: 1.2; margin-bottom: 3px; }

/* Mobile: cegah tabel/form lebar membuat seluruh halaman bergeser */
@media (max-width: 720px) {
  .card { overflow-x: auto; }
  .btn, button, .tab, select, input[type="text"], input[type="number"],
  input[type="date"], input[type="file"] { min-height: 44px; }
  .table { min-width: max-content; }
}

@media (max-width: 720px) {
  .abk-calendar .btn, .abk-bulk-bar .btn, .abk-editor-actions .btn { min-height: 44px; }
  .abk-row-actions .abk-move { min-width: 44px; min-height: 44px; }
}

@media (max-width: 720px) {
  .abk-calendar .btn, .abk-bulk-bar .btn, .abk-editor-actions .btn { min-height: 44px !important; }
  .abk-row-actions .abk-move { min-width: 44px !important; min-height: 44px !important; }
}

/* Kontras teks kecil pada kartu kalender dan tautan flash */
.abk-day .tiny.muted { color: #475569; }
.flash a { text-decoration: underline; }

/* Master draft ABK */
.abk-master-table th:nth-child(1), .abk-master-table td:nth-child(1) { width:84px; }
.abk-master-table th:nth-child(2), .abk-master-table td:nth-child(2) { width:auto; }
.abk-master-table th:nth-child(3), .abk-master-table td:nth-child(3) { width:165px; }
.abk-master-table th:nth-child(4), .abk-master-table td:nth-child(4),
.abk-master-table th:nth-child(5), .abk-master-table td:nth-child(5) { width:78px; }
.abk-master-table th:nth-child(6), .abk-master-table td:nth-child(6) { width:145px; }
.abk-master-table th:nth-child(7), .abk-master-table td:nth-child(7) { width:118px; }

/* Editor tanggal kini 6 kolom (tanpa kolom Hari; pola hari ada di master). */
.abk-editor-component th:nth-child(1), .abk-editor-component td:nth-child(1) { width:84px; }
.abk-editor-component th:nth-child(3), .abk-editor-component td:nth-child(3),
.abk-editor-component th:nth-child(4), .abk-editor-component td:nth-child(4) { width:78px; }
.abk-editor-component th:nth-child(5), .abk-editor-component td:nth-child(5) { width:150px; }
.abk-editor-component th:nth-child(6), .abk-editor-component td:nth-child(6) { width:118px; }
.abk-readonly-table th:nth-child(1), .abk-readonly-table td:nth-child(1) { width:84px; }
.abk-readonly-table th:nth-child(3), .abk-readonly-table td:nth-child(3),
.abk-readonly-table th:nth-child(4), .abk-readonly-table td:nth-child(4) { width:76px; }
.abk-readonly-table th:nth-child(5), .abk-readonly-table td:nth-child(5) { width:150px; }

/* Master draft: sumber & frekuensi */
.abk-master-table th:nth-child(3), .abk-master-table td:nth-child(3) { width:125px; }
.abk-master-table th:nth-child(4), .abk-master-table td:nth-child(4) { width:105px; }
.abk-master-table th:nth-child(5), .abk-master-table td:nth-child(5) { width:165px; }
.abk-master-table th:nth-child(6), .abk-master-table td:nth-child(6),
.abk-master-table th:nth-child(7), .abk-master-table td:nth-child(7) { width:72px; }
.abk-master-table th:nth-child(8), .abk-master-table td:nth-child(8) { width:135px; }
.abk-master-table th:nth-child(9), .abk-master-table td:nth-child(9) { width:180px; min-width:180px; }
.abk-master-table .abk-row-actions { flex-wrap:nowrap; }

/* Mobile: draft master as cards, not a squeezed 9-column table */
@media (max-width: 720px) {
  .abk-master-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
    border: 0;
    background: transparent;
  }
  .abk-master-table thead { display: none; }
  .abk-master-table tbody { display: block; width: 100%; }
  .abk-master-table tr {
    display: block;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0 0 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
  .abk-master-table td {
    display: grid !important;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    width: auto !important;
    border: 0 !important;
    padding: 6px 0 !important;
    text-align: left !important;
  }
  .abk-master-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
  }
  .abk-master-table td > input,
  .abk-master-table td > select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
  }
  .abk-master-table td.abk-day-picker {
    grid-template-columns: 1fr;
  }
  .abk-master-table td.abk-day-picker::before {
    margin-bottom: 2px;
  }
  .abk-master-table .abk-day-picker-box {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .abk-master-table .abk-day-picker-box label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    padding: 4px 1px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    font-size: 10px;
  }
  .abk-master-table .abk-day-picker-box label.abk-day-all {
    grid-column: 1 / -1;
  }
  .abk-master-table .abk-day-picker-box input {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0;
  }
  .abk-master-table td[data-label="Aksi"] {
    grid-template-columns: 1fr;
    padding-top: 10px !important;
    border-top: 1px solid var(--line) !important;
    margin-top: 4px;
  }
  .abk-master-table td[data-label="Aksi"]::before {
    display: none;
  }
  .abk-master-table td[data-label="Aksi"] .abk-row-actions {
    justify-content: flex-end;
  }
  .abk-master-table td[data-label="Aksi"] .btn {
    min-height: 44px;
  }
}

/* Tablet/mobile: compact two-column master cards, labels above inputs */
@media (max-width: 900px) {
  .abk-master-table {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto;
    border: 0;
    background: transparent;
  }
  .abk-master-table thead { display: none; }
  .abk-master-table tbody { display: block; width: 100%; }
  .abk-master-table tr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin: 0 0 12px;
    padding: 10px 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
  .abk-master-table td {
    display: flex !important;
    flex-direction: column;
    gap: 3px;
    align-items: stretch;
    width: auto !important;
    min-width: 0;
    border: 0 !important;
    padding: 4px 0 !important;
    text-align: left !important;
  }
  .abk-master-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    display: block;
  }
  .abk-master-table td > input,
  .abk-master-table td > select {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px;
  }
  .abk-master-table td[data-label="Uraian"],
  .abk-master-table td[data-label="Hari berlaku"],
  .abk-master-table td[data-label="Keterangan"],
  .abk-master-table td[data-label="Aksi"] {
    grid-column: 1 / -1;
  }
  .abk-master-table td.abk-day-picker {
    display: flex !important;
    grid-template-columns: none;
  }
  .abk-master-table .abk-day-picker-box {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .abk-master-table .abk-day-picker-box label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    padding: 4px 1px;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #f8fafc;
    font-size: 10px;
  }
  .abk-master-table .abk-day-picker-box label.abk-day-all {
    grid-column: 1 / -1;
  }
  .abk-master-table .abk-day-picker-box input {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    margin: 0;
  }
  .abk-master-table th:nth-child(9), .abk-master-table td:nth-child(9) { width:auto; min-width:0; }
  .abk-master-table .abk-row-actions { flex-wrap:wrap; }
  .abk-master-table td[data-label="Aksi"] {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    padding-top: 10px !important;
    border-top: 1px solid var(--line) !important;
    margin-top: 4px;
  }
  .abk-master-table td[data-label="Aksi"]::before { display: none; }
  .abk-master-table td[data-label="Aksi"] .abk-row-actions {
    justify-content: flex-end;
  }
  .abk-master-table td[data-label="Aksi"] .btn {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 360px) {
  .abk-master-table .abk-day-picker-box {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .abk-master-table .abk-day-picker-box {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  .abk-master-table .abk-day-picker-box label.abk-day-all { display: none; }
}

/* 361–900px: keep cards compact by putting short labels inline */
@media (min-width: 361px) and (max-width: 900px) {
  .abk-master-table td:not([data-label="Uraian"]):not([data-label="Hari berlaku"]):not([data-label="Aksi"]) {
    display: grid !important;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
  }
  .abk-master-table td:not([data-label="Uraian"]):not([data-label="Hari berlaku"]):not([data-label="Aksi"])::before {
    margin: 0;
    line-height: 1.15;
  }
}

/* Perhitungan ABK live di editor tanggal */
.abk-calc { margin:6px 0 10px; padding:10px 12px; border:1px solid #bfdbfe; border-radius:10px; background:#f8fbff; }
.abk-calc-head { align-items:center; gap:8px; }
.abk-calc-formula { margin-top:6px; font-size:13px; font-variant-numeric:tabular-nums; }
.abk-calc-formula strong { font-size:16px; }
.abk-calc-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-top:8px; }
.abk-calc-grid > div { display:flex; flex-direction:column; gap:2px; padding:6px 8px; border:1px solid #dbeafe; border-radius:7px; background:#fff; }
.abk-calc-grid span { color:#64748b; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.abk-calc-grid strong { font-size:14px; font-variant-numeric:tabular-nums; }
.abk-calc-ref { margin-top:8px; line-height:1.45; }
@media (max-width:720px) {
  .abk-calc-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .abk-calc-formula { font-size:12px; }
}

/* Pemetaan PP: pohon hierarki atasan-anggota */
.pp-tree { list-style:none; margin:0; padding:0; }
.pp-tree .pp-tree { margin:8px 0 0 22px; padding-left:14px; border-left:1px dashed #cbd5e1; }
.pp-tree > li { margin:0 0 8px; }
.pp-tree-row {
  display:grid;
  grid-template-columns:minmax(180px,1.2fr) minmax(240px,2fr) minmax(230px,1.4fr);
  gap:12px;
  align-items:start;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
}
.pp-tree-person { min-width:0; }
.pp-tree-person strong { display:block; line-height:1.25; }
.pp-tree-job { min-width:0; font-size:13px; line-height:1.35; }
.pp-tree-unit { display:block; margin-top:2px; color:#64748b; font-size:11px; overflow-wrap:anywhere; }
.pp-tree-meta { display:flex; flex-wrap:wrap; gap:5px; align-items:center; font-size:11px; }
@media (max-width:900px) {
  .pp-tree-row { grid-template-columns:1fr; gap:5px; }
  .pp-tree .pp-tree { margin-left:10px; padding-left:9px; }
}

/* Bawahan yang sudah dinilai pada periode berjalan */
.pp-bawahan-assessed { opacity:.58; background:#f8fafc; }
.pp-bawahan-assessed strong { font-weight:600; }
.pp-bawahan-assessed .btn { display:none; }

/* Sidebar mobile: tombol Menu membuka panel, bukan sidebar penuh */
.mobile-menu-btn { display: none; }
.sidebar-backdrop { display: none; }
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  .sidebar {
    display: none;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 80;
    width: min(86vw, 320px);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    padding: 18px 14px;
    box-shadow: 18px 0 45px rgba(15, 23, 42, .35);
  }
  html.sidebar-mobile-open .sidebar { display: block; }
  html.sidebar-mobile-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, .45);
  }
  html.sidebar-mobile-open .sidebar-toggle { display: none; }
}

/* Draft Master ABK: pengaturan hari massal */
.abk-day-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}
.abk-day-toolbar > strong { font-size: 12px; color: #1e3a8a; }
.abk-global-days { display: flex; flex-wrap: wrap; gap: 5px 10px; }
.abk-global-days label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  min-height: 32px;
}
.abk-global-days input { width: 16px; height: 16px; min-width: 16px; margin: 0; }
@media (max-width: 720px) {
  .abk-day-toolbar { align-items: flex-start; }
  .abk-day-toolbar .inline { width: 100%; }
}

/* ABK: drag tanggal dan urutan kegiatan */
.abk-day-draggable { cursor: grab; }
.abk-day-draggable .abk-day-main { cursor: grab; }
.abk-day-draggable:active { cursor: grabbing; }
.abk-day-dragging { opacity: .55; }
.abk-day.drag-over {
  outline: 3px dashed #2563eb;
  outline-offset: 2px;
  background: #eff6ff !important;
}
.abk-drag-handle {
  width: 26px;
  min-width: 26px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 17px;
  line-height: 1;
  cursor: grab;
}
.abk-drag-handle:hover { background: #e2e8f0; color: #0f172a; }
.abk-drag-handle:active { cursor: grabbing; }
.abk-row-dragging { opacity: .45; }
.abk-row-drop-target td { box-shadow: inset 0 2px 0 #2563eb; }
@media (max-width: 720px) {
  .abk-drag-handle { min-height: 44px; min-width: 44px; }
}

/* Hari berlaku di Draft Master: inline pada desktop, grid pada mobile */
.abk-day-picker-box { display: flex; flex-wrap: wrap; gap: 2px 5px; }
.abk-day-picker-box label {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.abk-day-picker-box input { width: 13px; height: 13px; min-width: 13px; margin: 0; }

/* Semua menu: sembunyikan blok helper/hint; label, status, dan error tetap tampil */
.hint { display: none !important; }

/* E-MENTAL exam workspace */
.q-meta { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.q-text { font-size: 17px; line-height: 1.5; margin: 0 0 16px; }
.q-opt { display: flex; gap: 10px; width: 100%; text-align: left; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: inherit; cursor: pointer; margin-bottom: 8px; }
.q-opt:hover { border-color: #93c5fd; background: #f8fbff; }
.q-opt.selected { border-color: var(--brand); background: #eff6ff; box-shadow: inset 0 0 0 1px var(--brand); }
.q-opt .q-key { flex: 0 0 26px; height: 26px; border-radius: 7px; background: var(--soft);
  display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #334155; }
.q-opt.selected .q-key { background: var(--brand); color: #fff; }
.q-opt .q-ai { margin-left: auto; font-size: 11px; color: #7c3aed; font-weight: 700; }
.timer { font-size: 26px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.timer.low { color: var(--err); }
.lju-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.lju-cell { display: grid; place-items: center; min-height: 28px; border-radius: 6px;
  border: 1px solid var(--line); font-size: 11px; color: #475569; background: #fff; }
.lju-cell:hover { text-decoration: none; border-color: #93c5fd; }
.lju-cell.done { background: #dcfce7; border-color: #86efac; color: #166534; font-weight: 700; }
.lju-cell.ai { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; font-weight: 700; }
.lju-cell.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.ai-panel { border: 1px solid #ddd6fe; background: #faf5ff; border-radius: 10px; padding: 12px; margin-top: 12px; }
.ai-panel h3 { margin: 0 0 6px; font-size: 13px; color: #5b21b6; }
.ai-reason { font-size: 12px; color: #4c1d95; }
.conf { font-size: 11px; font-weight: 700; }
.conf-low { color: var(--err); }
.conf-ok { color: var(--ok); }
.auto-row-low td { background: #fff7ed; }
.progress { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); width: 0; transition: width .3s ease; }

/* E-MENTAL: menu Kerjakan + workspace */
.work-menu { position: relative; display: inline-block; }
.work-menu > summary { list-style: none; cursor: pointer; }
.work-menu > summary::-webkit-details-marker { display: none; }
.work-menu[open] > summary { background: #e2e8f0; }
.work-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 6px; width: 250px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16); }
.work-list form { margin: 0; }
.work-item { display: block; width: 100%; text-align: left; border: 0; background: #fff;
  border-radius: 8px; padding: 8px 10px; cursor: pointer; font: inherit; color: var(--ink); }
.work-item strong { display: block; font-size: 13px; }
.work-item span { display: block; font-size: 11px; color: var(--muted); }
.work-item:hover:not(:disabled) { background: var(--soft); }
.work-item:disabled { opacity: .5; cursor: not-allowed; }
.caret { font-size: 10px; margin-left: 4px; }
.exam-side { position: sticky; top: 12px; align-self: start; }
@media (max-width: 720px) {
  .work-list { right: auto; left: 0; }
  .exam-side { position: static; }
}

/* ══════════════════════════════════════════════════════════════════════════
   Theme v2 — modern operations console
   Arah: konsol administrasi yang tenang, presisi, dan tegas. Navy profunal +
   aksen biru, satu aksen emas untuk penanda aktif; elevasi berlapis neutral.
   ══════════════════════════════════════════════════════════════════════════ */
:root {
  --bg: #eef3f9;
  --panel: #ffffff;
  --muted: #5b6b80;
  --line: #e1e8f2;
  --brand: #1a4fd6;
  --brand-2: #0ea5e9;
  --ink: #0b1728;
  --soft: #f6f9fd;
  --ok: #0f9d58;
  --warn: #b7791f;
  --err: #d92d20;
  --navy-1: #071628;
  --navy-2: #0b2444;
  --gold: #e8b44a;
  --shadow-sm: 0 1px 2px rgba(13, 35, 64, .06), 0 0 0 1px rgba(13, 35, 64, .035);
  --shadow-md: 0 1px 1px -.5px rgba(13, 35, 64, .06),
               0 3px 3px -1.5px rgba(13, 35, 64, .05),
               0 12px 24px -12px rgba(13, 35, 64, .14);
  --shadow-lg: 0 2px 2px rgba(13, 35, 64, .04),
               0 8px 12px -6px rgba(13, 35, 64, .08),
               0 30px 60px -24px rgba(13, 35, 64, .28);
}

html { scroll-behavior: smooth; }
body {
  background:
    radial-gradient(1100px 520px at 100% -8%, #dcebfb 0%, transparent 62%),
    radial-gradient(900px 460px at -12% 8%, #e3f4fc 0%, transparent 58%),
    var(--bg);
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: #c7ddff; color: #071d3d; }
:focus-visible { outline: 3px solid rgba(37, 99, 235, .35); outline-offset: 2px; }

/* ── Sidebar ───────────────────────────────────────────────────────────── */
.sidebar {
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(37, 99, 235, .22), transparent 70%),
    linear-gradient(180deg, var(--navy-1) 0%, var(--navy-2) 58%, #081c34 100%);
  box-shadow: inset -1px 0 rgba(255, 255, 255, .06);
}
.brand-title { font-size: 16px; letter-spacing: -.015em; }
.brand-sub { color: #93aac6; letter-spacing: .005em; }
.nav-section {
  color: #7f9ab8; font-weight: 700; letter-spacing: .14em; margin-top: 20px;
}
.nav a {
  color: #b8c9dd; border-radius: 10px; padding: 9px 11px;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .075); color: #fff; transform: translateX(2px); text-decoration: none; }
.nav a.active {
  background: linear-gradient(90deg, #1d52cf 0%, #2a6bec 100%);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .85), inset 0 0 0 1px rgba(255, 255, 255, .14);
}
.nav a.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 999px; background: var(--gold);
}
.nav-icon { transition: transform .18s ease; }
.nav a:hover .nav-icon { transform: scale(1.07); }
.sidebar-toggle {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12);
  transition: background .18s ease, transform .18s ease;
}
.sidebar-toggle:hover { background: rgba(255, 255, 255, .12); transform: translateX(-1px); }
.sidebar-toggle .nav-icon { transform: rotate(0deg); }
html.sidebar-collapsed .nav a.active::before { display: none; }

/* ── Topbar & content ──────────────────────────────────────────────────── */
.topbar {
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(214, 225, 239, .85);
  padding: 12px 28px;
}
.topbar h1 { font-size: 18px; font-weight: 750; letter-spacing: -.022em; text-wrap: balance; }
.topbar .who { color: #5f7188; font-size: 12px; }
.content { max-width: 1480px; margin-inline: auto; padding: 26px 28px 72px; }

/* ── Surfaces ──────────────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
}
.card h2 { font-size: 15.5px; letter-spacing: -.015em; }
.card h3 { font-size: 13px; letter-spacing: -.01em; }
@media (hover: hover) {
  .grid .card:hover { border-color: #d3e1f2; box-shadow: var(--shadow-md); transform: translateY(-2px); }
}
.split { align-items: center; }

/* ── Type details ─────────────────────────────────────────────────────── */
.mono, .timer, .metric strong, .stat,
.table td.mono, .kv .mono { font-variant-numeric: tabular-nums; }
.small { font-size: 12px; line-height: 1.5; }
.tiny { font-size: 11px; line-height: 1.45; }
.muted { color: var(--muted); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  border-radius: 10px;
  background: linear-gradient(180deg, #2a5ce0 0%, #1b48c4 100%);
  border-color: rgba(12, 37, 90, .25);
  box-shadow: 0 1px 2px rgba(13, 35, 64, .22), inset 0 1px 0 rgba(255, 255, 255, .18);
  font-weight: 650;
  letter-spacing: .005em;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
}
.btn:hover {
  filter: brightness(1.06); transform: translateY(-1px);
  box-shadow: 0 5px 14px -6px rgba(26, 79, 214, .7), inset 0 1px 0 rgba(255, 255, 255, .18);
  text-decoration: none;
}
.btn:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(13, 35, 64, .24); }
.btn.secondary {
  background: #fff; color: #14273f; border-color: #d7e2f0; box-shadow: var(--shadow-sm);
}
.btn.secondary:hover { background: #f8fbff; border-color: #c4d6ea; filter: none; }
.btn.ghost { background: rgba(255, 255, 255, .65); color: var(--brand); border-color: #d7e2f0; box-shadow: none; }
.btn.ghost:hover { background: #fff; filter: none; }
.btn.danger { background: linear-gradient(180deg, #e5484d 0%, #c92b31 100%); border-color: rgba(120, 15, 20, .3); }
.btn.warn { background: linear-gradient(180deg, #d99a2b 0%, #b7791f 100%); border-color: rgba(120, 75, 10, .3); }
.btn.sm { border-radius: 8px; padding: 5px 10px; }
.btn:disabled { filter: grayscale(.15); transform: none; box-shadow: none; }

/* ── Inputs ───────────────────────────────────────────────────────────── */
input, select, textarea {
  border-radius: 10px; border-color: #cdd9e8; background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover, select:hover, textarea:hover { border-color: #b9cbe1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 79, 214, .16);
}
.form-row label { font-size: 12px; font-weight: 650; color: #34465c; }
@media (max-width: 720px) {
  input, select, textarea { font-size: 16px; }
}

/* ── Tables ───────────────────────────────────────────────────────────── */
.table th {
  background: #f4f8fd; color: #5f7188; font-size: 10.5px; font-weight: 750;
  letter-spacing: .07em; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 10px; border-bottom-color: #edf2f9; }
.table tbody tr { transition: background .16s ease; }
.table tbody tr:hover td { background: #f6faff; }
.table-wrap { border-radius: 12px; }

/* ── Tabs & badges ────────────────────────────────────────────────────── */
.tabs {
  gap: 4px; background: #edf2f9; padding: 4px; border-radius: 12px;
  width: fit-content; max-width: 100%; border: 1px solid #e2e9f3;
}
.tab {
  border: 1px solid transparent; background: transparent; border-radius: 9px;
  padding: 7px 13px; font-weight: 650; color: #526378; transition: all .16s ease;
}
.tab:hover { background: #fff; color: var(--ink); text-decoration: none; }
.tab.active {
  background: #fff; color: var(--ink); border-color: #dce6f2;
  box-shadow: 0 1px 2px rgba(13, 35, 64, .08);
}
.badge {
  border: 1px solid transparent; padding: 3px 9px; font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(13, 35, 64, .03);
  white-space: nowrap;
}
.badge.ok { background: #e8f8ef; color: #0b7a45; border-color: #c6efd8; }
.badge.warn { background: #fff6e5; color: #925b0c; border-color: #f6e0b5; }
.badge.err { background: #fdecec; color: #a51d1d; border-color: #f6c9c9; }
.badge.info { background: #e9f1ff; color: #1a4fd6; border-color: #cddcfb; }

/* ── Feedback surfaces ────────────────────────────────────────────────── */
.flash {
  border-radius: 12px; border-left-width: 4px; padding: 11px 14px;
  animation: rise .3s cubic-bezier(.2, .7, .2, 1) both;
}
.empty {
  border-radius: 14px; border-color: #cfdcec;
  background: linear-gradient(180deg, #fbfdff, #f5f9fe); padding: 28px;
}
.bdo-toast {
  border-radius: 14px; border-color: #e0e9f3; box-shadow: var(--shadow-lg);
}
.bdo-toast-mark { width: 3px; }
.bdo-loading { background: rgba(7, 22, 40, .52); backdrop-filter: blur(6px); }
.bdo-loading-card { border-radius: 20px; box-shadow: var(--shadow-lg); }
.bdo-spinner {
  border-color: #dbeafe; border-top-color: var(--brand); border-right-color: var(--brand-2);
  animation-duration: .72s;
}
.modal-backdrop { background: rgba(7, 22, 40, .52); backdrop-filter: blur(4px); }
.modal-card { border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2, .7, .2, 1); }
.code, .secret-box { border-radius: 12px; }

/* ── Login ────────────────────────────────────────────────────────────── */
.login-wrap {
  background:
    radial-gradient(880px 560px at 12% 12%, rgba(37, 99, 235, .35), transparent 62%),
    radial-gradient(720px 520px at 88% 86%, rgba(14, 165, 233, .26), transparent 60%),
    linear-gradient(155deg, #051426 0%, #0a2140 55%, #071a30 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000 0%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 0%, transparent 100%);
}
.login-card {
  position: relative; border-radius: 22px; padding: 30px;
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: var(--shadow-lg);
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.login-card h1 { letter-spacing: -.025em; }
.login-card .btn { min-height: 42px; }

/* ── Mobile chrome ────────────────────────────────────────────────────── */
.mobile-menu-btn {
  border-radius: 10px; border-color: #d7e2f0; background: #fff;
  box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease;
}
.mobile-menu-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ── Motion ───────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.975) translateY(6px); } to { opacity: 1; transform: none; } }
.content > .card, .content > .grid, .content > .tabs {
  animation: rise .42s cubic-bezier(.2, .7, .2, 1) both;
}
.content > *:nth-child(2) { animation-delay: .05s; }
.content > *:nth-child(3) { animation-delay: .09s; }
.content > *:nth-child(4) { animation-delay: .13s; }
.content > *:nth-child(5) { animation-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    transition-duration: .001ms !important;
  }
  .grid .card:hover, .btn:hover, .nav a:hover { transform: none; }
}

/* Scrollbar halus (Chromium/WebKit) */
* { scrollbar-width: thin; scrollbar-color: #c4d3e4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c4d3e4; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #a9bdd4; background-clip: content-box; }
