/* ==========================================================================
   HIMASI ABSENSI — NEXT-GEN 3D ULTRA MODERN UI / UX DESIGN SYSTEM
   Featuring: 3D Depth, Glassmorphism, Tactile Controls, Cyber Hologram HUD,
   Interactive 3D Canvases, Polished Light/Dark Themes & Micro-interactions.
   ========================================================================== */

/* ---------- VARIABEL & TEMA ---------- */
:root {
  /* Default: Dark Theme (Cyber Obsidian + Emerald Hologram) */
  --bg: #070c0e;
  --bg-gradient: radial-gradient(circle at 18% 12%, rgba(0, 230, 195, 0.08) 0%, transparent 45%),
                 radial-gradient(circle at 85% 80%, rgba(36, 86, 184, 0.09) 0%, transparent 50%),
                 #070c0e;
  --surface: rgba(16, 25, 28, 0.82);
  --surface-solid: #10191c;
  --surface-2: rgba(23, 36, 40, 0.75);
  --surface-glass: rgba(20, 32, 36, 0.65);
  --ink: #e8f5f3;
  --ink-heading: #ffffff;
  --muted: #8aa39f;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(0, 230, 195, 0.28);
  
  /* HIMASI Signature Emerald & Cyan */
  --teal: #00bfa5;
  --teal-ink: #3bf1db;
  --teal-soft: rgba(0, 191, 165, 0.15);
  --teal-glow: rgba(0, 191, 165, 0.45);
  --teal-shadow: #007a69;
  --on-teal: #031c19;
  
  /* Sidebar & Shield */
  --shield: #0a1113;
  --shield-2: #121c1f;
  --shield-ink: #f0faf8;
  --shield-muted: #8ca5a1;
  --sidebar-border: rgba(0, 191, 165, 0.35);

  /* Status Colors with 3D Depth */
  --ok: #10b981;
  --ok-soft: rgba(16, 185, 129, 0.16);
  --ok-glow: rgba(16, 185, 129, 0.4);
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --warn-glow: rgba(245, 158, 11, 0.4);
  --bad: #f43f5e;
  --bad-soft: rgba(244, 63, 94, 0.16);
  --bad-glow: rgba(244, 63, 94, 0.4);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.16);
  --info-glow: rgba(59, 130, 246, 0.4);

  /* Typography */
  --f-display: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --f-body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* 3D Elevation & Shadows */
  --r: 16px;
  --r-sm: 10px;
  --r-lg: 22px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 18px 48px -8px rgba(0, 0, 0, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-3d: 0 12px 30px -6px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.14);
  --shadow-teal: 0 10px 28px -4px rgba(0, 191, 165, 0.35);
  --border-specular: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  
  color-scheme: dark;
}

/* Light Theme Override */
:root[data-theme="light"] {
  --bg: #f2f7f6;
  --bg-gradient: radial-gradient(circle at 18% 12%, rgba(0, 191, 165, 0.08) 0%, transparent 45%),
                 radial-gradient(circle at 85% 80%, rgba(59, 130, 246, 0.07) 0%, transparent 50%),
                 #f2f7f6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-solid: #ffffff;
  --surface-2: rgba(240, 248, 246, 0.9);
  --surface-glass: rgba(255, 255, 255, 0.7);
  --ink: #10211f;
  --ink-heading: #071513;
  --muted: #57706d;
  --line: rgba(16, 33, 31, 0.11);
  --line-strong: rgba(0, 150, 136, 0.3);
  
  --teal: #009688;
  --teal-ink: #00796b;
  --teal-soft: rgba(0, 150, 136, 0.12);
  --teal-glow: rgba(0, 150, 136, 0.3);
  --teal-shadow: #005f56;
  --on-teal: #ffffff;

  --shield: #142021;
  --shield-2: #1c2c2d;
  --shield-ink: #f0faf8;
  --shield-muted: #9bb2af;
  --sidebar-border: #009688;

  --ok: #059669;
  --ok-soft: #e3f6ee;
  --ok-glow: rgba(5, 150, 105, 0.25);
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --warn-glow: rgba(217, 119, 6, 0.25);
  --bad: #e11d48;
  --bad-soft: #ffe4e6;
  --bad-glow: rgba(225, 29, 72, 0.25);
  --info: #2563eb;
  --info-soft: #eff6ff;
  --info-glow: rgba(37, 99, 235, 0.25);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 18px 48px -8px rgba(0, 0, 0, 0.14), 0 6px 16px rgba(0, 0, 0, 0.06);
  --shadow-3d: 0 10px 25px -4px rgba(10, 40, 36, 0.09), inset 0 1px 1px rgba(255, 255, 255, 0.9);
  --shadow-teal: 0 10px 24px -4px rgba(0, 150, 136, 0.28);
  --border-specular: inset 0 1px 0 rgba(255, 255, 255, 0.85);

  color-scheme: light;
}

