/* ================================================================
   Dashboard Akuntansi Manajemen — Ultra-Modern Liquid Glass UI
   ================================================================ */
:root {
  --font: "Inter", "Segoe UI", "SF Pro Display", system-ui, -apple-system, Roboto, sans-serif;
  --r: 18px;
  --r-sm: 12px;
}

/* Dark Liquid Glass (Default — visionOS / Voxia aesthetic) */
[data-theme="dark"], :root {
  --bg: #0d1622;
  --bg-base: linear-gradient(135deg, #0b141f 0%, #142233 48%, #0e1824 100%);
  --orb-1: radial-gradient(circle at 22% 18%, rgba(56, 189, 248, 0.34), rgba(14, 165, 233, 0.12) 45%, transparent 70%);
  --orb-2: radial-gradient(circle at 82% 24%, rgba(125, 211, 252, 0.28), rgba(59, 130, 246, 0.10) 48%, transparent 72%);
  --orb-3: radial-gradient(circle at 18% 84%, rgba(196, 136, 96, 0.28), rgba(148, 102, 74, 0.10) 48%, transparent 70%);
  --orb-4: radial-gradient(circle at 76% 82%, rgba(45, 212, 191, 0.20), transparent 62%);

  --shell: rgba(16, 27, 40, 0.42);
  --sidebar: rgba(12, 21, 32, 0.54);
  --topbar: rgba(12, 20, 31, 0.72);
  --card-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.125) 0%, rgba(255, 255, 255, 0.042) 100%);
  --card-hover: linear-gradient(155deg, rgba(255, 255, 255, 0.165) 0%, rgba(255, 255, 255, 0.065) 100%);
  --panel: rgba(255, 255, 255, 0.075);
  --panel-hover: rgba(255, 255, 255, 0.13);
  --panel2: rgba(10, 18, 28, 0.46);

  --ink: #f4f8fc;
  --muted: #9fb2c9;
  --line: rgba(255, 255, 255, 0.15);
  --line-top: rgba(255, 255, 255, 0.30);
  --line-strong: rgba(255, 255, 255, 0.28);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  --grid: rgba(255, 255, 255, 0.09);

  --accent: #7dd3fc;
  --accent-solid: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.18);
  --pos: #5eead4;
  --neg: #fb7185;
  --warn: #fbbf24;

  --c1: #67e8f9;
  --c2: #5eead4;
  --c3: #fcd34d;
  --c4: #c4b5fd;
  --c5: #f9a8d4;
  --c6: rgba(203, 213, 225, 0.45);
  --c7: #38bdf8;
  --select-bg: #132030;

  --shadow-shell: 0 32px 90px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --card-shadow: 0 10px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* Light Liquid Glass */
