@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --canvas: #070b14;
  --surface: #0f172a;
  --surface-2: #131d33;
  --line: #1e293b;
  --accent: #38bdf8;
  --accent-deep: #0ea5e9;
  --ink: #e6edf7;
  --ink-soft: #93a4bd;
  --ink-faint: #5b6b86;
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 20px 60px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* Atribut hidden harus selalu menang atas display milik komponen,
   kalau tidak elemen seperti .hint-link tetap tampil saat disembunyikan. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: inherit;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--canvas); }
::-webkit-scrollbar-thumb { background: #24334d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #34486b; }

/* ---------------------------------------------------------------- brand */

.brand-mark {
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(14, 165, 233, 0.28);
}
.brand-mark img { display: block; width: 100%; height: 100%; }

.brand-name {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 18px 0 6px;
  color: var(--ink);
}
.brand-name em { font-style: normal; color: var(--accent); }

.brand-sub {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 250px;
}

/* ---------------------------------------------------------------- login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1000px 520px at 12% -10%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(760px 420px at 92% 108%, rgba(124, 58, 237, 0.16), transparent 60%),
    var(--canvas);
}

.login-card {
  width: min(960px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}

.login-aside {
  background: linear-gradient(150deg, #101a33 0%, #0b1120 100%);
  border-right: 1px solid var(--line);
  padding: 56px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.login-main {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
}

.field { position: relative; margin-bottom: 14px; }
.field svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-faint);
  pointer-events: none;
}
.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input::placeholder { color: var(--ink-faint); font-weight: 500; }
.field input:focus {
  outline: none;
  background: #16223c;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22);
}
.field input:disabled { opacity: 0.6; cursor: not-allowed; }
.field.code input { letter-spacing: 0.3em; font-weight: 700; }

.field .peek {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.field .peek:hover { color: var(--accent); background: rgba(56, 189, 248, 0.1); }
.field input[type="password"], .field input[autocomplete="current-password"] { padding-right: 92px; }


.btn {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, var(--accent-deep), #3b82f6);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn:focus-visible { outline: 3px solid rgba(56, 189, 248, 0.5); outline-offset: 2px; }

.btn-ghost {
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover:not(:disabled) { background: #1a2742; filter: none; transform: none; }

.hint-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
}
.hint-link:hover { color: var(--accent); }

.alert {
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  margin-bottom: 14px;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.25);
}
.alert.info {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.25);
}
.alert[hidden] { display: none; }


/* ------------------------------------------------- blok bantuan di login */

.bantuan {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bantuan-judul {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 2px;
}

.bantuan .btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  font-size: 14px;
  text-decoration: none;
}
.bantuan .btn svg { width: 18px; height: 18px; flex: none; }

.btn-wa {
  background: linear-gradient(100deg, #1faa54, #25d366);
  color: #ffffff;
}
.btn-wa:hover:not(:disabled) { filter: brightness(1.1); }

.btn-grup { color: var(--ink); }
.btn-grup:hover:not(:disabled) { color: var(--accent); }

/* ------------------------------------------------------------ dashboard */

.shell {
  display: grid;
  grid-template-columns: 258px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0b1120;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--line);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 26px;
}
.sidebar-brand .brand-mark { width: 84px; height: 84px; border-radius: 20px; }
.sidebar-brand .brand-name { font-size: 23px; margin: 14px 0 2px; }
.sidebar-brand .tagline { font-size: 12px; color: var(--ink-faint); font-weight: 600; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 15px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 20px; height: 20px; flex: none; }
.nav-item:hover { background: #16223c; color: var(--ink); }
.nav-item.active {
  background: linear-gradient(100deg, rgba(14, 165, 233, 0.18), rgba(59, 130, 246, 0.1));
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.28);
}
.nav-item.active svg { color: var(--accent); }
.nav-divider { height: 1px; background: var(--line); margin: 12px 4px; }

.status-chip {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.dot.live { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18); }
.dot.down { background: var(--danger); box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16); }

.stage { padding: 18px; background: var(--canvas); }
.stage-frame {
  width: 100%;
  height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage-frame iframe { width: 100%; height: 100%; border: none; display: block; }

.stage-empty {
  height: 100%;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 32px;
}
.stage-empty h2 { margin: 0; font-size: 18px; }
.stage-empty p { margin: 0; max-width: 380px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }

/* ---------------------------------------------------------------- modal */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 13, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 50;
}
.overlay[hidden] { display: none; }

.modal {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 28px;
}
.modal h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.modal .meta { margin: 0 0 16px; font-size: 14px; color: var(--ink-soft); }
.modal .meta strong { color: var(--ink); }
.modal .btn { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.modal-actions .btn { width: auto; min-width: 104px; height: 44px; margin: 0; padding: 0 20px; }

@media (max-width: 860px) {
  .login-card { grid-template-columns: 1fr; }
  .login-aside { padding: 40px 24px 24px; }
  .login-main { padding: 24px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; align-items: center; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); padding: 14px; }
  .sidebar-brand { flex-direction: row; gap: 10px; padding: 0 12px 0 0; align-items: center; }
  .sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 10px; }
  .sidebar-brand .brand-name { font-size: 18px; margin: 0; }
  .sidebar-brand .tagline { display: none; }
  .nav-item { width: auto; padding: 10px 12px; }
  .nav-divider { display: none; }
  .status-chip { margin: 0 0 0 auto; }
  .stage-frame { height: calc(100vh - 140px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:hover:not(:disabled) { transform: none; }
}