/* ---------- RESET & GLOBAL ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar 3D */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 191, 165, 0.3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 191, 165, 0.6); }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink-heading);
}
h1 { font-size: 26px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 750; }
h3 { font-size: 15.5px; font-weight: 700; }
p { margin: 0; }
a { color: var(--teal-ink); text-decoration: none; transition: opacity .15s; }
a:hover { opacity: .85; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--f-mono); letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 3D PERSPECTIVE & TILT SYSTEM ---------- */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.28s ease;
  position: relative;
}
.tilt-pop {
  transform: translateZ(26px);
  transform-style: preserve-3d;
  transition: transform 0.28s ease;
}
.tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--glare-x, 50%) var(--glare-y, 50%), rgba(255, 255, 255, 0.16) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.25s ease;
  mix-blend-mode: overlay;
  z-index: 2;
}
.tilt-glare { display: none; }

/* ---------- SHELL & SIDEBAR ---------- */
.shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}
.side {
  background: var(--shield);
  color: var(--shield-ink);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
  z-index: 35;
  backdrop-filter: blur(20px);
}
.side::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--teal) 0%, #2563eb 50%, var(--teal) 100%);
  box-shadow: 0 0 12px var(--teal-glow);
}
.side .brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
}
.logos {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}
.logos img {
  height: 42px;
  width: auto;
  display: block;
  transition: transform 0.25s ease;
}
.logos img:hover {
}
.brand b {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .04em;
  background: linear-gradient(90deg, #ffffff 40%, var(--teal-ink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand span {
  font-size: 11.5px;
  color: var(--shield-muted);
  line-height: 1.35;
}

.side nav {
  display: grid;
  gap: 3px;
  padding: 14px 12px;
  flex: 1;
  align-content: start;
}
.side nav .grp {
  font-size: 10.5px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--shield-muted);
  padding: 16px 12px 6px;
  font-weight: 700;
  opacity: .85;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--shield-ink);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 11px;
  font-weight: 600;
  font-size: 13.5px;
  position: relative;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.side nav a svg {
  width: 19px;
  height: 19px;
  flex: none;
  opacity: .75;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.side nav a:hover {
  background: var(--shield-2);
  color: #fff;
}
.side nav a:hover svg {
  opacity: 1;
  color: var(--teal-ink);
}
.side nav a[aria-current="page"] {
  background: linear-gradient(135deg, var(--teal) 0%, #009180 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px var(--teal-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 700;
}
.side nav a[aria-current="page"] svg {
  opacity: 1;
  color: #fff;
}
.side nav a .count {
  margin-left: auto;
  background: var(--warn);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
  box-shadow: 0 2px 6px var(--warn-glow);
}

.me {
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}
.me .who {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 0;
}
.me .who div { min-width: 0; }
.me .who b {
  display: block;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
.me .who span {
  font-size: 11.5px;
  color: var(--shield-muted);
}
.me select {
  background: var(--shield-2);
  color: var(--shield-ink);
  border-color: rgba(255, 255, 255, 0.14);
  font-size: 12.5px;
  padding: 7px 10px;
  border-radius: 9px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  position: relative;
}

/* Theme Switcher Button 3D */
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.theme-switch-btn:hover {
  background: var(--surface);
  border-color: var(--teal);
  color: var(--teal-ink);
}

/* ---------- MAIN & TOPBAR ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: none;
}
.demo-band {
  background: linear-gradient(90deg, rgba(0, 191, 165, 0.15) 0%, rgba(37, 99, 235, 0.12) 100%);
  color: var(--teal-ink);
  font-size: 12.5px;
  font-weight: 700;
  padding-block: 8px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.demo-band .theme-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.content {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding-block: 28px 72px;
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
  display: grid;
  gap: 22px;
  align-content: start;
}
.pagehead {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
}
.pagehead p { margin-top: 4px; }
.scrim { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(290px, 86vw);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(0.2, 0.8, 0.2, 1);
    padding-top: env(safe-area-inset-top, 0px);
  }
  .shell.drawer .side { transform: none; }
  .shell.drawer .scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 45;
  }
  .topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 30;
    background: var(--shield);
    color: var(--shield-ink);
    padding-block: 12px;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    border-bottom: 2px solid var(--teal);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }
  .topbar img { height: 32px; }
  .topbar b { font-family: var(--f-display); font-weight: 800; letter-spacing: .04em; }
  .topbar button { background: transparent; border-color: rgba(255, 255, 255, 0.2); color: var(--shield-ink); padding: 7px 11px; }
}

/* ---------- 3D PANELS & CARDS ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  display: grid;
  gap: 16px;
  min-width: 0;
  align-content: start;
  box-shadow: var(--shadow-3d);
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}
.panel:hover {
  border-color: rgba(0, 191, 165, 0.28);
}
.panel > .head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.grid-3 {
  display: grid;
  gap: 20px;
  grid-template-columns: 2fr 1fr;
}
@media (max-width: 1000px) { .grid-3 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.stack { display: grid; gap: 10px; }

/* ---------- 3D METRIC TILES ---------- */
.tiles {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}
.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  display: grid;
  gap: 4px;
  box-shadow: var(--shadow-3d);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, border-color 0.25s ease;
  transform-style: preserve-3d;
}
.tile::after {
  content: "";
  position: absolute;
  bottom: -40px; right: -40px;
  width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  opacity: 0.25;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.tile:hover {
  border-color: rgba(0, 191, 165, 0.4);
  box-shadow: 0 16px 36px -6px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 191, 165, 0.15);
}
.tile:hover::after {
  opacity: 0.55;
}
.tile .k svg { width: 16px; height: 16px; flex: none; }
.tile .k {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile .v {
  font-family: var(--f-display);
  font-size: 32px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-heading);
  transform: translateZ(18px);
}
.tile .s {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 3D TACTILE BUTTONS ---------- */
button, .btn {
  font: 650 13.5px var(--f-body);
  border-radius: 11px;
  padding: 10px 16px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.16s ease;
  user-select: none;
  position: relative;
}
button:hover, .btn:hover {
  border-color: var(--muted);
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
button:active, .btn:active {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
button.primary {
  background: linear-gradient(135deg, var(--teal) 0%, #008f7e 100%);
  border-color: #007a6b;
  color: var(--on-teal);
  box-shadow: 0 3px 0 var(--teal-shadow), 0 6px 18px var(--teal-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 700;
}
button.primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 5px 0 var(--teal-shadow), 0 8px 24px var(--teal-glow), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
button.primary:active {
  box-shadow: 0 1px 0 var(--teal-shadow), 0 2px 8px var(--teal-glow);
}
button.danger {
  color: var(--bad);
  border-color: rgba(244, 63, 94, 0.3);
  background: var(--surface);
}
button.danger:hover {
  background: var(--bad-soft);
  border-color: var(--bad);
}
button.dangerfill {
  background: linear-gradient(135deg, var(--bad) 0%, #c02643 100%);
  border-color: #9f122f;
  color: #fff;
  box-shadow: 0 3px 0 #8b0d27, 0 6px 18px var(--bad-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--teal-ink);
  box-shadow: none;
  padding-inline: 9px;
}
button.ghost:hover {
  background: var(--teal-soft);
  border-color: transparent;
  transform: none;
}
button.sm, .btn.sm {
  padding: 6px 11px;
  font-size: 12.5px;
  border-radius: 9px;
}
button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
button svg, .btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- FORM CONTROLS ---------- */
label.f {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 650;
}
input, select, textarea {
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  width: 100%;
  min-width: 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow), inset 0 1px 2px rgba(0, 0, 0, 0.08);
  outline: none;
  background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] {
  width: 19px; height: 19px;
  accent-color: var(--teal);
  cursor: pointer;
}
.fields {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}
.fields .full { grid-column: 1 / -1; }

/* ---------- PILLS & BADGES ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 750;
  padding: 3.5px 10px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(16, 185, 129, 0.28); }
.pill.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.28); }
.pill.bad { background: var(--bad-soft); color: var(--bad); border: 1px solid rgba(244, 63, 94, 0.28); }
.pill.info { background: var(--info-soft); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.28); }
.pill.teal { background: var(--teal-soft); color: var(--teal-ink); border: 1px solid rgba(0, 191, 165, 0.28); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulse-live 1.5s infinite;
}
@keyframes pulse-live {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 0.35; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

/* ---------- TABLES & LISTS ---------- */
.tablebox {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 750;
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--teal-ink); }
tr:last-child td { border-bottom: 0; }
tbody tr {
  transition: background 0.15s ease;
}
tbody tr:hover td {
  background: var(--surface-2);
}
td.r, th.r { text-align: right; }
td select { padding: 5px 8px; width: auto; font-size: 13px; }

.bar {
  height: 7px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
  width: 84px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 9px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, #2563eb 100%);
  border-radius: 4px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
  padding: 3px;
  gap: 3px;
}
.seg button {
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 7px 13px;
  transition: all 0.18s ease;
}
.seg button:hover {
  color: var(--ink);
  transform: none;
}
.seg button[aria-pressed="true"] {
  background: var(--teal);
  color: var(--on-teal);
  box-shadow: 0 2px 8px var(--teal-glow);
  font-weight: 700;
}

.empty {
  padding: 32px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.05);
}
.note {
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  background: var(--teal-soft);
  color: var(--ink);
  display: grid;
  gap: 6px;
  border: 1px solid rgba(0, 191, 165, 0.25);
  box-shadow: var(--shadow-sm);
}
.note.warn { background: var(--warn-soft); border-color: rgba(245, 158, 11, 0.3); }
.note.bad { background: var(--bad-soft); border-color: rgba(244, 63, 94, 0.3); }
.note.ok { background: var(--ok-soft); border-color: rgba(16, 185, 129, 0.3); }

.list > .item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  align-items: center;
  transition: background 0.18s ease;
}
.list > .item:first-child { border-top: 0; padding-top: 2px; }
.item .meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.item .actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .list > .item { grid-template-columns: 1fr; }
  .item .actions { justify-content: flex-start; }
}

.chart svg, .chartbox svg { display: block; width: 100%; height: auto; max-height: 310px; }
.chartbox { overflow-x: auto; }
.thumb {
  width: 40px; height: 50px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: var(--surface-2);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}
.thumb:hover { }
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  font-size: 13.5px;
}
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 650; }

.tabs2 {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  padding-bottom: 2px;
}
.tabs2 button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 14px;
  box-shadow: none;
}
.tabs2 button:hover {
  color: var(--ink);
  transform: none;
}
.tabs2 button[aria-pressed="true"] {
  color: var(--teal-ink);
  border-bottom-color: var(--teal);
  font-weight: 700;
  background: var(--teal-soft);
}