[data-theme="light"] {
  --bg: #e4edf7;
  --bg-base: linear-gradient(135deg, #e5eef8 0%, #eff5fb 50%, #dfeaf6 100%);
  --orb-1: radial-gradient(circle at 20% 15%, rgba(56, 189, 248, 0.28), transparent 62%);
  --orb-2: radial-gradient(circle at 82% 20%, rgba(14, 165, 233, 0.20), transparent 60%);
  --orb-3: radial-gradient(circle at 22% 85%, rgba(226, 168, 128, 0.22), transparent 62%);
  --orb-4: radial-gradient(circle at 78% 82%, rgba(45, 212, 191, 0.16), transparent 60%);

  --shell: rgba(255, 255, 255, 0.48);
  --sidebar: rgba(247, 251, 255, 0.62);
  --topbar: rgba(246, 250, 255, 0.78);
  --card-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.56) 100%);
  --card-hover: linear-gradient(155deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.72) 100%);
  --panel: rgba(255, 255, 255, 0.66);
  --panel-hover: rgba(255, 255, 255, 0.88);
  --panel2: rgba(241, 246, 253, 0.76);

  --ink: #0f172a;
  --muted: #4b5e76;
  --line: rgba(15, 23, 42, 0.10);
  --line-top: rgba(255, 255, 255, 0.92);
  --line-strong: rgba(15, 23, 42, 0.18);
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  --grid: rgba(15, 23, 42, 0.08);

  --accent: #0284c7;
  --accent-solid: #0284c7;
  --accent-soft: rgba(2, 132, 199, 0.13);
  --pos: #0d9488;
  --neg: #e11d48;
  --warn: #d97706;

  --c1: #0284c7;
  --c2: #0d9488;
  --c3: #d97706;
  --c4: #7c3aed;
  --c5: #db2777;
  --c6: #94a3b8;
  --c7: #0891b2;
  --select-bg: #ffffff;

  --shadow-shell: 0 28px 80px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --card-shadow: 0 8px 26px rgba(15, 23, 42, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  background-image: var(--bg-base);
  background-attachment: fixed;
  color: var(--ink);
  font: 13.5px/1.52 var(--font);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Luminous atmospheric backdrop orbs behind the floating glass shell */
@keyframes ambientFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, -2%, 0) scale(1.04); }
}
body::before, body::after {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  z-index: 0;
}
body::before {
  background: var(--orb-1), var(--orb-2);
  filter: blur(48px);
  animation: ambientFloat 20s ease-in-out infinite;
}
body::after {
  background: var(--orb-3), var(--orb-4);
  filter: blur(56px);
  animation: ambientFloat 26s ease-in-out infinite reverse;
}

#root { position: relative; z-index: 1; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.muted { color: var(--muted); }
.pos { color: var(--pos); } .neg { color: var(--neg); } .warn-t { color: var(--warn); }
.center { display: flex; justify-content: center; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }

/* ================================================================
   Login & Password View
   ================================================================ */
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}
.glass-auth {
  width: 100%;
  max-width: 410px;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  border-radius: 24px;
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  box-shadow: var(--shadow-shell);
}
.login h1 { font-size: 22px; margin: 18px 0 4px; letter-spacing: -0.025em; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -0.015em; }
.brand .logo {
  width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.42), rgba(14, 165, 233, 0.20));
  border: 1px solid rgba(186, 230, 253, 0.45);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  display: grid; place-items: center; color: var(--accent); flex: none;
}
.brand .logo svg { width: 18px; height: 18px; }
[data-theme="light"] .brand .logo {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff; border-color: transparent;
}

label.f { display: block; margin: 13px 0 5px; font-weight: 600; font-size: 12.5px; color: var(--muted); }
input.in, select.in, textarea.in {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--panel2); color: var(--ink);
  backdrop-filter: blur(12px);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
select.in option { background: var(--select-bg); color: var(--ink); }
input.in:focus, select.in:focus, textarea.in:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: var(--specular);
  cursor: pointer; font-weight: 600; font-size: 12.5px;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .14s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--line-strong); background: var(--panel-hover); }
.btn:active { transform: translateY(1px); }
.btn.pri {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.92), rgba(14, 165, 233, 0.92));
  color: #051624; border-color: rgba(186, 230, 253, 0.7);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.btn.pri:hover { filter: brightness(1.07); box-shadow: 0 10px 28px rgba(56, 189, 248, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.65); }
