/* ================= ALL-MAGNI — tema terang & gelap ================= */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e4e8f0;
  --text: #1e2433;
  --text-soft: #5b6472;
  --muted: #8a93a3;
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --primary-soft: #e8f0fe;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.05);
  --radius: 12px;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 68px;
}
html[data-theme="dark"] {
  --bg: #0f141b;
  --surface: #171e28;
  --surface-2: #1d2530;
  --border: #2a3441;
  --text: #e6ebf2;
  --text-soft: #aeb8c6;
  --muted: #7d8798;
  --primary: #5b8def;
  --primary-d: #7aa4f5;
  --primary-soft: #1c2a44;
  --success: #4ade80;
  --success-bg: #10331f;
  --warning: #fbbf24;
  --warning-bg: #3a2c0c;
  --danger: #f87171;
  --danger-bg: #3a1717;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1,h2,h3 { margin: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.empty { padding: 16px 4px; }
.mt { margin-top: 14px; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .2s ease, width .2s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 18px 18px; border-bottom: 1px solid var(--border); }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: transparent; flex-shrink: 0; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark { font-weight: 800; color: var(--primary); font-size: 20px; }
.brand-mark-lg { font-size: 40px; display:inline-flex; width:72px; height:72px; align-items:center; justify-content:center; background:var(--primary-soft); border-radius:16px; }
.brand-text strong { display: block; font-size: 15px; letter-spacing: .3px; }
.brand-text small { color: var(--muted); font-size: 12px; }

/* overflow-x eksplisit 'hidden' -> tidak pernah muncul scrollbar horizontal saat animasi lebar */
.nav { padding: 12px 10px; overflow: hidden auto; flex: 1; }
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-label { white-space: nowrap; overflow: hidden; flex: 1; text-align: left; }

/* Item tunggal (Dashboard) + header grup: baris yang seragam */
.nav-item, .nav-group-header {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; border-radius: 9px;
  color: var(--text-soft); font-weight: 500; font-size: 14px; margin-bottom: 2px;
  background: transparent; border: 0; cursor: pointer; font-family: inherit;
  transition: background .12s, color .12s;
}
.nav-item:hover, .nav-group-header:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active, .nav-group-header.active { background: var(--primary-soft); color: var(--primary-d); font-weight: 600; }
.nav-caret { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; transition: transform .2s ease; color: var(--muted); }
.nav-caret svg { width: 16px; height: 16px; }
.nav-group.open > .nav-group-header .nav-caret { transform: rotate(180deg); }

/* Dropdown halus tanpa mengukur tinggi (grid-template-rows 0fr -> 1fr) */
.nav-group-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.nav-group.open > .nav-group-wrap { grid-template-rows: 1fr; }
.nav-group-items { overflow: hidden; min-height: 0; display: flex; flex-direction: column; }
.flyout-title { display: none; }

.nav-sub {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px 8px 16px; margin: 1px 0 1px 14px; border-radius: 8px;
  color: var(--text-soft); font-size: 13.5px; font-weight: 500;
  border-left: 2px solid var(--border);
  transition: background .12s, color .12s, border-color .12s;
}
.nav-sub .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .4; flex-shrink: 0; }
.nav-sub:hover { background: var(--surface-2); color: var(--text); }
.nav-sub.active { color: var(--primary-d); font-weight: 600; border-left-color: var(--primary); background: var(--primary-soft); }
.nav-sub.active .dot { opacity: 1; }

/* Tombol perkecil/perbesar di bawah */
.collapse-btn {
  display: flex; align-items: center; gap: 11px;
  margin: 8px 10px; padding: 10px 12px; border-radius: 9px;
  background: transparent; border: 1px solid var(--border); cursor: pointer;
  color: var(--text-soft); font-family: inherit; font-size: 13.5px; font-weight: 500;
  transition: background .12s, color .12s;
}
.collapse-btn:hover { background: var(--surface-2); color: var(--text); }
.collapse-icon { transition: transform .2s ease; }

