/* ==========================================================================
   BANDAR LIVE — DARK SILVER & CENTERED GOLD THEME (BANDAR STUDIO EDITION)
   Simple, Elegant, Tanpa Neon Berlebih, Full Fluid 1080p / 2K / 4K
   ========================================================================== */
:root,
[data-theme="dark"] {
  --bg-deep: #0e0f12;
  --bg-sidebar: #0e0f12;
  --bg-topbar: #111216;
  --bg-card: #15161b;
  --bg-subcard: #111217;
  --bg-input: #0e0f13;
  --bg-table-head: #181a20;
  --bg-table-hover: rgba(212, 169, 67, 0.06);
  --bg-console: #0b0c0f;
  --bg-pill: #1a1c22;
  --border-frost: #272932;
  --border-gold: rgba(212, 169, 67, 0.45);
  --text-bright: #f1f3f5;
  --text-body: #b8bdc7;
  --text-muted: #7f8694;
  --accent-gold: #e0b854;
  --accent-gold-strong: #c89b32;
  --emerald: #22c55e;
  --rose: #f43f5e;
  --gold-btn-bg: linear-gradient(90deg, #9a7420 0%, #d4a943 28%, #efe4c2 50%, #d4a943 72%, #9a7420 100%);
  --gold-btn-hover: linear-gradient(90deg, #a87f25 0%, #e0b64f 28%, #f7efd4 50%, #e0b64f 72%, #a87f25 100%);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg-deep: #f2f3f5;
  --bg-sidebar: #f2f3f5;
  --bg-topbar: #ffffff;
  --bg-card: #ffffff;
  --bg-subcard: #f8f9fb;
  --bg-input: #ffffff;
  --bg-table-head: #f1f3f6;
  --bg-table-hover: rgba(180, 130, 30, 0.06);
  --bg-console: #121318;
  --bg-pill: #eef0f4;
  --border-frost: #dcdfe6;
  --border-gold: rgba(180, 128, 30, 0.45);
  --text-bright: #181a1f;
  --text-body: #424752;
  --text-muted: #6c7280;
  --accent-gold: #a17415;
  --accent-gold-strong: #b8861e;
  --emerald: #16a34a;
  --rose: #e11d48;
  --gold-btn-bg: linear-gradient(90deg, #a87d22 0%, #d8ae48 28%, #f3e8c4 50%, #d8ae48 72%, #a87d22 100%);
  --gold-btn-hover: linear-gradient(90deg, #b88a28 0%, #e3ba55 28%, #faf2d9 50%, #e3ba55 72%, #b88a28 100%);
  --shadow-card: 0 4px 14px rgba(15, 23, 42, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13.5px;
  background-color: var(--bg-deep);
  color: var(--text-bright);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- Centered Gold-Silver Gradient Buttons (Simple & Elegant) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 7px; }

.btn-gold {
  color: #111216;
  background: var(--gold-btn-bg);
  border-color: rgba(212, 169, 67, 0.65);
  font-weight: 700;
}
.btn-gold:hover:not(:disabled) {
  background: var(--gold-btn-hover);
  border-color: #e6c66a;
}

.btn-silver {
  color: var(--text-bright);
  background: var(--bg-pill);
  border-color: var(--border-frost);
}
.btn-silver:hover:not(:disabled) {
  border-color: var(--border-gold);
}

.btn-danger {
  color: #fff;
  background: linear-gradient(90deg, #b91c1c 0%, #dc2626 50%, #b91c1c 100%);
  border-color: rgba(244, 63, 94, 0.45);
}
.btn-success {
  color: #052e16;
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 50%, #16a34a 100%);
  border-color: rgba(74, 222, 128, 0.55);
  font-weight: 700;
}

/* ---------- Gate Screens (3-Ring Login & Vault Safe-Lock) ---------- */
.gate-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-ring-stage {
  position: relative;
  width: 580px;
  max-width: 96vw;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px 36px;
}
.login-ring-stage i.ring-line {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(212, 169, 67, 0.58);
  pointer-events: none;
  transition: border-color 0.45s ease, box-shadow 0.45s ease;
}
.login-ring-stage i.ring-line:nth-child(1) {
  border-radius: 38% 62% 63% 37% / 41% 44% 56% 59%;
  border-color: rgba(224, 184, 84, 0.72);
  animation: ringSpin 7s linear infinite;
}
.login-ring-stage i.ring-line:nth-child(2) {
  border-radius: 41% 44% 56% 59% / 38% 62% 63% 37%;
  border-color: rgba(200, 155, 50, 0.58);
  animation: ringSpin 5s linear infinite;
}
.login-ring-stage i.ring-line:nth-child(3) {
  border-radius: 46% 54% 49% 51% / 58% 42% 58% 42%;
  border-color: rgba(184, 189, 199, 0.45);
  animation: ringSpinReverse 9s linear infinite;
}
.login-ring-stage:hover i.ring-line:nth-child(1),
.login-ring-stage:focus-within i.ring-line:nth-child(1) {
  border-width: 3.5px;
  animation: ringSpin 6s linear infinite, colorCycleGold 4.5s ease-in-out infinite;
}
.login-ring-stage:hover i.ring-line:nth-child(2),
.login-ring-stage:focus-within i.ring-line:nth-child(2) {
  border-width: 3.5px;
  animation: ringSpin 4s linear infinite, colorCycleCyan 4.5s ease-in-out infinite;
}
.login-ring-stage:hover i.ring-line:nth-child(3),
.login-ring-stage:focus-within i.ring-line:nth-child(3) {
  border-width: 3.5px;
  animation: ringSpinReverse 7s linear infinite, colorCycleRose 4.5s ease-in-out infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes ringSpinReverse { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }
@keyframes colorCycleGold {
  0%, 100% { border-color: #e0b854; box-shadow: 0 0 18px rgba(224, 184, 84, 0.55); }
  33% { border-color: #4ade80; box-shadow: 0 0 18px rgba(74, 222, 128, 0.5); }
  66% { border-color: #f59e0b; box-shadow: 0 0 18px rgba(245, 158, 11, 0.55); }
}
@keyframes colorCycleCyan {
  0%, 100% { border-color: #22d3ee; box-shadow: 0 0 18px rgba(34, 211, 238, 0.5); }
  33% { border-color: #e0b854; box-shadow: 0 0 18px rgba(224, 184, 84, 0.55); }
  66% { border-color: #a855f7; box-shadow: 0 0 18px rgba(168, 85, 247, 0.5); }
}
@keyframes colorCycleRose {
  0%, 100% { border-color: #fb7185; box-shadow: 0 0 18px rgba(251, 113, 133, 0.5); }
  33% { border-color: #38bdf8; box-shadow: 0 0 18px rgba(56, 189, 248, 0.5); }
  66% { border-color: #e0b854; box-shadow: 0 0 18px rgba(224, 184, 84, 0.55); }
}

.gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 16px;
  padding: 32px 30px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.gate-card.shake { animation: gateShake 0.4s ease; }
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.gate-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 20px; }
.gate-brand img { width: 76px; height: 76px; object-fit: contain; border-radius: 16px; margin-bottom: 10px; }
.brand-title { font-size: 19px; font-weight: 800; color: var(--accent-gold); letter-spacing: 0.4px; }
.brand-sub { font-size: 12.5px; color: var(--text-body); margin-top: 3px; }
.device-box {
  background: var(--bg-subcard);
  border: 1px dashed var(--border-frost);
  border-radius: 10px;
  padding: 10px 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.device-id-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--accent-gold); font-weight: 700; word-break: break-all; }

.login-anim-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(14, 15, 18, 0.94);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
[data-theme="light"] .login-anim-overlay { background: rgba(248, 249, 251, 0.96); }
.vault-loader { position: relative; width: 146px; height: 146px; display: flex; align-items: center; justify-content: center; }
.vault-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vault-gear-outer { transform-origin: 73px 73px; animation: ringSpin 4s linear infinite; }
.vault-gear-inner { transform-origin: 73px 73px; animation: ringSpinReverse 2.5s linear infinite; }
.vault-center-logo { position: relative; z-index: 3; width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.vault-loader.unlocked .vault-gear-outer,
.vault-loader.unlocked .vault-gear-inner { animation-play-state: paused; }
.check-circle { stroke: #d4a943; stroke-width: 3; fill: rgba(212, 169, 67, 0.12); stroke-dasharray: 166; stroke-dashoffset: 166; animation: strokeDraw 0.4s ease forwards; }
.check-mark { stroke: #22c55e; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; fill: none; stroke-dasharray: 48; stroke-dashoffset: 48; animation: strokeDraw 0.3s 0.22s ease forwards; }
@keyframes strokeDraw { to { stroke-dashoffset: 0; } }
.anim-status-text { font-size: 13px; font-weight: 700; color: var(--accent-gold); }

/* ---------- App Shell & Bandar Studio Dark-Silver Floating Sidebar ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-frost);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.2s ease, left 0.22s ease;
  z-index: 40;
}
.sidebar.collapsed { width: 76px; padding: 14px 8px; }
.sidebar.collapsed .brand-text-wrap,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .sidebar-user-text,
.sidebar.collapsed .clock-date-full { display: none; }
.sidebar.collapsed .sidebar-logo-big { width: 44px; height: 44px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-clock-box { padding: 8px 4px; }
.sidebar.collapsed .clock-time { font-size: 12.5px; letter-spacing: 0.4px; }

.sidebar-brand-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 4px 4px 10px;
}
.sidebar-logo-big {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: contain;
  transition: width 0.2s ease, height 0.2s ease;
}
.sidebar-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: var(--accent-gold);
  text-transform: uppercase;
}
.sidebar-collapse-bar {
  width: 100%;
  padding: 7px;
  border-radius: 8px;
  border: 1px solid var(--border-frost);
  background: var(--bg-card);
  color: var(--text-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.sidebar-collapse-bar:hover {
  border-color: var(--border-gold);
  color: var(--accent-gold);
}

.nav-list { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-body);
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-bright);
}
[data-theme="light"] .nav-item:hover { background: rgba(0, 0, 0, 0.04); }
.nav-item.active {
  color: var(--text-bright);
  background: var(--bg-card);
  border-color: var(--border-frost);
  border-left: 3px solid var(--accent-gold);
  font-weight: 600;
}
.nav-icon { font-size: 14px; flex-shrink: 0; opacity: 0.9; }

/* Digital Clock Widget at Bottom of Left Sidebar */
.sidebar-clock-box {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 10px 10px;
  text-align: center;
}
.clock-time {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 1px;
}
.clock-date-full {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 6px;
}

/* ---------- Topbar ---------- */
.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-deep); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 22px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-frost);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.menu-toggle-mobile {
  display: none;
  background: var(--bg-pill);
  border: 1px solid var(--border-frost);
  color: var(--text-bright);
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
}
.page-heading { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-pill);
  border: 1px solid var(--border-frost);
  color: var(--text-body);
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); }

.content-body {
  padding: 18px 22px 28px;
  width: 100%;
  max-width: none;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.page-section { display: flex; flex-direction: column; flex: 1; width: 100%; }

/* ---------- Cards, Sub-Cards & Grids ---------- */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.card-gold { border-color: var(--border-gold); }
.dash-bottom-grid { flex: 1; align-items: stretch; margin-bottom: 0; }
.dash-bottom-grid > .card { display: flex; flex-direction: column; min-height: 340px; }
.dash-bottom-grid .log-console { flex: 1; max-height: none; min-height: 260px; }

.collapsible-form-wrap { margin-bottom: 16px; }
.collapsible-form-wrap.collapsed { display: none; }

.section-card {
  background: var(--bg-subcard);
  border: 1px solid rgba(212, 169, 67, 0.32);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.section-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-frost);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold);
}
.step-num {
  width: 21px;
  height: 21px;
  border-radius: 6px;
  background: var(--gold-btn-bg);
  color: #111216;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 700; color: var(--text-bright); display: flex; align-items: center; gap: 8px; }

.metric-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 600; }
.metric-value { font-size: 22px; font-weight: 800; margin: 4px 0; color: var(--accent-gold); }
.metric-sub { font-size: 12px; color: var(--text-body); }

.progress-track { width: 100%; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.16); overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--gold-btn-bg); transition: width 0.3s ease; }

/* ---------- Forms, Preflight Banner & Password Eye ---------- */
.form-row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
label { font-size: 12px; font-weight: 600; color: var(--text-body); }

input, select, textarea {
  width: 100%;
  padding: 8px 11px;
  border-radius: 7px;
  border: 1px solid var(--border-frost);
  background: var(--bg-input);
  color: var(--text-bright);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-gold); }
textarea { min-height: 78px; resize: vertical; }

.input-with-btn { display: flex; gap: 6px; align-items: center; }
.input-with-btn input { flex: 1; min-width: 0; }

.pass-wrap { position: relative; display: flex; align-items: center; }
.pass-wrap input { padding-right: 40px; }
.pass-eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 6px; border: none; background: transparent;
  color: var(--text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.pass-eye-btn:hover { color: var(--accent-gold); }
.pass-eye-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.preflight-box {
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-frost);
  background: var(--bg-input);
  margin-top: 2px;
}
.preflight-box.ok { border-color: rgba(34, 197, 94, 0.45); color: var(--emerald); }
.preflight-box.warn { border-color: rgba(245, 158, 11, 0.65); color: #f59e0b; background: rgba(245, 158, 11, 0.08); }

.hms-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.hms-cell { display: flex; flex-direction: column; gap: 3px; }
.hms-cell span { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.check-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 3px 0; }
.check-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-bright); cursor: pointer; }
.check-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: #d4a943; cursor: pointer; }

.day-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.day-pill {
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border-frost);
  background: var(--bg-input); color: var(--text-body); font-size: 12px; font-weight: 600; cursor: pointer;
}
.day-pill.active { background: var(--gold-btn-bg); color: #111216; border-color: rgba(212, 169, 67, 0.75); font-weight: 700; }

.thumb-preview-box {
  display: flex; align-items: center; gap: 11px; padding: 9px;
  border-radius: 9px; border: 1px dashed var(--border-frost); background: var(--bg-input);
}
.thumb-preview-box img { width: 108px; height: 62px; object-fit: cover; border-radius: 6px; background: #1e2028; flex-shrink: 0; }

/* ---------- Scrollable Sticky Tables ---------- */
.table-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.table-toolbar input { width: 195px; padding: 6px 10px; font-size: 12.5px; }
.table-toolbar select { width: 145px; padding: 6px 9px; font-size: 12.5px; }

.table-scroll { width: 100%; overflow: auto; border-radius: 10px; border: 1px solid var(--border-frost); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 9px 11px; text-align: left; border-bottom: 1px solid var(--border-frost); vertical-align: middle; }
th {
  position: sticky; top: 0; z-index: 5; background: var(--bg-table-head);
  color: var(--accent-gold); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700;
}
tr:hover td { background: var(--bg-table-hover); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-live { background: rgba(34, 197, 94, 0.14); color: var(--emerald); border: 1px solid rgba(34, 197, 94, 0.4); }
.badge-standby { background: var(--bg-pill); color: var(--text-body); border: 1px solid var(--border-frost); }
.badge-gold { background: rgba(212, 169, 67, 0.15); color: var(--accent-gold); border: 1px solid var(--border-gold); }
.badge-error { background: rgba(244, 63, 94, 0.15); color: var(--rose); border: 1px solid rgba(244, 63, 94, 0.4); }

/* ---------- Logs & Diagnosis ---------- */
.log-console {
  background: var(--bg-console); color: #d4d8e0; border: 1px solid var(--border-frost);
  border-radius: 9px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: 12px;
  max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px;
}
.log-line { display: flex; gap: 8px; word-break: break-word; }
.log-ts { color: #7f8694; flex-shrink: 0; }
.log-lvl-INFO { color: #38bdf8; font-weight: 700; }
.log-lvl-SUCCESS { color: #4ade80; font-weight: 700; }
.log-lvl-WARNING { color: #e0b854; font-weight: 700; }
.log-lvl-ERROR { color: #fb7185; font-weight: 700; }

.diag-card { border-radius: 10px; padding: 14px 16px; background: var(--bg-subcard); border: 1px solid var(--border-frost); }
.diag-card.error { border-color: var(--rose); }
.diag-card.warning { border-color: var(--border-gold); }
.diag-card.ok { border-color: rgba(34, 197, 94, 0.45); }
.diag-title { font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.diag-list { padding-left: 18px; margin-top: 6px; color: var(--text-body); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }

/* ---------- Book-Style Guide ---------- */
.guide-book { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; flex: 1; min-height: 540px; }
.guide-toc { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.guide-toc-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--accent-gold); font-weight: 700; padding: 6px 8px 9px; border-bottom: 1px solid var(--border-frost); margin-bottom: 4px; }
.guide-topic-btn { text-align: left; padding: 9px 11px; border-radius: 8px; border: 1px solid transparent; border-left: 3px solid transparent; background: transparent; color: var(--text-body); font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.guide-topic-btn:hover { background: var(--bg-pill); color: var(--text-bright); }
.guide-topic-btn.active { background: var(--bg-subcard); border-color: var(--border-frost); border-left: 3px solid var(--accent-gold); color: var(--accent-gold); font-weight: 700; }
.guide-reader { background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 12px; padding: 24px 28px; overflow-y: auto; }
.guide-reader h2 { font-size: 17px; font-weight: 700; color: var(--accent-gold); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-frost); }
.guide-reader h3 { font-size: 13.5px; font-weight: 700; color: var(--text-bright); margin: 16px 0 6px; }
.guide-reader p, .guide-reader li { color: var(--text-body); font-size: 13px; line-height: 1.65; }
.guide-reader ol, .guide-reader ul { padding-left: 20px; display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.guide-tip { background: var(--bg-subcard); border-left: 3px solid var(--accent-gold); border-radius: 8px; padding: 10px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-bright); }

/* ---------- Modal & Toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 7, 10, 0.76); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 90; }
.modal-box { width: 100%; max-width: 780px; max-height: 88vh; overflow-y: auto; background: var(--bg-card); border: 1px solid var(--border-gold); border-radius: 14px; padding: 20px; }
.file-entry { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; border-radius: 8px; border: 1px solid var(--border-frost); background: var(--bg-subcard); cursor: pointer; margin-bottom: 5px; }
.file-entry:hover { border-color: var(--border-gold); }
.toast-container { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 15px; border-radius: 9px; background: var(--bg-card); border: 1px solid var(--border-gold); color: var(--text-bright); font-size: 12.5px; font-weight: 600; max-width: 380px; box-shadow: var(--shadow-card); }
.toast.error { border-color: var(--rose); color: var(--rose); }

@media (max-width: 1140px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: -260px; top: 0; width: 232px !important; }
  .sidebar.open { left: 0; }
  .menu-toggle-mobile { display: inline-flex; }
  .form-row-2, .form-row-3, .guide-book { grid-template-columns: 1fr; }
  .table-toolbar { flex-wrap: wrap; width: 100%; }
  .table-toolbar input, .table-toolbar select { width: 100%; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
}


/* ==========================================================================
   SMART DISABLED STATE (TOMBOL, INPUT, HARI, & CENTANG NONAKTIF)
   ========================================================================== */
button:disabled,
.btn:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.day-pill:disabled {
  opacity: 0.38 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.45);
}
.check-item.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}


/* ==========================================================================
   EXECUTIVE LUXURY DASHBOARD (KHUSUS HALAMAN PEMBUKA DASHBOARD)
   ========================================================================== */
#page-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: calc(100vh - 104px);
}
#page-dashboard.hidden {
  display: none !important;
}
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (min-width: 1750px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .dash-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
}
.dash-kpi {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.dash-kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
}
.kpi-gold {
  background: linear-gradient(145deg, rgba(212, 169, 67, 0.16) 0%, var(--bg-card) 68%) !important;
}
.kpi-gold::before { background: linear-gradient(90deg, #9a7420, #efe4c2, #9a7420); }
.kpi-gold .metric-value { color: #f3d78a; }

.kpi-emerald {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.16) 0%, var(--bg-card) 68%) !important;
}
.kpi-emerald::before { background: linear-gradient(90deg, #059669, #34d399, #059669); }
.kpi-emerald .metric-value { color: #34d399; }

.kpi-blue {
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.16) 0%, var(--bg-card) 68%) !important;
}
.kpi-blue::before { background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb); }
.kpi-blue .metric-value { color: #60a5fa; }
.bar-blue { background: linear-gradient(90deg, #2563eb, #60a5fa) !important; }

.kpi-purple {
  background: linear-gradient(145deg, rgba(168, 85, 247, 0.16) 0%, var(--bg-card) 68%) !important;
}
.kpi-purple::before { background: linear-gradient(90deg, #7c3aed, #c084fc, #7c3aed); }
.kpi-purple .metric-value { color: #c084fc; }
.bar-purple { background: linear-gradient(90deg, #7c3aed, #c084fc) !important; }

.kpi-teal {
  background: linear-gradient(145deg, rgba(20, 184, 166, 0.16) 0%, var(--bg-card) 68%) !important;
}
.kpi-teal::before { background: linear-gradient(90deg, #0d9488, #2dd4bf, #0d9488); }
.kpi-teal .metric-value { color: #2dd4bf; }
.bar-teal { background: linear-gradient(90deg, #0d9488, #2dd4bf) !important; }

.kpi-rose {
  background: linear-gradient(145deg, rgba(244, 63, 94, 0.15) 0%, var(--bg-card) 68%) !important;
}
.kpi-rose::before { background: linear-gradient(90deg, #e11d48, #fb7185, #e11d48); }
.kpi-rose .metric-value { color: #fda4af; }

[data-theme="light"] .kpi-gold .metric-value { color: #9a6d10; }
[data-theme="light"] .kpi-emerald .metric-value { color: #047857; }
[data-theme="light"] .kpi-blue .metric-value { color: #1d4ed8; }
[data-theme="light"] .kpi-purple .metric-value { color: #6d28d9; }
[data-theme="light"] .kpi-teal .metric-value { color: #0f766e; }
[data-theme="light"] .kpi-rose .metric-value { color: #be123c; }

.dash-today-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.dash-today-scroll {
  flex: 1 1 auto;
  max-height: none;
}


/* ==========================================================================
   POLISH: SEAMLESS TABLE ACTION CELLS, FULL-HEIGHT STRETCH, THEME TOGGLE
   ========================================================================== */
.action-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}
.page-section {
  min-height: calc(100vh - 104px);
}
.page-section.hidden {
  display: none !important;
}
.card-stretch {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 360px;
}
.card-stretch > .table-scroll {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: none;
  overflow: auto;
}
.card-stretch > .log-console {
  flex: 1 1 auto;
  min-height: 260px;
  max-height: none;
}
.card-flex-col {
  display: flex;
  flex-direction: column;
}
.flex-textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

.cache-clean-box {
  background: var(--bg-subcard);
  border: 1px solid var(--border-frost);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 0;
}

/* Elegant Icon-Only Dark/Light Pill Toggle */
.theme-switch {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.theme-switch-track {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b1d24, #282b34);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  transition: background 0.25s ease, border-color 0.25s ease;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.45);
}
.theme-icon-moon,
.theme-icon-sun {
  font-size: 0.78rem;
  line-height: 1;
  z-index: 1;
  user-select: none;
  transition: opacity 0.2s ease;
}
.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b88a28, #efe4c2, #b88a28);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 2;
}
[data-theme="light"] .theme-switch-track {
  background: linear-gradient(135deg, #e7dfc8, #f7f3e8);
  border-color: rgba(180, 138, 42, 0.65);
}
[data-theme="light"] .theme-switch-thumb {
  transform: translateX(27px);
}


/* Read-Only Interactive Media Roots List & Clean Settings Grid */
.settings-grid-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-grid-stack > .grid-2 {
  margin-bottom: 0 !important;
  align-items: stretch;
}
.media-roots-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 235px;
  overflow-y: auto;
  padding-right: 4px;
}
.media-root-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--bg-subcard);
  border: 1px solid var(--border-frost);
  font-size: 0.82rem;
}
.media-root-path {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.media-root-tag {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(212, 169, 67, 0.14);
  color: var(--accent-gold);
  border: 1px solid rgba(212, 169, 67, 0.3);
  flex-shrink: 0;
}


/* ==========================================================================
   PAGINATION FOOTER (MAKSIMAL 30 BARIS/HALAMAN) & FIXED SCROLLABLE LOG BOX
   ========================================================================== */
.table-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  margin-top: 10px;
  border-top: 1px solid var(--border-frost);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.table-pager-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.table-pager-indicator {
  padding: 4px 11px;
  border-radius: 8px;
  background: var(--bg-subcard);
  border: 1px solid var(--border-gold);
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.8rem;
}
#full-log-console {
  height: min(630px, calc(100vh - 375px));
  min-height: 280px;
  max-height: 630px;
  overflow-y: auto !important;
  overflow-x: auto;
  flex: 0 0 auto !important;
}
#page-logs .card-stretch {
  flex: 0 0 auto;
  min-height: 0;
}


/* ==========================================================================
   STARTUP BOOT SPLASH ANIMATION (ORBITAL GOLD-SILVER + SONAR PULSE)
   ========================================================================== */
.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 42%, #1d1f26 0%, #0e0f12 68%, #090a0d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.42s ease, visibility 0.42s ease;
}
.boot-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.boot-orbit-stage {
  position: relative;
  width: 158px;
  height: 158px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.boot-logo {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  position: relative;
  z-index: 4;
  box-shadow: 0 0 28px rgba(212, 169, 67, 0.35);
  animation: bootLogoBreath 2.4s ease-in-out infinite;
}
.boot-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.boot-ring-outer {
  inset: 0;
  border-top-color: #efe4c2;
  border-right-color: rgba(212, 169, 67, 0.55);
  animation: bootSpinCW 2.6s linear infinite;
}
.boot-ring-mid {
  inset: 14px;
  border-bottom-color: #d4a943;
  border-left-color: rgba(203, 213, 225, 0.55);
  animation: bootSpinCCW 1.9s linear infinite;
}
.boot-ring-inner {
  inset: 28px;
  border-top-color: rgba(226, 232, 240, 0.7);
  border-bottom-color: rgba(212, 169, 67, 0.7);
  animation: bootSpinCW 1.3s linear infinite;
}
.boot-sonar {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(212, 169, 67, 0.45);
  animation: bootSonarPulse 2.4s ease-out infinite;
}
.boot-sonar-2 {
  animation-delay: 1.2s;
}
.boot-brand-text {
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  background: linear-gradient(90deg, #a8832e 0%, #efe4c2 50%, #a8832e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.boot-status-text {
  font-size: 0.84rem;
  color: #a1a8b8;
}
.boot-bar-track {
  width: 210px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 4px;
}
.boot-bar-shimmer {
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9a7420, #efe4c2, #9a7420);
  animation: bootShimmer 1.35s ease-in-out infinite;
}
@keyframes bootSpinCW { to { transform: rotate(360deg); } }
@keyframes bootSpinCCW { to { transform: rotate(-360deg); } }
@keyframes bootLogoBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
@keyframes bootSonarPulse {
  0% { transform: scale(0.82); opacity: 0.75; }
  100% { transform: scale(1.38); opacity: 0; }
}
@keyframes bootShimmer {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(250%); }
}
.yt-net-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subcard);
  border: 1px solid var(--border-frost);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}
.yt-net-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