[data-theme="light"] .btn.pri { color: #ffffff; }
.btn.danger { color: var(--neg); }
.btn.danger:hover { border-color: rgba(251, 113, 133, 0.48); background: rgba(251, 113, 133, 0.14); }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.err { color: var(--neg); margin-top: 10px; min-height: 18px; font-size: 12.5px; }

/* ================================================================
   Unified Floating Liquid Glass Window Shell
   ================================================================ */
.app-shell {
  min-height: calc(100vh - 28px);
  max-width: 1580px;
  margin: 14px auto;
  border-radius: 26px;
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  background: var(--shell);
  backdrop-filter: blur(30px) saturate(175%);
  -webkit-backdrop-filter: blur(30px) saturate(175%);
  box-shadow: var(--shadow-shell);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  overflow: clip;
}

.sidebar {
  position: sticky;
  top: 0;
  height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  z-index: 30;
}

.sb-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 4px 12px;
}
.brand-name { font-size: 14.5px; font-weight: 700; letter-spacing: -0.02em; }
.role-pill {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(125, 211, 252, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.ws-box {
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  box-shadow: var(--specular);
  margin-bottom: 12px;
}
.ws-name { font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.side-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-grp-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .09em;
  color: var(--muted); padding: 4px 11px 2px; opacity: 0.72;
}
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 600; font-size: 13px;
  border: 1px solid transparent;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .14s ease;
}
.side-nav a .ni { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.side-nav a:hover {
  color: var(--ink);
  background: var(--panel);
}
.side-nav a.on {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.22), rgba(103, 232, 249, 0.14));
  border-color: rgba(255, 255, 255, 0.28);
  border-top-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.36);
}
[data-theme="light"] .side-nav a.on {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(2, 132, 199, 0.12));
  border-color: rgba(2, 132, 199, 0.24);
  color: var(--accent);
}
.side-nav a.on .ni { color: var(--accent); opacity: 1; }

.sb-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sb-theme { width: 100%; justify-content: center; }
.user-card {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
  box-shadow: var(--specular);
}
.avatar {
  width: 31px; height: 31px; border-radius: 99px;
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.40), rgba(94, 234, 212, 0.28));
  border: 1px solid rgba(186, 230, 253, 0.42);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: var(--accent); flex: none;
}
.user-meta { min-width: 0; }
.user-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.user-acts .btn { justify-content: center; }

.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 22px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(185%);
  -webkit-backdrop-filter: blur(28px) saturate(185%);
}
.tb-left { display: flex; align-items: center; gap: 10px; }
.sb-open { display: none; padding: 5px 11px; font-size: 15px; }
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.crumb .sep { color: var(--muted); opacity: 0.6; }
.crumb strong { font-weight: 700; letter-spacing: -0.01em; }

.tb-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctrl { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.pill-ctrl {
  padding: 3px 5px 3px 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  box-shadow: var(--specular);
}
.pill-ctrl select.in {
  width: auto; border: 0; background: transparent; padding: 3px 8px;
  font-weight: 600; font-size: 12px; box-shadow: none; backdrop-filter: none;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--panel2);
}
.seg button {
  border: 0; background: transparent; padding: 4px 11px;
  cursor: pointer; font-weight: 600; font-size: 11.5px; color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.seg button.on {
  background: linear-gradient(135deg, #67e8f9, #38bdf8);
  color: #061523;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
}
[data-theme="light"] .seg button.on { background: var(--accent-solid); color: #ffffff; }

.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--pos);
  background: rgba(94, 234, 212, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.30);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 10px var(--pos);
}

.stage-body { padding: 20px 24px 48px; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
.view-enter { animation: viewIn .24s cubic-bezier(.22, .61, .36, 1); }

.sb-backdrop { display: none; }

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
    margin: 8px;
    border-radius: 20px;
    min-height: calc(100vh - 16px);
  }
  .sb-open { display: inline-flex; }
  .sidebar {
    position: fixed; top: 10px; left: 10px; bottom: 10px;
    width: 264px; height: auto;
    border-radius: 22px;
    border: 1px solid var(--line);
    transform: translateX(-115%);
    transition: transform .22s ease;
    z-index: 60;
  }
  .sidebar.open { transform: translateX(0); }
  .sb-backdrop.open {
    display: block; position: fixed; inset: 0;
    background: rgba(5, 10, 18, 0.55);
    backdrop-filter: blur(5px); z-index: 50;
  }
  .stage-body { padding: 14px 14px 36px; }
}

/* ================================================================
   Badges, Liquid Glass Cards, KPIs & Grids
   ================================================================ */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