.sidebar-scrim { display: none; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; transition: margin-left .2s ease; }
.topbar { height: 62px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-name { font-weight: 600; font-size: 13.5px; }
/* Isi memenuhi lebar layar (full-bleed) & mengikuti zoom Chrome, tanpa dibatasi lebar tetap */
.content { padding: 22px; width: 100%; max-width: none; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 15px; }
.form-card { max-width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.center-card { max-width: 440px; margin: 8vh auto; text-align: center; }

/* ---------- Stats ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 4px; }
.stat { padding: 18px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -.5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
tbody tr:hover { background: var(--surface-2); }
td .actions, td.actions { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-blue { background: var(--primary-soft); color: var(--primary-d); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-amber { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--surface-2); color: var(--text-soft); }
.lock { margin-left: 6px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .12s, box-shadow .12s, opacity .12s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); }
.icon-btn { background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; cursor: pointer; color: var(--text-soft); font-size: 16px; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
#menu-toggle { display: none; }
.inline-form { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--text-soft); margin-bottom: 5px; }
.field.sm { margin-bottom: 10px; }
input[type=text], input[type=password], input[type=email], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text); font-size: 14px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input:disabled, select:disabled { opacity: .6; cursor: not-allowed; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-inline { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.form-inline .btn { height: 40px; }
.search-row { display: flex; gap: 10px; }
.search-row input { flex: 1; }
.check { display: flex; align-items: flex-start; gap: 9px; margin: 6px 0 12px; font-size: 13.5px; color: var(--text-soft); }
.check input { width: auto; margin-top: 3px; }
.hint { font-size: 12.5px; margin: 6px 0 0; }
.pw-wrap { position: relative; display: block; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: transparent; border: 0; cursor: pointer; font-size: 15px; padding: 4px 8px; color: var(--muted); }
.stack { display: block; }
.sm-note { font-size: 12px; margin: 6px 0 0; }

/* ---------- Details menu ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; display: inline-flex; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; width: 250px; z-index: 20; }
.menu-body hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }

/* ---------- Flash ---------- */
.flash-area { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; border: 1px solid transparent; }
.flash-success { background: var(--success-bg); color: var(--success); }
.flash-danger { background: var(--danger-bg); color: var(--danger); }
.flash-warning { background: var(--warning-bg); color: var(--warning); }
.flash-info { background: var(--primary-soft); color: var(--primary-d); }
.flash-close { background: transparent; border: 0; cursor: pointer; font-size: 18px; line-height: 1; color: inherit; opacity: .6; }
.flash-close:hover { opacity: 1; }

/* ---------- Account cards ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.acc-wrap { display: flex; flex-direction: column; }
.acc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.acc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.acc-name { font-weight: 700; font-size: 15px; }
.acc-sub { color: var(--muted); font-size: 13px; }
.acc-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.acc-detail dt { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.acc-detail dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.acc-notes { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-soft); }
.acc-action { margin-top: 10px; padding: 8px 0 0; }
.result-count { margin: 4px 2px 12px; }

/* ---------- Checks (validasi nomor) ---------- */
.check-list { display: flex; flex-direction: column; gap: 12px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.check-item .check-icon { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; flex-shrink: 0; }
.check-item.ok .check-icon { background: var(--success); }
.check-item.bad .check-icon { background: var(--danger); }
.check-item.warn .check-icon { background: var(--warning); }

/* ---------- Secret / duplicate ---------- */
.highlight-card { border-color: var(--primary); }
.secret-box { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px dashed var(--primary); border-radius: 10px; padding: 12px 14px; margin: 6px 0 10px; }
.secret-box code { font-size: 18px; font-weight: 700; letter-spacing: 1px; color: var(--text); }
.dup-group { border-left: 3px solid var(--danger); }
.dup-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; }
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.activity li:last-child { border-bottom: 0; }
.activity-action { font-weight: 700; font-size: 13px; }
.activity-detail { font-size: 13px; color: var(--text-soft); }
.activity-meta { font-size: 11.5px; color: var(--muted); }
.error-code { font-size: 60px; font-weight: 800; color: var(--primary); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 34px 30px; width: 100%; max-width: 400px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand h1 { font-size: 22px; margin-top: 12px; }
.auth-brand p { color: var(--muted); font-size: 13.5px; margin: 4px 0 0; }
.auth-logo { max-width: 90px; max-height: 90px; object-fit: contain; }
.btn-block.btn-primary { margin-top: 6px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; }

/* ---------- Jam live di topbar ---------- */
.clock { font-size: 13px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 7px 12px; white-space: nowrap; line-height: 1.2; text-align: right; font-variant-numeric: tabular-nums; }
.clock .clock-time { color: var(--text); }
.clock .clock-date { display: block; font-size: 10.5px; color: var(--muted); font-weight: 500; }

/* ---------- Avatar ---------- */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.avatar-ph { background: var(--primary-soft); color: var(--primary-d); font-weight: 800; }
.avatar-sm { width: 32px; height: 32px; font-size: 14px; }
.avatar-md { width: 38px; height: 38px; font-size: 15px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }

/* ---------- Menu pengguna (popup) ---------- */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 10px; border: 1px solid transparent; transition: background .12s, border-color .12s; }
.user-chip:hover { background: var(--surface-2); border-color: var(--border); }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.user-chip .chev { color: var(--muted); font-size: 11px; }
.user-menu-body { position: absolute; right: 0; top: calc(100% + 8px); width: 300px; max-width: 86vw; max-height: calc(100vh - 84px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; z-index: 50; }
.user-menu-body hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.um-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.um-name { font-weight: 700; font-size: 14.5px; }
.um-sub { color: var(--muted); font-size: 12.5px; }
.um-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

/* ---------- Widget atas dashboard ---------- */
.top-widgets { align-items: stretch; }
.online-card, .speed-card { display: flex; flex-direction: column; }
.online-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.online-user { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; }
.online-user:hover { background: var(--surface-2); }
.online-user .online-name { flex: 1; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online-avatar { position: relative; display: inline-flex; }
.online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }

/* ---------- Tes kecepatan ---------- */
.speed-gauge { position: relative; width: 168px; height: 168px; margin: 6px auto 4px; }
.speed-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.speed-ring .ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 10; }
.speed-ring .ring-fg { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .5s ease, stroke .3s ease; }
.speed-readout { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.speed-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; color: var(--text); font-variant-numeric: tabular-nums; }
.speed-unit { font-size: 12px; color: var(--muted); font-weight: 600; }
.speed-meta { display: flex; justify-content: space-around; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.speed-meta div { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.speed-meta .muted { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }

/* ---------- IP di halaman login ---------- */
.login-ip { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.login-ip span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.login-ip code { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 700; color: var(--primary-d); font-size: 14px; }
.logout-line { margin-top: 10px; }

/* ---------- Sidebar diperkecil (icon-only) + flyout ---------- */
@media (min-width: 721px) {
  .layout.collapsed .sidebar { width: var(--sidebar-w-collapsed); }
  .layout.collapsed .main { margin-left: var(--sidebar-w-collapsed); }
  .layout.collapsed .nav { overflow: visible; }

  .layout.collapsed .brand-text,
  .layout.collapsed .nav-label,
  .layout.collapsed .nav-caret { display: none; }

  .layout.collapsed .brand { justify-content: center; padding-left: 8px; padding-right: 8px; }
  .layout.collapsed .nav-item,
  .layout.collapsed .nav-group-header,
  .layout.collapsed .collapse-btn { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
  .layout.collapsed .collapse-icon { transform: rotate(180deg); }

  .layout.collapsed .nav-group { position: relative; }
  .layout.collapsed .nav-group-wrap {
    position: absolute; left: calc(100% + 10px); top: 0;
    grid-template-rows: 1fr;
    width: 216px; padding: 8px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateX(-6px);
    transition: opacity .14s ease, transform .14s ease, visibility .14s;
    z-index: 60; pointer-events: none;
  }
  /* jembatan tak terlihat -> tidak flicker saat kursor pindah ke flyout.
     Tinggi dibatasi setinggi baris header agar tidak menutupi grup di bawahnya. */
  .layout.collapsed .nav-group-wrap::before {
    content: ""; position: absolute; left: -22px; top: 0; width: 22px; height: 44px;
  }
  .layout.collapsed .nav-group:hover > .nav-group-wrap,
  .layout.collapsed .nav-group:focus-within > .nav-group-wrap {
    opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto;
  }
  .layout.collapsed .nav-group-items { overflow: visible; }
  .layout.collapsed .flyout-title { display: block; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px 8px; }
  .layout.collapsed .nav-sub { margin-left: 0; border-left: 0; padding-left: 10px; }

  /* Tooltip untuk item ikon (Dashboard & tombol perkecil) */
  .layout.collapsed .nav-item[data-tip]:hover::after,
  .layout.collapsed .collapse-btn[data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
    background: var(--text); color: var(--surface); white-space: nowrap;
    padding: 5px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
    z-index: 65; pointer-events: none;
  }
  .layout.collapsed .nav-item, .layout.collapsed .collapse-btn { position: relative; }
}

/* ---------- Halaman Akses Ditolak ---------- */
.denied-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(160deg, var(--bg), var(--surface-2)); }
.denied-card { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--danger); border-radius: 18px; box-shadow: var(--shadow); padding: 40px 34px; max-width: 460px; width: 100%; text-align: center; }
.denied-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.denied-icon svg { width: 38px; height: 38px; }
.denied-card h1 { font-size: 24px; margin-bottom: 8px; color: var(--text); }
.denied-sub { color: var(--text-soft); font-size: 14.5px; margin: 0 0 20px; }
.denied-ip { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; }
.denied-ip span { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
.denied-ip code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 16px; font-weight: 700; color: var(--danger); }
.denied-note { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.denied-brand { font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 16px; letter-spacing: .3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-2, .form-grid, .form-inline { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  #menu-toggle { display: inline-flex; }
  .collapse-btn { display: none; }
  .content { padding: 16px; }
  .user-name, .user-role { display: none; }
  .clock .clock-date { display: none; }
  .clock { padding: 6px 9px; }
  .sidebar-scrim.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 35; }
  /* Sasaran sentuh minimal ~44px agar nyaman di layar sentuh */
  .icon-btn { width: 44px; height: 44px; }
  .nav-sub { padding-top: 11px; padding-bottom: 11px; }
  .flash-close, .pw-toggle { min-width: 40px; min-height: 40px; }
}