/* ---------- 3D ABSEN STEPPER & CAM HUD ---------- */
.steps { display: grid; gap: 14px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  background: var(--surface);
  box-shadow: var(--shadow-3d);
  backdrop-filter: blur(14px);
  position: relative;
  transition: all 0.25s ease;
}
.step::before {
  content: "";
  position: absolute;
  top: 56px; bottom: -16px; left: 36px;
  width: 2px;
  background: var(--line);
  z-index: 0;
}
.step:last-child::before { display: none; }
.step .no {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  background: var(--surface-2);
  border: 2px solid var(--line);
  color: var(--muted);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1;
  transition: all 0.25s ease;
}
.step.done { border-color: rgba(16, 185, 129, 0.35); }
.step.done .no {
  background: linear-gradient(135deg, var(--ok) 0%, #059669 100%);
  border-color: #047857;
  color: #fff;
  box-shadow: 0 4px 12px var(--ok-glow);
}
.step.fail { border-color: rgba(244, 63, 94, 0.35); }
.step.fail .no {
  background: linear-gradient(135deg, var(--bad) 0%, #e11d48 100%);
  border-color: #be123c;
  color: #fff;
  box-shadow: 0 4px 12px var(--bad-glow);
}
.step.active {
  border-color: var(--teal);
  box-shadow: 0 8px 30px -4px var(--teal-glow), inset 0 0 0 1px var(--teal);
}
.step.active .no {
  background: var(--teal);
  border-color: #007a6b;
  color: #fff;
  box-shadow: 0 4px 14px var(--teal-glow);
}
.step .body { display: grid; gap: 10px; min-width: 0; }

/* 3D Camera Viewfinder & HUD */
.cam {
  position: relative;
  width: min(320px, 100%);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  max-width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--teal);
}
.cam video, .cam img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cam video { transform: scaleX(-1); }
.cam.bukti video { transform: none; }
.cam.bukti video.cermin { transform: scaleX(-1); }

/* Holographic Cyber HUD Overlay */
.cam .hud-scanner {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
  box-shadow: inset 0 0 20px rgba(0, 191, 165, 0.3);
}
.cam .hud-laser {
  position: absolute;
  left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #00e6c3, #fff, #00e6c3, transparent);
  box-shadow: 0 0 16px #00e6c3, 0 0 30px rgba(0, 230, 195, 0.8);
  animation: hud-sweep 2.4s ease-in-out infinite alternate;
}
@keyframes hud-sweep {
  0% { top: 8%; opacity: 0.95; }
  100% { top: 88%; opacity: 0.95; }
}
.cam .guide {
  position: absolute;
  inset: 12% 16% 24%;
  border: 2px dashed rgba(0, 230, 195, 0.7);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(0, 230, 195, 0.3), inset 0 0 18px rgba(0, 230, 195, 0.2);
}
.cam .hud-corner {
  position: absolute;
  width: 20px; height: 20px;
  border: 3px solid #00e6c3;
  pointer-events: none;
}
.cam .hud-corner.tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.cam .hud-corner.tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; }
.cam .hud-corner.bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; }
.cam .hud-corner.br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.codeinput {
  font-family: var(--f-mono);
  font-size: 26px;
  letter-spacing: .35em;
  text-align: center;
  max-width: 240px;
  font-weight: 750;
  background: var(--surface-2);
  border: 2px solid var(--teal);
  box-shadow: 0 0 16px var(--teal-glow), inset 0 2px 6px rgba(0, 0, 0, 0.2);
  color: var(--teal-ink);
}

