:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #070b14;
  --panel: rgba(17, 24, 39, .78);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, .16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --green: #34d399;
  --red: #fb7185;
  --blue: #60a5fa;
  --amber: #fbbf24;
}
* { 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 10% -10%, rgba(37,99,235,.24), transparent 34rem),
    radial-gradient(circle at 100% 0%, rgba(16,185,129,.13), transparent 30rem),
    var(--bg);
}
a { color: inherit; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(440px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 28px;
  background: rgba(15,23,42,.82); box-shadow: 0 30px 80px rgba(0,0,0,.42); backdrop-filter: blur(20px);
}
.brand-mark {
  width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; margin-bottom: 24px;
  background: linear-gradient(135deg, #2563eb, #14b8a6); font-weight: 850; letter-spacing: -.03em;
  box-shadow: 0 12px 35px rgba(37,99,235,.32);
}
.kicker, .section-label, .server-type {
  margin: 0; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
}
h1, h2, h3 { margin: 0; letter-spacing: -.035em; }
.login-card h1 { margin-top: 7px; font-size: clamp(32px, 8vw, 46px); }
.muted, .page-intro { color: var(--muted); line-height: 1.55; }
.page-intro { margin: 8px 0 0; }
.login-form { margin-top: 28px; }
label { display: grid; gap: 8px; margin: 16px 0; color: #cbd5e1; font-weight: 650; }
input { width: 100%; padding: 14px 15px; border: 1px solid #334155; border-radius: 13px; color: #fff; background: #0b1220; outline: none; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(96,165,250,.13); }
.dashboard-view { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: max(18px, env(safe-area-inset-top)) max(22px, calc((100vw - 1180px)/2)); border-bottom: 1px solid var(--line);
  background: rgba(7,11,20,.75); backdrop-filter: blur(20px);
}
.topbar h1 { margin-top: 4px; font-size: 25px; }
.brand-link { text-decoration: none; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.content { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 46px; }
.overview { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.overview h2 { margin-top: 5px; font-size: 32px; }
.summary-chip { padding: 9px 13px; border-radius: 999px; background: rgba(148,163,184,.1); color: #cbd5e1; border: 1px solid var(--line); font-size: 14px; font-weight: 700; }
.server-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 18px; }
.server-card {
  position: relative; overflow: hidden; padding: 22px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--panel); box-shadow: 0 22px 60px rgba(0,0,0,.22); backdrop-filter: blur(18px);
}
.server-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, transparent, rgba(96,165,250,.72), transparent); }
.server-card-link { display: block; text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.server-card-link:hover { transform: translateY(-3px); border-color: rgba(96,165,250,.38); box-shadow: 0 28px 72px rgba(0,0,0,.30); }
.server-card-link:focus-visible { outline: 3px solid rgba(96,165,250,.5); outline-offset: 3px; }
.server-card-head { display: flex; align-items: center; gap: 13px; }
.server-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: rgba(96,165,250,.1); border: 1px solid rgba(96,165,250,.16); font-size: 24px; }
.server-icon.large { width: 68px; height: 68px; border-radius: 20px; font-size: 32px; }
.server-title-wrap { min-width: 0; flex: 1; }
.server-name { margin-top: 4px; font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid var(--line); color: #cbd5e1; background: rgba(148,163,184,.08); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.status-pill.on { color: #a7f3d0; background: rgba(16,185,129,.1); border-color: rgba(52,211,153,.25); }
.status-pill.on .status-dot { background: var(--green); box-shadow: 0 0 0 5px rgba(52,211,153,.10); }
.status-pill.off { color: #fecdd3; background: rgba(244,63,94,.09); border-color: rgba(251,113,133,.22); }
.status-pill.off .status-dot { background: var(--red); }
.status-pill.pending { color: #fde68a; background: rgba(245,158,11,.09); border-color: rgba(251,191,36,.22); }
.status-pill.pending .status-dot { background: var(--amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.server-meta { margin: 22px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; }
.server-meta div { min-width: 0; }
.server-meta dt, .detail-list dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.server-meta dd, .detail-list dd { margin: 0; color: #e2e8f0; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.card-link-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 16px; border-top: 1px solid var(--line); color: #bfdbfe; font-size: 14px; font-weight: 800; }
.button, .icon-button { border: 0; border-radius: 13px; cursor: pointer; font-weight: 800; transition: transform .14s ease, opacity .14s ease, background .14s ease; }
.button { padding: 12px 15px; color: #fff; background: #334155; }
.button:active, .icon-button:active { transform: scale(.98); }
.button:disabled, .icon-button:disabled { opacity: .38; cursor: not-allowed; }
.button.primary { color: #052e16; background: var(--green); }
.button.danger { background: #e11d48; }
.button.secondary { background: rgba(51,65,85,.86); }
.button.ghost { padding: 9px 12px; color: #cbd5e1; background: rgba(148,163,184,.08); border: 1px solid var(--line); }
.button.full { width: 100%; }
.button.small { padding: 9px 12px; }
.icon-button { width: 42px; height: 42px; color: #e2e8f0; background: rgba(148,163,184,.08); border: 1px solid var(--line); font-size: 22px; }
.icon-button.is-loading { animation: refresh-spin .8s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
.progress-wrap { margin: 18px 0; }
.progress-bar { height: 4px; overflow: hidden; border-radius: 999px; background: rgba(148,163,184,.15); }
.progress-bar span { display: block; width: 35%; height: 100%; background: var(--blue); border-radius: inherit; animation: loading 1.2s infinite ease-in-out; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(300%); } }
.progress-text { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.card-message, .global-message, .error { min-height: 20px; margin: 13px 0 0; color: #fda4af; font-size: 13px; }
.empty-state, .detail-loading { text-align: center; padding: 60px 20px; border: 1px dashed var(--line); border-radius: 24px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin: 12px 0 8px; }
.empty-icon { font-size: 40px; }
code { color: #bfdbfe; }
footer { padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); text-align: center; color: #64748b; font-size: 12px; }
.toast-region { position: fixed; z-index: 100; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: grid; gap: 10px; width: min(390px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 14px 16px; border: 1px solid var(--line); border-radius: 15px; color: var(--text); background: var(--panel-solid); box-shadow: 0 18px 45px rgba(0,0,0,.28); transform: translateY(12px); opacity: 0; transition: opacity .2s ease, transform .2s ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--blue); }
.back-link { display: inline-flex; margin-bottom: 22px; color: #bfdbfe; text-decoration: none; font-weight: 750; }
.detail-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.detail-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.detail-heading h2 { margin-top: 4px; font-size: clamp(30px, 5vw, 44px); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.detail-panel { padding: 22px; border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 20px 55px rgba(0,0,0,.18); }
.detail-panel h3 { margin-top: 5px; font-size: 22px; }
.panel-copy { margin: 10px 0 20px; }
.detail-list { margin: 22px 0 0; display: grid; gap: 0; }
.detail-list div { display: grid; grid-template-columns: minmax(110px, .7fr) 1.3fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dd { text-align: right; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.command-box { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(2,6,23,.32); }
.command-box code { flex: 1; overflow-x: auto; white-space: nowrap; }
.feature-placeholder { display: flex; gap: 14px; align-items: flex-start; margin-top: 20px; padding: 16px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.feature-placeholder strong { color: var(--text); }
.feature-placeholder p { margin: 5px 0 0; line-height: 1.5; }
.feature-icon { font-size: 28px; }
.theme-button { font-size: 19px; }
:root[data-theme="light"] { color-scheme: light; --bg: #eef2f7; --panel: rgba(255,255,255,.86); --panel-solid: #fff; --line: rgba(51,65,85,.16); --text: #0f172a; --muted: #64748b; }
:root[data-theme="light"] body { background: radial-gradient(circle at 10% -10%, rgba(37,99,235,.13), transparent 34rem), radial-gradient(circle at 100% 0%, rgba(16,185,129,.10), transparent 30rem), var(--bg); }
:root[data-theme="light"] .login-card, :root[data-theme="light"] .topbar, :root[data-theme="light"] .server-card, :root[data-theme="light"] .detail-panel { background: rgba(255,255,255,.86); }
:root[data-theme="light"] .button.ghost, :root[data-theme="light"] .icon-button { color: #334155; background: rgba(255,255,255,.62); }
:root[data-theme="light"] .server-meta dd, :root[data-theme="light"] .detail-list dd { color: #1e293b; }
:root[data-theme="light"] .command-box { background: rgba(241,245,249,.8); }
:root[data-theme="light"] code { color: #1d4ed8; }
@media (max-width: 760px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-hero { align-items: flex-start; }
}
@media (max-width: 600px) {
  .topbar { padding-left: 18px; padding-right: 18px; }
  .content { width: min(100% - 24px, 1180px); padding-top: 24px; }
  .overview { align-items: start; flex-direction: column; gap: 12px; }
  .server-card, .detail-panel { padding: 18px; border-radius: 21px; }
  .server-meta { grid-template-columns: 1fr; gap: 12px; }
  .status-pill { align-self: flex-start; }
  .detail-hero { flex-direction: column; }
  .detail-list div { grid-template-columns: 1fr; gap: 5px; }
  .detail-list dd { text-align: left; }
  .command-box { align-items: stretch; flex-direction: column; }
}
