:root {
  color-scheme: dark;
  --background: #071116;
  --panel: rgba(13, 30, 37, 0.78);
  --line: rgba(189, 219, 218, 0.12);
  --text: #f5f3e9;
  --muted: #8ea5a8;
  --gold: #e4b85d;
  --gold-light: #f5d78f;
  --teal: #4ed4bd;
  --warning: #f1a35d;
  --danger: #f1746d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: radial-gradient(circle at 75% 5%, rgba(32, 108, 103, 0.16), transparent 28rem), linear-gradient(145deg, #071116 0%, #08151a 48%, #061014 100%);
}
button, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
.ambient { position: fixed; z-index: -1; width: 24rem; height: 24rem; border-radius: 50%; filter: blur(110px); opacity: 0.12; pointer-events: none; }
.ambient-one { top: 8%; right: 8%; background: var(--teal); }
.ambient-two { bottom: 5%; left: 32%; background: var(--gold); opacity: 0.06; }
.app-shell { min-height: 100vh; }
.app-shell.app-loading { visibility: hidden; }
.login-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
  background: radial-gradient(circle at 50% 28%, rgba(32, 108, 103, 0.2), transparent 25rem), #071116;
}
.login-gate.visible { display: grid; }
.login-gate img { margin-bottom: 26px; border-radius: 22px; box-shadow: 0 20px 55px rgba(0, 0, 0, 0.4); }
.login-gate h1 { margin-bottom: 12px; }
.login-gate > p:not(.eyebrow) { max-width: 430px; margin-bottom: 25px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.login-gate small { margin-top: 17px; color: #62777a; font-size: 9px; }
.discord-login { padding: 13px 19px; border-radius: 11px; color: #fff; background: #5865f2; font-size: 12px; font-weight: 800; box-shadow: 0 12px 30px rgba(88, 101, 242, 0.24); }
.discord-login:hover { background: #6874f5; transform: translateY(-1px); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 260px;
  flex-direction: column;
  padding: 30px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgba(6, 17, 22, 0.88);
  backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px; }
.brand img { border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28); }
.brand span, .profile span, .security-note div { display: flex; flex-direction: column; }
.brand strong { font-size: 15px; letter-spacing: 0.02em; }
.brand small { margin-top: 2px; color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.navigation { display: grid; gap: 7px; margin-top: 54px; }
.nav-item { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid transparent; border-radius: 12px; color: var(--muted); font-size: 13px; font-weight: 650; transition: 160ms ease; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.035); }
.nav-item.active { color: var(--gold-light); border-color: rgba(228, 184, 93, 0.16); background: rgba(228, 184, 93, 0.09); }
.nav-icon { width: 22px; color: currentColor; font-size: 19px; text-align: center; }
.sidebar-footer { display: grid; gap: 13px; margin-top: auto; }
.security-note, .profile { display: flex; align-items: center; gap: 11px; }
.security-note { padding: 12px; border: 1px solid rgba(78, 212, 189, 0.13); border-radius: 12px; background: rgba(78, 212, 189, 0.05); }
.security-note strong, .profile strong { font-size: 11px; }
.security-note small, .profile small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.lock-dot { color: var(--teal); font-size: 10px; }
.profile { width: 100%; padding: 10px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.profile:hover { background: rgba(255, 255, 255, 0.035); }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(228, 184, 93, 0.22); border-radius: 50%; color: var(--gold-light); background: rgba(228, 184, 93, 0.1); font-size: 12px; font-weight: 800; }

.main-content { width: min(1240px, calc(100% - 260px)); margin-left: 260px; padding: 44px clamp(28px, 4vw, 64px) 32px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 32px; }
.eyebrow { margin: 0 0 7px; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(28px, 4vw, 43px); line-height: 1.08; letter-spacing: -0.045em; }
h2 { margin-bottom: 0; font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.03em; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; padding-top: 9px; }
.last-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(78, 212, 189, 0.08); }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); cursor: pointer; transition: 160ms ease; }
.icon-button:hover { border-color: rgba(228, 184, 93, 0.35); color: var(--gold-light); transform: translateY(-1px); }