/* Attendance Result Box with 3D Flip */
.result {
  border-radius: var(--r-lg);
  padding: 24px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  animation: result-pop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes result-pop {
  0% { transform: scale(0.9) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.result.ok {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.18) 0%, rgba(6, 78, 59, 0.25) 100%);
  border-color: var(--ok);
  box-shadow: 0 14px 40px rgba(16, 185, 129, 0.25);
}
.result.bad {
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.18) 0%, rgba(136, 19, 55, 0.25) 100%);
  border-color: var(--bad);
  box-shadow: 0 14px 40px rgba(244, 63, 94, 0.25);
}
.result h2 { display: flex; gap: 10px; align-items: center; }

/* ---------- 3D HOLOGRAPHIC STAGE (LAYAR QR) ---------- */
.stage {
  background: radial-gradient(circle at 50% 30%, #162428 0%, #080f11 100%);
  color: #e6f6f4;
  border-radius: var(--r-lg);
  border: 2px solid rgba(0, 230, 195, 0.45);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 35px rgba(0, 191, 165, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  padding: 36px;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(24px);
}
.stage::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, rgba(0, 230, 195, 0.6) 0%, rgba(37, 99, 235, 0.3) 50%, rgba(0, 230, 195, 0.6) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.stage:fullscreen {
  border-radius: 0;
  align-content: center;
  padding: 5vw;
}
@media (max-width: 820px) {
  .stage { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
}
.stage .logos img { height: 46px; }

/* 3D QR Card */
.qrbox {
  background: #ffffff;
  border-radius: 18px;
  padding: 16px;
  width: min(380px, 100%);
  aspect-ratio: 1;
  max-width: 100%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(0, 230, 195, 0.3);
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}
.qrbox:hover {
}
.stage:fullscreen .qrbox { width: min(60vh, 44vw); }
.qrbox svg { width: 100%; height: 100%; display: block; }

.stage h2 { font-size: 30px; color: #ffffff; letter-spacing: -0.02em; }
.stage .lbl {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--shield-muted);
  font-weight: 750;
}
.bigcode {
  font-family: var(--f-mono);
  font-weight: 850;
  font-size: clamp(48px, 7.5vw, 86px);
  letter-spacing: .14em;
  color: #3bf1db;
  text-shadow: 0 0 24px rgba(59, 241, 219, 0.65), 0 4px 12px rgba(0, 0, 0, 0.5);
  line-height: 1;
}
.timer {
  height: 9px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  overflow: hidden;
  max-width: 440px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}
.timer i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #00e6c3 0%, #2563eb 100%);
  box-shadow: 0 0 12px rgba(0, 230, 195, 0.7);
  transition: width 1s linear;
}
.stage .count {
  font-family: var(--f-display);
  font-size: 46px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #fff;
}
.recent {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.recent .p {
  display: flex;
  gap: 9px;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 12px 6px 6px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes slide-in {
  0% { transform: translateY(8px) scale(0.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.recent .p img {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
}
.stage button {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}
.stage button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
}
.stage button.primary {
  background: linear-gradient(135deg, var(--teal) 0%, #008f7e 100%);
  border-color: #007a6b;
  color: #fff;
  box-shadow: 0 4px 18px var(--teal-glow);
}

/* ---------- 3D LOGIN PAGE ---------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: var(--bg);
}
.login .hero {
  background: radial-gradient(circle at 25% 35%, #142226 0%, #080f11 100%);
  color: var(--shield-ink);
  padding: 56px max(36px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  border-right: 1px solid rgba(0, 191, 165, 0.3);
  position: relative;
  overflow: hidden;
  box-shadow: 12px 0 36px rgba(0, 0, 0, 0.45);
}
/* Interactive 3D Canvas in Login Hero */
.login .hero-3d-wrap {
  width: 100%;
  height: 240px;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-block: 6px;
  border: 1px solid rgba(0, 230, 195, 0.2);
  background: rgba(0, 0, 0, 0.25);
  box-shadow: inset 0 0 30px rgba(0, 230, 195, 0.08);
}
.login .hero-3d-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
.login .hero-3d-wrap canvas:active { cursor: grabbing; }
.login .hero-3d-hint {
  position: absolute;
  bottom: 8px; right: 12px;
  font-size: 11px;
  color: var(--teal-ink);
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  letter-spacing: .02em;
}

.login .hero .logos img { height: 86px; }
.login .hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  color: #fff;
  line-height: 1.15;
}
.login .hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #3bf1db 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login .hero p {
  color: var(--shield-muted);
  max-width: 48ch;
  font-size: 15px;
}
.login .form {
  padding-block: 48px;
  padding-left: max(28px, env(safe-area-inset-left, 0px));
  padding-right: max(28px, env(safe-area-inset-right, 0px));
  display: grid;
  align-content: center;
  justify-items: center;
  background: var(--bg);
  background-image: var(--bg-gradient);
}
.login .card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg), var(--shadow-3d);
  backdrop-filter: blur(20px);
}
.demo-acc { display: grid; gap: 8px; }
.demo-acc button {
  justify-content: space-between;
  width: 100%;
  background: var(--surface-2);
  border-color: var(--line);
  padding: 10px 14px;
}
.demo-acc button:hover {
  background: var(--surface);
  border-color: var(--teal);
}
.demo-acc button span { color: var(--muted); font-weight: 500; font-size: 12px; }

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login .hero {
    padding-block: 36px;
    border-right: 0;
    border-bottom: 2px solid var(--teal);
  }
  .login .hero .logos img { height: 60px; }
  .login .hero-3d-wrap { height: 180px; }
}

/* ---------- 3D MODAL & TOAST ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  animation: modal-fade 0.22s ease-out;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal .box {
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  width: min(660px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  display: grid;
  gap: 16px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: modal-pop 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes modal-pop {
  0% { transform: scale(0.92) translateY(14px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.modal .box.wide { width: min(1000px, 100%); }
.modal .box.img {
  width: auto;
  padding: 12px;
  background: #000;
  border-color: var(--teal);
  box-shadow: 0 0 30px var(--teal-glow);
}
.modal .box.img img { max-height: 82vh; border-radius: 10px; display: block; }

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--shield);
  color: var(--shield-ink);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 80;
  max-width: calc(100% - 32px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 18px var(--teal-glow);
  animation: toast-spring 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
  display: flex;
  align-items: center;
  gap: 10px;
}
@keyframes toast-spring {
  0% { transform: translate(-50%, 20px) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* 3D Confetti Particle Engine Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
}

/* Print Styles */
.kop { display: none; }
@media print {
  .side, .topbar, .demo-band, .noprint, #toast, .login .hero-3d-wrap, #confetti-canvas { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; }
  .kop { display: flex; gap: 16px; align-items: center; border-bottom: 3px double #000; padding-bottom: 10px; margin-bottom: 14px; }
  .kop img { height: 64px; }
  .panel, .tablebox { border: 0; box-shadow: none; }
  th { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ==========================================================================
   LIQUID GLASS (gaya iOS 27)
   Kaca bening + blur kuat, bingkai gelap tipis untuk kedalaman, kilau tepi
   (specular) terang, kontrol berbentuk kapsul, bar & menu melayang.
   Warna tidak diubah: semua memakai token warna yang sudah ada.
   ========================================================================== */
:root {
  --glass: rgba(16, 25, 28, 0.36);
  --glass-2: rgba(23, 36, 40, 0.30);
  --glass-strong: rgba(16, 25, 28, 0.66);
  --glass-side: rgba(10, 17, 19, 0.56);
  --glass-blur: blur(30px) saturate(190%);
  --spec: linear-gradient(165deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0) 55%);
  --rim: linear-gradient(140deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.10) 20%, rgba(255, 255, 255, 0.03) 50%, rgba(255, 255, 255, 0.08) 78%, rgba(255, 255, 255, 0.38) 100%);
  --rim-dark: rgba(0, 0, 0, 0.55);
  --lens: inset 0 1px 1px rgba(255, 255, 255, 0.30), inset 0 0 22px rgba(255, 255, 255, 0.04), inset 0 -12px 22px -14px rgba(0, 0, 0, 0.35);
  --float: 0 24px 60px -22px rgba(0, 0, 0, 0.75), 0 6px 16px -8px rgba(0, 0, 0, 0.45);
  --orb-1: rgba(0, 191, 165, 0.34);
  --orb-2: rgba(37, 99, 235, 0.28);
  --orb-3: rgba(0, 191, 165, 0.18);
  --side-sheen: linear-gradient(165deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 45%);
}
:root[data-theme="light"] {
  --glass: rgba(255, 255, 255, 0.40);
  --glass-2: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --glass-side: rgba(20, 32, 33, 0.86);
  --spec: linear-gradient(165deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.15) 35%, rgba(255, 255, 255, 0) 60%);
  --rim: linear-gradient(140deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.55) 22%, rgba(255, 255, 255, 0.25) 50%, rgba(255, 255, 255, 0.5) 78%, rgba(255, 255, 255, 0.95) 100%);
  --rim-dark: rgba(16, 33, 31, 0.13);
  --lens: inset 0 1px 1px rgba(255, 255, 255, 0.9), inset 0 0 22px rgba(255, 255, 255, 0.25), inset 0 -12px 22px -14px rgba(16, 33, 31, 0.10);
  --float: 0 24px 60px -24px rgba(10, 40, 36, 0.30), 0 6px 16px -8px rgba(10, 40, 36, 0.12);
  --orb-1: rgba(0, 150, 136, 0.30);
  --orb-2: rgba(59, 130, 246, 0.24);
  --orb-3: rgba(0, 150, 136, 0.16);
}

/* latar dengan cahaya lembut supaya kaca punya sesuatu untuk dibiaskan */
body::before {
  content: "";
  position: fixed;
  inset: -10vmax;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 10%, var(--orb-1), transparent 70%),
    radial-gradient(42vmax 42vmax at 92% 88%, var(--orb-2), transparent 70%),
    radial-gradient(30vmax 30vmax at 70% 18%, var(--orb-3), transparent 70%),
    radial-gradient(26vmax 26vmax at 25% 85%, var(--orb-3), transparent 70%);
  filter: blur(10px);
}

