:root {
  color-scheme: dark;
  --bg: #050c19;
  --surface: rgba(14, 29, 53, .86);
  --surface-2: #122746;
  --line: rgba(126, 175, 255, .2);
  --text: #eef5ff;
  --muted: #91a6c3;
  --blue: #3987ff;
  --blue-2: #76b0ff;
  --green: #47d7a0;
  --red: #ff657a;
  --shadow: 0 28px 80px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 12% 0%, rgba(40, 105, 214, .18), transparent 30%), radial-gradient(circle at 90% 20%, rgba(57, 135, 255, .1), transparent 28%), var(--bg); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: 12px max(24px, calc((100vw - 1280px) / 2)); border-bottom: 1px solid var(--line); background: rgba(5, 12, 25, .86); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.25); border-radius: 13px; color: white; background: linear-gradient(145deg, #65a5ff, #1763d8 65%, #0b3d97); box-shadow: 0 10px 28px rgba(37, 113, 235, .35), inset 0 1px rgba(255,255,255,.3); font-size: 25px; font-weight: 900; }
.brand-mark.large { width: 68px; height: 68px; border-radius: 20px; font-size: 40px; }
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .13em; text-transform: uppercase; }
nav { display: flex; align-items: center; gap: 24px; color: #b8c8de; }
nav form { margin: 0; }
nav a:hover, .link-button:hover { color: white; }
.link-button { padding: 0; border: 0; color: #b8c8de; background: none; }

.shell { width: min(1280px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 32px; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.hero h1 { margin: 7px 0 8px; font-size: clamp(32px, 4vw, 52px); line-height: 1.05; letter-spacing: -.04em; }
.hero p { max-width: 680px; margin: 0; color: var(--muted); font-size: 17px; }
.eyebrow { color: var(--blue-2); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.live-badge { flex: none; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid rgba(71, 215, 160, .25); border-radius: 999px; color: #b9f7df; background: rgba(27, 111, 79, .14); }
.pulse, .status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(71, 215, 160, .1); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stats article, .panel { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(20, 43, 76, .78), rgba(9, 23, 43, .9)); box-shadow: var(--shadow); }
.stats article { padding: 20px; border-radius: 17px; }
.stats span, .stats small { display: block; color: var(--muted); }
.stats span { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.stats strong { display: block; margin: 8px 0 2px; font-size: 23px; }
.stats small { font-size: 12px; }

.grid { display: grid; gap: 18px; margin-top: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { min-width: 0; padding: 24px; border-radius: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head h2 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.02em; }
.icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--blue-2); background: rgba(57, 135, 255, .1); font-size: 21px; }

.stacked-form { display: grid; gap: 16px; }
.stacked-form.compact { gap: 12px; }
label { display: grid; gap: 7px; color: #b9c9de; font-size: 12px; font-weight: 700; letter-spacing: .035em; }
input { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid rgba(143, 176, 221, .28); border-radius: 11px; outline: 0; color: var(--text); background: rgba(3, 12, 27, .58); }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(57, 135, 255, .14); }
button { min-height: 43px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 11px; color: white; background: #17365f; font-weight: 800; }
button:hover { filter: brightness(1.12); }
button.primary { border-color: #4c97ff; background: linear-gradient(135deg, #3987ff, #1765db); box-shadow: 0 11px 24px rgba(23, 101, 219, .24); }
button.danger { border-color: rgba(255, 101, 122, .45); color: #ffd3d9; background: rgba(154, 40, 57, .32); }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 10px; border-bottom: 1px solid rgba(126, 175, 255, .12); text-align: left; }
th { color: var(--muted); font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
td { color: #d6e3f5; }
.address { font-weight: 750; }
.status-dot { width: 6px; height: 6px; margin-right: 9px; box-shadow: none; }
.empty { color: var(--muted); text-align: center; }
details { margin-top: 18px; border-top: 1px solid var(--line); }
summary { padding: 18px 0 0; color: var(--blue-2); cursor: pointer; font-weight: 750; }
.manage-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.manage-grid form, .inline-manage { padding: 16px; border: 1px solid rgba(126, 175, 255, .14); border-radius: 14px; background: rgba(3, 12, 27, .35); }
.manage-grid h3 { margin: 0 0 4px; font-size: 15px; }
.danger-zone { border-color: rgba(255, 101, 122, .2) !important; }
.inline-manage { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; margin-top: 18px; }

.logs { margin-top: 18px; }
pre { max-height: 330px; overflow: auto; margin: 0; padding: 16px; border: 1px solid rgba(126, 175, 255, .12); border-radius: 13px; color: #a9bad1; background: #030914; font: 12px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.notice { margin-bottom: 20px; padding: 13px 16px; border-radius: 12px; }
.notice.success { border: 1px solid rgba(71, 215, 160, .3); color: #c7fbe7; background: rgba(24, 119, 82, .24); }
.notice.error { border: 1px solid rgba(255, 101, 122, .3); color: #ffd6dc; background: rgba(137, 32, 49, .28); }

.login-page { display: grid; grid-template-rows: 1fr auto; background: radial-gradient(ellipse at 50% 42%, rgba(42, 115, 236, .24), transparent 28%), radial-gradient(ellipse at 50% 45%, rgba(15, 48, 99, .38), transparent 48%), var(--bg); }
.login-main { display: grid; place-items: center; width: 100%; padding: 28px; }
.login-card { width: min(460px, 100%); padding: 42px; border: 1px solid rgba(126, 175, 255, .26); border-radius: 25px; background: linear-gradient(160deg, rgba(18, 39, 70, .96), rgba(7, 20, 39, .96)); box-shadow: 0 40px 120px rgba(0, 0, 0, .5); }
.login-brand { display: flex; align-items: center; gap: 18px; margin-bottom: 32px; }
.login-brand h1 { margin: 3px 0 0; font-size: 25px; line-height: 1.1; }
.login-brand p { margin: 4px 0 0; color: var(--blue-2); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.security-note { margin: 20px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.error-card { max-width: 600px; margin: 80px auto; padding: 30px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
footer { padding: 26px; color: #627895; font-size: 11px; letter-spacing: .06em; text-align: center; text-transform: uppercase; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
  .manage-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; padding: 14px 18px; }
  nav { gap: 12px; font-size: 12px; }
  nav a:nth-child(2) { display: none; }
  .brand small { display: none; }
  .shell { width: min(100% - 24px, 1280px); padding-top: 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .panel { padding: 18px; }
  .inline-manage { grid-template-columns: 1fr; }
  .login-card { padding: 28px 22px; }
}