.panel { border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(380px, 0.88fr); gap: 15px; }
.status-card { min-height: 300px; padding: 27px; overflow: hidden; background: linear-gradient(145deg, rgba(17, 46, 54, 0.95), rgba(10, 27, 34, 0.82)); }
.status-card-top { display: flex; justify-content: space-between; }
.card-label { margin-bottom: 12px; color: var(--muted); font-size: 11px; font-weight: 650; }
.service-status { display: flex; align-items: center; gap: 10px; }
.service-status strong { font-size: 25px; letter-spacing: -0.035em; }
.status-indicator { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 6px rgba(78, 212, 189, 0.1), 0 0 25px rgba(78, 212, 189, 0.45); }
.status-indicator.offline { background: var(--danger); box-shadow: 0 0 0 6px rgba(241, 116, 109, 0.1); }
.service-mark { display: grid; width: 53px; height: 53px; place-items: center; border: 1px solid rgba(228, 184, 93, 0.19); border-radius: 17px; color: var(--gold); background: rgba(228, 184, 93, 0.06); font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 500; }
.status-details { display: grid; grid-template-columns: 1.3fr 1fr 0.7fr; gap: 20px; margin: 50px 0 25px; }
.status-details div { display: grid; gap: 6px; }
.status-details span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.status-details strong { overflow: hidden; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; font-weight: 500; text-overflow: ellipsis; }
.health-line { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.health-line span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2baa99, var(--teal)); box-shadow: 0 0 14px rgba(78, 212, 189, 0.45); }
.health-copy { margin: 12px 0 0; color: #9bbfba; font-size: 10px; }

.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.metric-card { display: flex; min-height: 142px; align-items: center; gap: 15px; padding: 19px; box-shadow: none; }
.metric-icon { display: grid; flex: 0 0 auto; width: 38px; height: 38px; place-items: center; border: 1px solid rgba(228, 184, 93, 0.15); border-radius: 12px; color: var(--gold); background: rgba(228, 184, 93, 0.07); font-size: 19px; }
.metric-card div { display: grid; min-width: 0; gap: 4px; }
.metric-card div > span { color: var(--muted); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.metric-card strong { overflow: hidden; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 14px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { overflow: hidden; color: #70898d; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.section { margin-top: 42px; scroll-margin-top: 22px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.demo-badge { padding: 6px 9px; border: 1px solid rgba(228, 184, 93, 0.17); border-radius: 999px; color: var(--gold); background: rgba(228, 184, 93, 0.06); font-size: 8px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.action-card { display: grid; grid-template-columns: auto 1fr auto; min-height: 98px; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(13, 30, 37, 0.68); cursor: pointer; text-align: left; transition: 170ms ease; }
.action-card:hover { border-color: rgba(228, 184, 93, 0.3); background: rgba(20, 42, 48, 0.85); transform: translateY(-2px); box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2); }
.action-symbol { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px; font-size: 22px; }
.update-action .action-symbol { color: var(--teal); background: rgba(78, 212, 189, 0.08); }
.restart-action .action-symbol { color: var(--gold-light); background: rgba(228, 184, 93, 0.09); }
.action-card > span:nth-child(2) { display: grid; gap: 5px; }
.action-card strong { font-size: 13px; }
.action-card small { color: var(--muted); font-size: 10px; }
.action-arrow { color: var(--muted); }

.log-heading { align-items: center; }
.log-controls { display: flex; gap: 8px; }
select, .secondary-button, .primary-button { min-height: 37px; border-radius: 10px; padding: 0 13px; cursor: pointer; }
select { border: 1px solid var(--line); color: var(--muted); background: #0b1a20; font-size: 10px; outline: none; }
.secondary-button { border: 1px solid var(--line); color: var(--text); background: rgba(255, 255, 255, 0.025); font-size: 10px; font-weight: 700; }
.primary-button { border: 1px solid rgba(228, 184, 93, 0.5); color: #211a0e; background: linear-gradient(135deg, var(--gold-light), var(--gold)); font-size: 10px; font-weight: 800; }
.terminal { overflow: hidden; border-radius: 16px; background: rgba(4, 12, 16, 0.88); box-shadow: none; }
.terminal-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.terminal-bar > div { display: flex; gap: 6px; }
.terminal-bar > div span { width: 7px; height: 7px; border-radius: 50%; background: #34464a; }
.terminal-bar > div span:first-child { background: var(--danger); }
.terminal-bar > div span:nth-child(2) { background: var(--gold); }
.terminal-bar > div span:last-child { background: var(--teal); }
.terminal-bar small { color: #566b6f; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 8px; }
.terminal-body { display: grid; gap: 2px; max-height: 294px; padding: 14px 17px 18px; overflow: auto; }
.terminal-body p { display: grid; grid-template-columns: 102px 42px 1fr; gap: 10px; margin: 0; padding: 7px 5px; border-radius: 6px; color: #b1c1c1; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 11px; line-height: 1.5; }
.terminal-body p.loading-entry { display: block; color: var(--muted); }
.terminal-body p:hover { background: rgba(255, 255, 255, 0.025); }
.terminal-body time { color: #50676b; }
.log-level { font-size: 9px; font-weight: 700; }
.log-level.success { color: var(--teal); }
.log-level.info { color: #7ca9cb; }
.log-level.warning { color: var(--warning); }
.log-level.error { color: var(--danger); }
.terminal-body p.hidden { display: none; }
.page-footer { display: flex; justify-content: space-between; margin-top: 30px; padding: 18px 2px 8px; border-top: 1px solid var(--line); color: #53676a; font-size: 9px; }
.mobile-navigation { display: none; }

.confirmation-dialog { width: min(460px, calc(100% - 28px)); padding: 0; border: 1px solid rgba(228, 184, 93, 0.22); border-radius: 20px; color: var(--text); background: #0c1c22; box-shadow: 0 35px 100px rgba(0, 0, 0, 0.62); }
.confirmation-dialog::backdrop { background: rgba(1, 7, 9, 0.76); backdrop-filter: blur(8px); }
.confirmation-dialog form { position: relative; padding: 31px; }
.dialog-close { position: absolute; top: 13px; right: 13px; width: 34px; height: 34px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 22px; }
.dialog-symbol { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 24px; border-radius: 15px; color: var(--gold-light); background: rgba(228, 184, 93, 0.09); font-size: 24px; }
.confirmation-dialog h2 { margin-bottom: 10px; }
.confirmation-dialog .eyebrow { font-size: 10px; }
.confirmation-dialog > form > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.7; }
.dialog-warning { display: flex; gap: 12px; margin-top: 22px; padding: 13px; border: 1px solid rgba(241, 163, 93, 0.15); border-radius: 12px; background: rgba(241, 163, 93, 0.06); }
.dialog-warning > span { display: grid; flex: 0 0 auto; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: #21150c; background: var(--warning); font-size: 10px; font-weight: 900; }
.dialog-warning p { margin: 1px 0 0; color: #c5a98d; font-size: 12px; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 26px; }
.dialog-actions button { min-height: 41px; font-size: 12px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; display: flex; align-items: center; gap: 11px; max-width: calc(100% - 48px); padding: 13px 16px; border: 1px solid rgba(78, 212, 189, 0.22); border-radius: 13px; background: #10272b; box-shadow: var(--shadow); opacity: 0; transform: translateY(14px); pointer-events: none; transition: 200ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { border-color: rgba(241, 116, 109, 0.25); }
.toast.error > span { color: #210b0b; background: var(--danger); }
.toast > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; color: #061410; background: var(--teal); font-size: 11px; font-weight: 900; }
.toast p { display: grid; gap: 2px; margin: 0; }
.toast strong { font-size: 10px; }
.toast small { color: var(--muted); font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr; }
  .status-card { min-height: 265px; }
  .metric-card { min-height: 120px; }
}
@media (max-width: 760px) {
  body { padding-bottom: 74px; }
  .sidebar { display: none; }
  .main-content { width: 100%; margin: 0; padding: 27px 17px 24px; }
  .topbar { align-items: center; margin-bottom: 25px; }
  .topbar .subtitle, .last-check { display: none; }
  h1 { margin-bottom: 0; font-size: 29px; }
  .topbar-actions { padding-top: 0; }
  .hero-grid { gap: 12px; }
  .status-card { min-height: 0; padding: 21px; }
  .status-details { grid-template-columns: 1fr 1fr; margin: 35px 0 22px; }
  .status-details div:last-child { display: none; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 114px; gap: 10px; padding: 14px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-card strong { font-size: 12px; }
  .metric-card small { display: none; }
  .section { margin-top: 34px; }
  .action-grid { grid-template-columns: 1fr; gap: 10px; }
  .action-card { min-height: 88px; }
  .log-heading { align-items: flex-end; }
  .select-wrapper { display: none; }
  .terminal-body p { grid-template-columns: 96px 37px minmax(220px, 1fr); }
  .terminal-body { overflow-x: auto; }
  .page-footer { display: grid; gap: 5px; padding-bottom: 8px; }
  .mobile-navigation { position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); padding: 9px 10px max(9px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(6, 17, 22, 0.94); backdrop-filter: blur(20px); }
  .mobile-navigation a { display: grid; place-items: center; gap: 2px; color: var(--muted); font-size: 8px; font-weight: 700; }
  .mobile-navigation a > span { font-size: 18px; line-height: 1.1; }
  .mobile-navigation a.active { color: var(--gold-light); }
  .toast { right: 14px; bottom: 82px; max-width: calc(100% - 28px); }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 82px; }
  .metric-card small { display: block; }
  .demo-badge { display: none; }
  .action-card { grid-template-columns: auto 1fr; }
  .action-arrow { display: none; }
  .dialog-actions { display: grid; grid-template-columns: 1fr; }
  .dialog-actions button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