/* ---------- bahan kaca ---------- */
.panel, .tile, .step, .login .card, .tablebox, .modal .box:not(.img), #toast, .tabbar {
  border: 1px solid transparent;
  background:
    var(--spec) padding-box,
    linear-gradient(var(--glass), var(--glass)) padding-box,
    var(--rim) border-box;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 0 0 0.5px var(--rim-dark), var(--float), var(--lens);
}
.panel { border-radius: 30px; }
.tile, .step { border-radius: 26px; }
.login .card { border-radius: 34px; }
.modal .box:not(.img) {
  border-radius: 36px;
  background:
    var(--spec) padding-box,
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    var(--rim) border-box;
}
.tablebox {
  border-radius: 22px;
  background:
    linear-gradient(var(--glass-2), var(--glass-2)) padding-box,
    var(--rim) border-box;
  box-shadow: 0 0 0 0.5px var(--rim-dark), var(--lens);
}
.panel::before { display: none; }
.panel:hover, .tile:hover { border-color: transparent; }
.tile::after { opacity: 0.18; }
.modal { background: rgba(0, 0, 0, 0.38); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%); }
:root[data-theme="light"] .modal { background: rgba(16, 33, 31, 0.22); }
.modal .box.img { border-radius: 28px; }
#toast { border-radius: 999px; color: var(--ink); border-left-width: 1px; padding: 12px 22px; }
#toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal-glow); flex: none; }