.badge.ok { background: rgba(94, 234, 212, 0.16); color: var(--pos); }
.badge.fail { background: rgba(251, 113, 133, 0.17); color: var(--neg); }
.badge.warn { background: rgba(251, 191, 36, 0.17); color: var(--warn); }
.badge.draft { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }

h2.pg { font-size: 22px; font-weight: 700; margin: 2px 0 3px; letter-spacing: -0.025em; }
.pg-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1180px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-top-color: var(--line-top);
  border-radius: var(--r);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  box-shadow: var(--card-shadow);
  padding: 17px 18px;
  min-width: 0;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.card:hover {
  border-color: var(--line-strong);
  background: var(--card-hover);
}
.kpi.card:hover { transform: translateY(-2px); }
.card h3 { margin: 0 0 4px; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.card .sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }

.kpi .lbl {
  color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
.kpi .v {
  font-size: 25px; font-weight: 800; margin: 5px 0 3px;
  letter-spacing: -.025em; font-variant-numeric: tabular-nums;
}
.kpi .d { font-size: 12px; color: var(--muted); }

.hero { display: grid; grid-template-columns: 1.05fr 2fr; gap: 14px; }
@media (max-width: 1050px) { .hero { grid-template-columns: 1fr; } }

.hero .big {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.40) 0%, rgba(14, 165, 233, 0.20) 55%, rgba(99, 102, 241, 0.16) 100%);
  border: 1px solid rgba(186, 230, 253, 0.44);
  border-top-color: rgba(224, 242, 254, 0.62);
  box-shadow: 0 18px 46px rgba(14, 165, 233, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}
[data-theme="light"] .hero .big {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff; border-color: transparent;
}
.hero .big .lbl, .hero .big .d { color: rgba(244, 248, 252, 0.88); }
.hero .big .v { font-size: 40px; margin: 10px 0 6px; letter-spacing: -0.03em; }

.gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 720px) { .gauges { grid-template-columns: 1fr 1fr; } }
.gauge { text-align: center; }
.g-lbl { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: -6px; }

