:root {
  color-scheme: dark;
  --bg: #080c16;
  --surface: #101728;
  --surface-2: #151e31;
  --surface-3: #1a253b;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f4f7fb;
  --muted: #91a0b8;
  --accent: #7df4c8;
  --accent-2: #48cfa5;
  --blue: #70a9ff;
  --warn: #ffcc73;
  --danger: #ff7d8f;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0,0,0,.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { 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 75% -10%, rgba(55,120,154,.22), transparent 36%), var(--bg); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; font-weight: 820; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid rgba(125,244,200,.45); border-radius: 11px; color: #07100d; background: var(--accent); box-shadow: 0 0 24px rgba(125,244,200,.22); font-size: .78rem; }
.brand-large { font-size: 1.1rem; }
.brand-large .brand-mark { width: 44px; height: 44px; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(360px,.85fr); align-items: center; gap: clamp(40px,8vw,140px); padding: clamp(30px,7vw,100px); overflow: hidden; }
.login-copy { max-width: 720px; position: relative; }
.login-copy::before { content:""; position:absolute; z-index:-1; width:550px; height:550px; left:-250px; top:-140px; border:1px solid rgba(125,244,200,.1); border-radius:50%; box-shadow: 0 0 120px rgba(125,244,200,.06) inset; }
.login-copy h1 { margin: 70px 0 20px; font-size: clamp(3.2rem,7vw,7.4rem); line-height: .91; letter-spacing: -.075em; }
.login-copy h1 span { color: var(--accent); }
.login-copy > p { max-width: 630px; color: var(--muted); font-size: clamp(1rem,1.5vw,1.25rem); line-height: 1.65; }
.login-features { display:flex; flex-wrap:wrap; gap:9px; margin-top:34px; }
.login-features span { padding:9px 13px; border:1px solid var(--line); border-radius:999px; color:#c4cedd; font-size:.78rem; background:rgba(255,255,255,.025); }
.login-card { width:100%; max-width:480px; justify-self:end; padding:clamp(26px,4vw,48px); border:1px solid var(--line-strong); border-radius:28px; background:linear-gradient(145deg,rgba(24,34,54,.94),rgba(12,18,31,.97)); box-shadow:var(--shadow); backdrop-filter:blur(20px); }
.login-card h2 { margin:12px 0 4px; font-size:1.75rem; letter-spacing:-.035em; }
.login-card .muted { margin:0 0 30px; font-size:.9rem; }

label { display:grid; gap:8px; margin:16px 0; color:#c9d2df; font-size:.82rem; font-weight:650; }
input, select, textarea { width:100%; min-height:46px; padding:11px 13px; color:var(--text); background:#0b1120; border:1px solid var(--line-strong); border-radius:11px; outline:none; transition:border-color .15s, box-shadow .15s; }
textarea { resize:vertical; }
input:focus, select:focus, textarea:focus { border-color:rgba(125,244,200,.7); box-shadow:0 0 0 3px rgba(125,244,200,.1); }
input[type="checkbox"] { width:17px; min-height:17px; accent-color:var(--accent-2); }
input[type="range"] { padding:0; background:transparent; border:0; accent-color:var(--accent); box-shadow:none; }
.form-error { min-height:20px; margin:8px 0; color:var(--danger); font-size:.82rem; }
.secure-note { display:flex; justify-content:center; align-items:center; gap:8px; margin-top:18px; color:var(--muted); font-size:.75rem; }

.button { min-height:42px; padding:10px 16px; border:1px solid transparent; border-radius:11px; cursor:pointer; font-weight:750; transition:transform .12s, background .15s, border-color .15s; }
.button:hover { transform:translateY(-1px); }
.button:disabled { opacity:.55; cursor:wait; transform:none; }
.button.primary { color:#06120e; background:var(--accent); box-shadow:0 8px 28px rgba(125,244,200,.15); }
.button.primary:hover { background:#9affd9; }
.button.secondary { background:var(--surface-3); border-color:var(--line-strong); }
.button.ghost { color:var(--muted); background:transparent; border-color:var(--line); }
.button.danger { color:#ffdbe0; background:rgba(255,125,143,.1); border-color:rgba(255,125,143,.25); }
.button.small { min-height:34px; padding:7px 10px; font-size:.75rem; }
.button.full { width:100%; }
.text-button, .icon-button { border:0; background:transparent; cursor:pointer; }
.text-button { padding:8px 0; color:var(--muted); text-align:left; }
.icon-button { width:40px; height:40px; font-size:1.55rem; color:var(--muted); }

.app-shell { min-height:100vh; display:grid; grid-template-columns:248px 1fr; }
.sidebar { position:fixed; z-index:10; inset:0 auto 0 0; width:248px; display:flex; flex-direction:column; padding:28px 20px 20px; border-right:1px solid var(--line); background:rgba(9,14,25,.92); backdrop-filter:blur(18px); }
.sidebar nav { display:grid; gap:7px; margin-top:52px; }
.sidebar nav button { display:flex; align-items:center; gap:13px; width:100%; padding:12px 13px; color:var(--muted); border:1px solid transparent; border-radius:11px; background:transparent; cursor:pointer; text-align:left; font-weight:650; }
.sidebar nav button span { display:grid; place-items:center; width:23px; color:#aebbd0; font-size:1.1rem; }
.sidebar nav button:hover { color:var(--text); background:rgba(255,255,255,.035); }
.sidebar nav button.active { color:var(--text); border-color:rgba(125,244,200,.17); background:rgba(125,244,200,.08); }
.sidebar nav button.active span { color:var(--accent); }
.sidebar-foot { margin-top:auto; padding:16px 11px 2px; border-top:1px solid var(--line); }
.system-line { display:flex; gap:9px; align-items:center; color:#c4cedb; font-size:.78rem; }
.status-dot { display:inline-block; flex:0 0 auto; width:8px; height:8px; border-radius:50%; background:var(--muted); }
.status-dot.good { background:var(--accent); box-shadow:0 0 12px rgba(125,244,200,.8); }
.status-dot.warn { background:var(--warn); }
.status-dot.bad { background:var(--danger); }

main { grid-column:2; min-width:0; padding:0 clamp(22px,4vw,62px) 80px; }
.topbar { min-height:126px; display:flex; justify-content:space-between; align-items:center; gap:24px; border-bottom:1px solid var(--line); }
.topbar h1 { margin:6px 0 0; font-size:clamp(1.6rem,3vw,2.25rem); letter-spacing:-.045em; }
.top-actions, .user-chip { display:flex; align-items:center; gap:14px; }
.user-chip { min-width:150px; padding:7px 10px; }
.user-chip > span { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; color:#07100d; background:linear-gradient(140deg,var(--accent),#a7b9ff); font-size:.72rem; font-weight:900; }
.user-chip div { display:grid; gap:2px; }
.user-chip strong { font-size:.82rem; }
.user-chip small { color:var(--muted); font-size:.68rem; text-transform:uppercase; }

.view { display:none; padding-top:32px; animation:appear .22s ease; }
.view.active { display:block; }
@keyframes appear { from { opacity:0; transform:translateY(5px); } }
.hero-card { position:relative; overflow:hidden; display:flex; justify-content:space-between; align-items:center; gap:32px; min-height:210px; padding:36px clamp(28px,4vw,50px); border:1px solid rgba(125,244,200,.14); border-radius:var(--radius); background:radial-gradient(circle at 78% 45%,rgba(125,244,200,.13),transparent 29%),linear-gradient(125deg,#142238,#0d1728 58%,#0b1321); box-shadow:var(--shadow); }
.hero-card::after { content:""; position:absolute; width:280px; height:280px; right:-95px; top:-135px; border:1px solid rgba(125,244,200,.17); border-radius:50%; box-shadow:0 0 0 30px rgba(125,244,200,.02),0 0 0 70px rgba(125,244,200,.015); }
.hero-card h2 { margin:9px 0 10px; font-size:clamp(1.7rem,3vw,2.7rem); letter-spacing:-.05em; }
.hero-card p { max-width:640px; margin:0; color:#a6b3c7; line-height:1.6; }
.hero-health { position:relative; z-index:1; display:grid; justify-items:center; gap:8px; min-width:130px; }
.pulse { width:66px; height:66px; border:1px solid var(--accent); border-radius:50%; background:radial-gradient(circle,var(--accent) 0 7%,transparent 9%); box-shadow:0 0 0 14px rgba(125,244,200,.05),0 0 40px rgba(125,244,200,.18); }
.hero-health strong { color:var(--accent); font-size:.78rem; letter-spacing:.15em; }
.hero-health small { color:var(--muted); }

.stats-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:18px 0; }
.stat-card { padding:20px; border:1px solid var(--line); border-radius:15px; background:linear-gradient(145deg,rgba(20,29,47,.9),rgba(13,20,34,.92)); }
.stat-card .stat-top { display:flex; justify-content:space-between; color:var(--muted); font-size:.74rem; font-weight:700; }
.stat-card .stat-icon { color:var(--accent); }
.stat-card strong { display:block; margin:14px 0 4px; font-size:1.75rem; letter-spacing:-.05em; }
.stat-card small { color:var(--muted); font-size:.7rem; }

.dashboard-grid { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr); gap:18px; }
.panel, .table-panel { border:1px solid var(--line); border-radius:var(--radius); background:rgba(15,22,37,.88); box-shadow:0 12px 40px rgba(0,0,0,.14); }
.panel { padding:24px; }
.panel-head { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; }
.panel-head h2 { margin:7px 0 0; font-size:1.14rem; letter-spacing:-.025em; }
.tag { display:inline-flex; align-items:center; min-height:27px; padding:5px 9px; color:#bbcadc; background:rgba(255,255,255,.04); border:1px solid var(--line); border-radius:999px; font-size:.67rem; white-space:nowrap; }
.tag.good { color:var(--accent); border-color:rgba(125,244,200,.2); background:rgba(125,244,200,.06); }
.tag.warn { color:var(--warn); border-color:rgba(255,204,115,.2); background:rgba(255,204,115,.06); }
.tag.bad { color:var(--danger); border-color:rgba(255,125,143,.2); background:rgba(255,125,143,.06); }
.capacity-list { display:grid; gap:22px; margin-top:26px; }
.capacity-item { display:grid; gap:9px; }
.capacity-meta { display:flex; justify-content:space-between; gap:12px; font-size:.77rem; }
.capacity-meta span { color:var(--muted); }
.bar { display:block; width:100%; height:7px; overflow:hidden; border:0; border-radius:999px; background:#080e19; appearance:none; }
.bar::-webkit-progress-bar { background:#080e19; border-radius:999px; }
.bar::-webkit-progress-value { border-radius:999px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); box-shadow:0 0 12px rgba(125,244,200,.25); }
.bar::-moz-progress-bar { border-radius:999px; background:linear-gradient(90deg,var(--accent-2),var(--accent)); box-shadow:0 0 12px rgba(125,244,200,.25); }
.event-list { display:grid; margin-top:17px; }
.event { display:grid; grid-template-columns:9px 1fr; gap:13px; padding:12px 0; border-bottom:1px solid var(--line); }
.event:last-child { border-bottom:0; }
.event i { width:7px; height:7px; margin-top:6px; border-radius:50%; background:var(--blue); }
.event p { margin:0; color:#ccd5e2; font-size:.78rem; line-height:1.45; }
.event small { display:block; margin-top:3px; color:var(--muted); font-size:.65rem; }

.section-toolbar { min-height:64px; display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.section-toolbar p { margin:4px 0 0; }
.cards-list { display:grid; gap:12px; }
.server-card { display:grid; grid-template-columns:minmax(160px,1.2fr) repeat(4,minmax(90px,.7fr)) auto; gap:16px; align-items:center; padding:20px; border:1px solid var(--line); border-radius:15px; background:rgba(15,22,37,.88); }
.server-name { display:grid; gap:4px; }
.server-name strong { font-size:1rem; }
.server-name small, .metric small { color:var(--muted); font-size:.68rem; }
.metric { display:grid; gap:4px; }
.metric strong { font-size:.82rem; }
.card-actions { display:flex; gap:7px; justify-content:flex-end; flex-wrap:wrap; }
.empty { display:grid; place-items:center; min-height:220px; padding:30px; color:var(--muted); border:1px dashed var(--line-strong); border-radius:var(--radius); text-align:center; }

.table-panel { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:720px; }
th, td { padding:15px 18px; border-bottom:1px solid var(--line); text-align:left; font-size:.78rem; }
th { color:var(--muted); background:rgba(255,255,255,.02); font-size:.67rem; letter-spacing:.06em; text-transform:uppercase; }
tr:last-child td { border-bottom:0; }
td strong { display:block; }
td small { color:var(--muted); }

.plans-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.plan-card { position:relative; overflow:hidden; padding:24px; border:1px solid var(--line); border-radius:var(--radius); background:linear-gradient(145deg,rgba(21,31,50,.94),rgba(13,20,34,.94)); }
.plan-card::after { content:""; position:absolute; width:100px; height:100px; right:-45px; top:-45px; border:1px solid rgba(125,244,200,.13); border-radius:50%; }
.plan-card h2 { margin:10px 0 3px; font-size:1.35rem; }
.price { color:var(--accent); font-size:.9rem; }
.plan-specs { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin:24px 0 0; }
.plan-specs div { padding:12px; border:1px solid var(--line); border-radius:11px; background:rgba(0,0,0,.12); }
.plan-specs strong { display:block; font-size:.9rem; }
.plan-specs small { color:var(--muted); font-size:.65rem; }

.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.settings-wide, .settings-actions { grid-column:1/-1; }
.settings-actions { display:flex; justify-content:flex-end; }
.switch { margin:0; }
.switch input { position:absolute; opacity:0; }
.switch span { display:block; width:46px; height:26px; padding:3px; border:1px solid var(--line-strong); border-radius:999px; background:#0a101c; cursor:pointer; }
.switch span::after { content:""; display:block; width:18px; height:18px; border-radius:50%; background:var(--muted); transition:.18s; }
.switch input:checked + span { border-color:rgba(125,244,200,.5); background:rgba(125,244,200,.12); }
.switch input:checked + span::after { transform:translateX(20px); background:var(--accent); }
.check-row { display:flex; align-items:center; gap:9px; }
.check-row input { flex:0 0 auto; }

dialog { width:min(650px,calc(100% - 28px)); max-height:calc(100vh - 40px); padding:0; overflow:auto; color:var(--text); background:#111a2b; border:1px solid var(--line-strong); border-radius:22px; box-shadow:var(--shadow); }
dialog::backdrop { background:rgba(2,5,10,.75); backdrop-filter:blur(6px); }
dialog form { padding:26px; }
.dialog-head { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:17px; }
.dialog-head h2 { margin:7px 0 0; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:0 15px; }
.span-2 { grid-column:1/-1; }
.dialog-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }

.loading { position:fixed; z-index:50; inset:0 0 0 248px; display:grid; place-content:center; justify-items:center; background:rgba(8,12,22,.66); backdrop-filter:blur(3px); }
.loading span { width:34px; height:34px; border:3px solid rgba(255,255,255,.12); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
.loading p { color:var(--muted); font-size:.8rem; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast { position:fixed; z-index:100; right:24px; bottom:24px; max-width:380px; padding:13px 17px; color:#06120e; background:var(--accent); border-radius:12px; box-shadow:var(--shadow); font-weight:750; font-size:.82rem; transform:translateY(100px); opacity:0; transition:.22s; }
.toast.show { transform:translateY(0); opacity:1; }
.toast.error { color:white; background:var(--danger); }
.mobile-nav { display:none; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns:1fr 1fr; }
  .dashboard-grid { grid-template-columns:1fr; }
  .plans-grid { grid-template-columns:1fr 1fr; }
  .server-card { grid-template-columns:1.2fr repeat(2,.7fr) auto; }
  .server-card .metric:nth-of-type(4), .server-card .metric:nth-of-type(5) { display:none; }
}

@media (max-width: 760px) {
  .login-shell { display:block; padding:28px 18px 50px; }
  .login-copy { text-align:center; }
  .login-copy .brand { justify-content:center; }
  .login-copy h1 { margin:48px 0 18px; font-size:3.4rem; }
  .login-features { justify-content:center; margin-bottom:34px; }
  .login-card { justify-self:auto; margin:auto; padding:26px 21px; }
  .app-shell { display:block; }
  .sidebar { display:none; }
  main { padding:0 15px 96px; }
  .topbar { min-height:96px; position:sticky; z-index:8; top:0; margin:0 -15px; padding:0 15px; background:rgba(8,12,22,.9); backdrop-filter:blur(16px); }
  .topbar .eyebrow, .user-chip div, #quick-add { display:none; }
  .user-chip { min-width:0; padding:0; }
  .view { padding-top:18px; }
  .hero-card { min-height:200px; padding:26px 22px; }
  .hero-health { display:none; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:16px; }
  .dashboard-grid { gap:12px; }
  .panel { padding:19px; }
  .plans-grid, .settings-grid { grid-template-columns:1fr; }
  .settings-wide, .settings-actions { grid-column:auto; }
  .server-card { grid-template-columns:1fr auto; gap:13px; }
  .server-card .metric { display:none; }
  .section-toolbar { align-items:center; }
  .section-toolbar p { font-size:.8rem; }
  .mobile-nav { position:fixed; z-index:20; display:grid; grid-template-columns:repeat(4,1fr); left:10px; right:10px; bottom:max(10px,env(safe-area-inset-bottom)); padding:7px; border:1px solid var(--line-strong); border-radius:17px; background:rgba(12,18,31,.94); box-shadow:var(--shadow); backdrop-filter:blur(18px); }
  .mobile-nav button { display:grid; justify-items:center; gap:2px; padding:7px 3px; color:var(--muted); border:0; border-radius:11px; background:transparent; font-size:1rem; }
  .mobile-nav button small { font-size:.6rem; }
  .mobile-nav button.active { color:var(--accent); background:rgba(125,244,200,.07); }
  .loading { inset:0; }
  .toast { right:14px; left:14px; bottom:91px; max-width:none; text-align:center; }
  .form-grid { grid-template-columns:1fr; }
  .span-2 { grid-column:auto; }
}

@media (max-width: 420px) {
  .login-copy h1 { font-size:2.9rem; }
  .stats-grid { grid-template-columns:1fr; }
  .stat-card { display:grid; grid-template-columns:1fr auto; align-items:center; }
  .stat-card strong { grid-column:2; grid-row:1/3; margin:0; }
  .stat-card small { grid-column:1; }
  .dialog-actions .button { flex:1; }
}