th { background: rgba(255, 255, 255, 0.035); }
:root[data-theme="light"] th { background: rgba(255, 255, 255, 0.40); }
tbody tr:hover td { background: var(--teal-soft); }

/* ---------- menu samping melayang ---------- */
@media (min-width: 901px) {
  .shell { grid-template-columns: 278px minmax(0, 1fr); }
  .side {
    margin: 14px 0 14px 14px;
    top: 14px;
    height: calc(100vh - 28px);
    border-radius: 32px;
  }
}
.side {
  border: 1px solid transparent;
  background:
    var(--side-sheen) padding-box,
    linear-gradient(var(--glass-side), var(--glass-side)) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, 0.40) 0%, rgba(255, 255, 255, 0.06) 25%, rgba(255, 255, 255, 0.03) 60%, rgba(0, 191, 165, 0.45) 100%) border-box;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.55), var(--float), inset 0 1px 1px rgba(255, 255, 255, 0.18);
}
.side::before { display: none; }
.side { overflow: hidden; }
.side nav { overflow-y: auto; min-height: 0; }
.side .me { flex: none; }
.side .brand { background: none; border-bottom-color: rgba(255, 255, 255, 0.07); }
.side nav a { border-radius: 999px; }
.side nav a[aria-current="page"] {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 55%), var(--teal);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 8px 20px -8px var(--teal-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
.side .me { border-top-color: rgba(255, 255, 255, 0.07); background: none; }
.side button:not(.primary) {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.03) 60%), rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--shield-ink);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.18);
}
.side button:not(.primary):hover { border-color: var(--teal); }
.side select { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); color: var(--shield-ink); }