.sig { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.sig:last-child { border: 0; }
.sig .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; }
.sig.bad .dot { background: var(--neg); box-shadow: 0 0 10px var(--neg); }
.sig.warn .dot { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.sig.good .dot { background: var(--pos); box-shadow: 0 0 10px var(--pos); }
.sig.info .dot { background: var(--c1); box-shadow: 0 0 10px var(--c1); }
.sig b { display: block; font-size: 13px; }
.sig span { color: var(--muted); font-size: 12.5px; }

.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.subtabs button {
  border: 1px solid var(--line); border-top-color: var(--line-top);
  background: var(--panel); box-shadow: var(--specular);
  border-radius: 999px; padding: 5px 14px; cursor: pointer;
  font-weight: 600; font-size: 12.5px; color: var(--muted);
  transition: all .15s ease;
}
.subtabs button:hover { color: var(--ink); border-color: var(--line-strong); }
.subtabs button.on {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(125, 211, 252, 0.50);
}

.note-box {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; font-size: 13px;
}
.note-box ul { margin: 6px 0 0; padding-left: 18px; }
.formula {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  background: var(--panel2); padding: 2px 6px; border-radius: 6px;
  border: 1px solid var(--line);
}

/* ================================================================
   Tables
   ================================================================ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: right; font-weight: 700; color: var(--muted);
  padding: 9px 9px; border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.tbl th:first-child { text-align: left; }
.tbl td { padding: 7.5px 9px; border-bottom: 1px solid var(--line); }
.tbl td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.b td { font-weight: 700; background: var(--panel2); }
.tbl td.ind { padding-left: 22px; color: var(--muted); }
.tbl tbody tr:hover td { background: var(--accent-soft); }
.tbl td.txt { text-align: left; white-space: normal; min-width: 220px; color: var(--muted); }

/* ================================================================
   SVG Charts
   ================================================================ */
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg .grid { stroke: var(--grid); stroke-width: 1; fill: none; }
svg .grid.zero { stroke: var(--line-strong); stroke-width: 1.2; }
svg .ax { fill: var(--muted); font-size: 11px; }
svg .ax.b { font-weight: 700; fill: var(--ink); font-size: 12px; }
svg .lbl { fill: var(--ink); font-size: 11.5px; }
svg .vl { fill: var(--muted); font-size: 10.5px; font-weight: 600; }
svg .hm { fill: var(--ink); font-size: 11px; font-weight: 600; }
svg .ln { fill: none; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(103, 232, 249, 0.35)); }
svg .dot { stroke: var(--bg); stroke-width: 1.6; }
svg .conn { stroke: var(--muted); stroke-dasharray: 3 3; opacity: 0.7; }
svg .g-bg { fill: none; stroke: var(--grid); stroke-width: 14; stroke-linecap: round; }
svg .g-fg { fill: none; stroke-width: 14; stroke-linecap: round; filter: drop-shadow(0 0 7px rgba(103, 232, 249, 0.25)); }
svg .g-tgt { stroke: var(--ink); stroke-width: 2.5; }
svg .g-val { fill: var(--ink); font-size: 22px; font-weight: 800; }
svg .tm { opacity: .92; } svg .tm:hover { opacity: 1; }
svg .tm-l { fill: #fff; font-size: 12px; font-weight: 700; }
svg .tm-v { fill: rgba(255, 255, 255, 0.85); font-size: 11px; }
svg .bub { opacity: .85; stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.4; }
svg .rd { fill: none; } svg .rd-s { fill-opacity: .22; stroke-width: 2.2; }
svg .sl { stroke-width: 2.4; } svg .db { stroke-width: 4; stroke-linecap: round; opacity: .68; }
svg .db-a { fill: var(--c6); } svg .db-b { fill: var(--c1); }
svg .sk-l { fill: none; stroke-opacity: .36; } svg .sk-l:hover { stroke-opacity: .72; }
svg rect:hover, svg circle:hover { filter: brightness(1.14); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .db-a-i { background: var(--c6); border-radius: 50%; }
.legend .db-b-i { background: var(--c1); border-radius: 50%; }
.donut { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.donut svg { max-width: 200px; }
.donut .legend { flex-direction: column; gap: 5px; }

/* ================================================================
   Simulator, Admin, Dialog & Toast
   ================================================================ */
.sim { display: grid; gap: 10px; }
.sl-row { display: grid; grid-template-columns: 200px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
@media (max-width: 720px) { .sl-row { grid-template-columns: 1fr; } }
.sl-row input[type=range] { width: 100%; accent-color: var(--accent-solid); }
.sl-row output { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.result { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.result > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px; }
.result .lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.result .v { font-size: 18px; font-weight: 800; }

.drop {
  display: block; border: 2px dashed var(--line-strong); border-radius: 16px;
  padding: 32px; text-align: center; cursor: pointer; background: var(--panel2);
  transition: border-color .15s ease, background .15s ease;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.checks { max-height: 420px; overflow: auto; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

dialog {
  border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--select-bg); color: var(--ink);
  padding: 20px; width: min(520px, 94vw);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
dialog::backdrop { background: rgba(5, 10, 18, 0.62); backdrop-filter: blur(5px); }

#toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-weight: 600;
  opacity: 0; transition: .2s; pointer-events: none; z-index: 100; max-width: 90vw;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
#toast.show { opacity: 1; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.card.mt, .mt { margin-top: 14px; }
svg .ax.sm, svg .vl.sm { font-size: 9px; }

@media print {
  body { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }
  .app-shell { display: block; padding: 0; margin: 0; border: 0; box-shadow: none; background: #fff; }
  .sidebar, .topbar, .sb-backdrop { display: none !important; }
  .card { break-inside: avoid; box-shadow: none; border-color: #ddd; background: #fff; }
}