/* ---------- HP: bar atas melayang + bar menu bawah ---------- */
.tabbar { display: none; }
@media (max-width: 900px) {
  .side {
    inset: 10px auto 10px 10px;
    height: auto;
    border-radius: 30px;
    transform: translateX(-112%);
  }
  .shell.drawer .scrim { background: rgba(0, 0, 0, 0.30); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  .topbar {
    top: calc(env(safe-area-inset-top, 0px) + 8px);
    margin: 8px 10px 0;
    border-radius: 999px;
    border: 1px solid transparent;
    padding-block: 8px;
    padding-inline: 8px 10px;
    background:
      var(--side-sheen) padding-box,
      linear-gradient(var(--glass-side), var(--glass-side)) padding-box,
      linear-gradient(140deg, rgba(255, 255, 255, 0.40), rgba(255, 255, 255, 0.05) 40%, rgba(0, 191, 165, 0.40)) border-box;
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.5), var(--float), inset 0 1px 1px rgba(255, 255, 255, 0.18);
  }
  .topbar button { border-radius: 999px; }
  .content { padding-bottom: calc(118px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: flex;
    position: fixed;
    z-index: 40;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: min(460px, calc(100% - 24px));
    padding: 6px;
    gap: 2px;
    border-radius: 999px;
  }
  .tabbar .tabbtn {
    background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    font: inherit; font-size: 10.5px; font-weight: 700; filter: none;
  }
  .tabbar a, .tabbar .tabbtn {
    flex: 1;
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 7px 4px 6px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease;
  }
  .tabbar a svg, .tabbar .tabbtn svg { width: 21px; height: 21px; }
  .tabbar a span.l { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar a[aria-current="page"] {
    color: var(--teal-ink);
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.04) 60%), var(--teal-soft);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.25), 0 0 0 0.5px var(--rim-dark);
  }
  .tabbar a .count { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- tombol kapsul ---------- */
button, .btn {
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    var(--spec) padding-box,
    linear-gradient(var(--glass-2), var(--glass-2)) padding-box,
    var(--rim) border-box;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 0 0 0.5px var(--rim-dark), 0 6px 16px -10px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.22);
  transition: transform 0.18s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.18s ease, filter 0.18s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); border-color: transparent; box-shadow: 0 0 0 0.5px var(--rim-dark), 0 10px 22px -10px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.3); }
button:active, .btn:active { transform: scale(0.96); }
button.primary {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 50%) padding-box,
    linear-gradient(var(--teal), var(--teal)) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.15) 40%, rgba(255, 255, 255, 0.45)) border-box;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 10px 24px -10px var(--teal-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
button.primary:hover { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 14px 28px -10px var(--teal-glow), inset 0 1px 1px rgba(255, 255, 255, 0.6); }
button.dangerfill {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 50%) padding-box,
    linear-gradient(var(--bad), var(--bad)) padding-box,
    linear-gradient(140deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.15) 40%, rgba(255, 255, 255, 0.4)) border-box;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 10px 24px -10px var(--bad-glow), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}
button.danger { color: var(--bad); }
button.ghost, .seg button, .tabs2 button {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
button.ghost:hover { background: var(--teal-soft); filter: none; box-shadow: none; }
.theme-switch-btn { border-radius: 50% !important; aspect-ratio: 1; padding: 8px !important; }

/* ---------- isian ---------- */
input, select, textarea {
  border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--glass-2), var(--glass-2)) padding-box,
    linear-gradient(160deg, rgba(0, 0, 0, 0.25), rgba(255, 255, 255, 0.12)) border-box;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18);
}
:root[data-theme="light"] input, :root[data-theme="light"] select, :root[data-theme="light"] textarea {
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)) padding-box,
    linear-gradient(160deg, rgba(16, 33, 31, 0.14), rgba(255, 255, 255, 0.9)) border-box;
}
input:focus, select:focus, textarea:focus {
  background:
    linear-gradient(var(--glass-strong), var(--glass-strong)) padding-box,
    linear-gradient(var(--teal), var(--teal)) border-box;
  box-shadow: 0 0 0 4px var(--teal-soft);
}
input[type=checkbox] { box-shadow: none; background: none; border: 0; }
#l-nim, #l-pass, [type=search] { border-radius: 999px; padding-inline: 18px; }

/* ---------- kontrol segmen, tab, catatan, kosong, pil ---------- */
.seg {
  border-radius: 999px;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--glass-2), var(--glass-2)) padding-box,
    var(--rim) border-box;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 0 0 0.5px var(--rim-dark), inset 0 1px 2px rgba(0, 0, 0, 0.15);
}
.seg button { border-radius: 999px; }
.seg button[aria-pressed="true"] {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.32) 0%, rgba(255, 255, 255, 0) 55%), var(--teal);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.3), 0 6px 14px -6px var(--teal-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}
.tabs2 { border-bottom: 0; gap: 4px; }
.tabs2 button { border-radius: 999px; border-bottom: 0; }
.tabs2 button[aria-pressed="true"] { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2), 0 0 0 0.5px var(--rim-dark); }
.note { border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.10); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15); }
.empty { border-radius: 22px; border-style: solid; border-color: rgba(255, 255, 255, 0.06); background: var(--glass-2); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
:root[data-theme="light"] .empty { border-color: rgba(255, 255, 255, 0.8); }
.pill { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14); }
.avatar { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 4px 12px -4px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.35); }
.thumb { border-radius: 12px; box-shadow: 0 0 0 0.5px var(--rim-dark), 0 4px 12px -4px rgba(0, 0, 0, 0.45); }
.cam { border-radius: 30px; box-shadow: 0 0 0 0.5px var(--rim-dark), var(--float), 0 0 0 3px var(--teal-soft); }

/* ---------- cadangan untuk peramban/pengaturan tertentu ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .panel, .tile, .step, .login .card, .tablebox, .modal .box:not(.img), #toast, .tabbar {
    background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, var(--rim) border-box;
  }
  .side, .topbar { background: var(--shield) !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .panel, .tile, .step, .login .card, .tablebox, .modal .box:not(.img), #toast, .tabbar {
    background: linear-gradient(var(--surface-solid), var(--surface-solid)) padding-box, linear-gradient(var(--line), var(--line)) border-box;
  }
  .side, .topbar { background: var(--shield) !important; }
}
@media print {
  body::before, .tabbar { display: none !important; }
  .panel, .tile, .tablebox { background: #fff !important; backdrop-filter: none !important; box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ikon kecil di dalam pil (mis. Online/Hybrid) */
.pill svg { width: 13px; height: 13px; margin-right: 4px; vertical-align: -2px; }

/* centang buat rapat Zoom otomatis; kolom manual disembunyikan selama tercentang */
.zauto { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px; background: rgba(0, 191, 165, .08); border: 1px solid rgba(0, 191, 165, .25); cursor: pointer; line-height: 1.45; }
.zauto input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: #00bfa5; }
.zauto:has(#rf-zauto:checked) ~ .zman { display: none; }
