:root{
  --bg0:#0b0e14;
  --bg1:#0f1420;
  --card:#11192a;
  --card2:#0e1626;
  --text:#e7edf8;
  --muted:#9aa7bd;
  --line:rgba(255,255,255,.08);
  --shadow: 0 20px 60px rgba(0,0,0,.35);
  --accent:#66a6ff;
  --accent2:#89f7fe;
  --warn:#ffcc66;
  --ok:#7ee787;
  --radius:18px;
  --radius2:22px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: light){
  :root{
    --bg0:#f6f8fc;
    --bg1:#eef3ff;
    --card:#ffffff;
    --card2:#fbfcff;
    --text:#121826;
    --muted:#5a6a86;
    --line:rgba(10,20,40,.10);
    --shadow: 0 18px 55px rgba(19,48,92,.12);
  }
}

html.theme-dark{
  --bg0:#0b0e14;
  --bg1:#0f1420;
  --card:#11192a;
  --card2:#0e1626;
  --text:#e7edf8;
  --muted:#9aa7bd;
  --line:rgba(255,255,255,.08);
  --shadow: 0 20px 60px rgba(0,0,0,.35);
}

html.theme-light{
  --bg0:#f6f8fc;
  --bg1:#eef3ff;
  --card:#ffffff;
  --card2:#fbfcff;
  --text:#121826;
  --muted:#5a6a86;
  --line:rgba(10,20,40,.10);
  --shadow: 0 18px 55px rgba(19,48,92,.12);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:linear-gradient(180deg,var(--bg0),var(--bg1));
  overflow-x:hidden;
}

.bg{ position:fixed; inset:0; pointer-events:none; z-index:-1; }
.grid{
  position:absolute; inset:-2px;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity:.18;
  filter: blur(.2px);
}
@media (prefers-color-scheme: light){
  .grid{
    background-image:
      linear-gradient(to right, rgba(10,20,40,.05) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(10,20,40,.05) 1px, transparent 1px);
    opacity:.35;
  }
}
.orb{
  position:absolute;
  width:520px;height:520px;
  border-radius:999px;
  filter: blur(36px);
  opacity:.55;
  mix-blend-mode: screen;
  background: radial-gradient(circle at 30% 30%, var(--accent2), transparent 55%),
              radial-gradient(circle at 70% 70%, var(--accent), transparent 58%);
  animation: float 12s ease-in-out infinite;
}
.o1{ top:-220px; left:-180px; }
.o2{ bottom:-260px; right:-220px; animation-duration: 14s; animation-direction: reverse; opacity:.42; }
@keyframes float{
  0%,100%{ transform: translate3d(0,0,0) scale(1); }
  50%{ transform: translate3d(18px,24px,0) scale(1.03); }
}

.topbar{
  position:sticky; top:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  background: rgba(0,0,0,.10);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
@media (prefers-color-scheme: light){
  .topbar{ background: rgba(255,255,255,.55); }
}
.brand{ display:flex; align-items:center; gap:12px; min-width: 240px; }
.logo{
  width:40px;height:40px;border-radius:14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  position:relative;
}
.logo::after{
  content:"";
  position:absolute; inset:10px;
  border-radius:10px;
  background: rgba(255,255,255,.18);
}
.brand-text{ display:flex; flex-direction:column; line-height:1.1; }
.brand-name{ font-weight:700; letter-spacing:.2px; }
.brand-sub{ font-size:12px; color:var(--muted); margin-top:2px; }

.controls{ display:flex; align-items:center; gap:10px; }
.seg{
  display:flex;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  border-radius:999px;
  padding:3px;
  gap:3px;
}
.seg-btn{
  border:0;
  border-radius:999px;
  padding:7px 10px;
  font-weight:650;
  font-size:12px;
  color:var(--muted);
  background: transparent;
  cursor:pointer;
}
.seg-btn[aria-pressed="true"]{
  color:var(--text);
  background: rgba(255,255,255,.10);
}
.icon-btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  border-radius:12px;
  width:40px;height:40px;
  display:grid; place-items:center;
  cursor:pointer;
  transition: transform .15s ease;
}
.icon-btn:hover{ transform: translateY(-1px); }
.icon{ font-size:16px; opacity:.92; }

.shell{
  max-width: 1200px;
  margin: 18px auto 40px;
  padding: 0 16px;
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:16px;
}
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{ display:none; }
}

.sidebar{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.05);
  box-shadow: var(--shadow);
  padding:14px;
  display:flex;
  flex-direction:column;
  min-height: 640px;
}
.nav-section{ margin-bottom: 14px; }
.nav-title{
  font-size:12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 8px 10px;
}
.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius: 14px;
  color: var(--text);
  text-decoration:none;
  opacity:.9;
  border:1px solid transparent;
}
.nav-item:hover{
  background: rgba(255,255,255,.06);
  border-color: var(--line);
}
.nav-item.active{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.14);
}
.dot{
  width:10px;height:10px;border-radius:999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}
.sidebar-footer{ margin-top:auto; padding-top:10px; }
.pill{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--line);
  border-radius: 999px;
  padding:10px 12px;
  background: rgba(0,0,0,.10);
}
@media (prefers-color-scheme: light){
  .pill{ background: rgba(255,255,255,.55); }
}
.pulse{
  width:10px;height:10px;border-radius:999px;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(126,231,135,.35);
  animation: pulse 1.6s ease infinite;
}
@keyframes pulse{
  0%{ box-shadow: 0 0 0 0 rgba(126,231,135,.28); }
  70%{ box-shadow: 0 0 0 10px rgba(126,231,135,0); }
  100%{ box-shadow: 0 0 0 0 rgba(126,231,135,0); }
}

.content{ display:flex; flex-direction:column; gap:14px; }
.content-head{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding: 6px 4px;
}
.h1{ margin:0; font-size:28px; letter-spacing:-.02em; }
.sub{ margin:6px 0 0; color: var(--muted); max-width: 720px; }
.status-chip{
  display:flex; align-items:center; gap:10px;
  border:1px solid var(--line);
  border-radius: 999px;
  padding:10px 12px;
  background: rgba(255,255,255,.06);
  font-weight:650;
}
.chip-dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(255,204,102,.14);
}

.card{
  border:1px solid var(--line);
  border-radius: var(--radius2);
  background: rgba(255,255,255,.06);
  box-shadow: var(--shadow);
  padding:16px;
}
.card.hero{
  background:
    radial-gradient(circle at 15% 15%, rgba(102,166,255,.25), transparent 55%),
    radial-gradient(circle at 85% 25%, rgba(137,247,254,.18), transparent 55%),
    rgba(255,255,255,.06);
}
.card-title{
  display:flex; align-items:center; justify-content:space-between;
  font-weight:750;
  letter-spacing:.1px;
  margin-bottom: 12px;
}
.tag{
  font-size:12px;
  color: var(--muted);
  border:1px solid var(--line);
  border-radius: 999px;
  padding:6px 10px;
  background: rgba(255,255,255,.06);
}

.grid2{
  display:grid;
  grid-template-columns: 1.35fr 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid2{ grid-template-columns: 1fr; }
}
.grid3{
  display:grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid3{ grid-template-columns: 1fr; }
}

.hero-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
.hero-title{
  font-size:18px;
  font-weight:800;
  letter-spacing:-.01em;
}
.hero-text{
  margin-top:8px;
  color:var(--muted);
  max-width: 560px;
}
.ring{
  width:68px;height:68px;border-radius:999px;
  border:1px solid var(--line);
  display:grid; place-items:center;
  background: rgba(0,0,0,.08);
}
@media (prefers-color-scheme: light){
  .ring{ background: rgba(255,255,255,.55); }
}
.ring-inner{
  width:50px;height:50px;border-radius:999px;
  border:3px solid rgba(255,255,255,.12);
  border-top-color: var(--accent2);
  border-right-color: var(--accent);
  animation: spin 1.1s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

.timer{ margin-top: 14px; }
.timer-row{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
}
.timer-label{ color: var(--muted); font-weight:650; }
.timer-value{
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
}
.progress{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  overflow:hidden;
}
.bar{
  height:100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .25s ease;
}
.timer-hint{
  margin-top: 10px;
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--muted);
  flex-wrap:wrap;
}
.kbd{
  border:1px solid var(--line);
  border-bottom-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  border-radius: 10px;
  padding: 6px 10px;
  font-weight:650;
}
.muted{ color: var(--muted); }
.mono{ font-family: var(--mono); }
.sep{ opacity:.55; }

.actions{
  margin-top: 12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.10);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 750;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.14); }
.btn.ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
}
.btn.ghost:hover{ background: rgba(255,255,255,.06); color: var(--text); }

.health{ display:flex; flex-direction:column; gap:12px; }
.metric{
  border:1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,.08);
}
@media (prefers-color-scheme: light){
  .metric{ background: rgba(255,255,255,.55); }
}
.metric-top{ display:flex; align-items:center; justify-content:space-between; }
.metric-name{ color: var(--muted); font-weight:650; }
.metric-val{ font-family: var(--mono); font-weight:800; }
.spark{
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  overflow:hidden;
}
.sbar{
  height:100%;
  width: 68%;
  background: linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,.02));
  position:relative;
}
.sbar::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  transform: translateX(-60%);
  animation: shimmer 1.6s ease infinite;
}
@keyframes shimmer{
  0%{ transform: translateX(-60%); }
  100%{ transform: translateX(140%); }
}
.note{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.list{ display:flex; flex-direction:column; gap:10px; }
.row{ display:flex; gap:10px; align-items:center; }
.skel{
  height: 12px;
  border-radius: 999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  position:relative;
  overflow:hidden;
}
.skel::after{
  content:"";
  position:absolute; inset:0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.14), transparent);
  transform: translateX(-60%);
  animation: shimmer 1.6s ease infinite;
}
.w20{ width: 20%; }
.w25{ width: 25%; }
.w30{ width: 30%; }
.w35{ width: 35%; }
.w40{ width: 40%; }
.w45{ width: 45%; }
.w55{ width: 55%; }
.w70{ width: 70%; }
.w80{ width: 80%; }

.svc{ display:flex; flex-direction:column; gap:10px; }
.svc-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
}
.svc-name{ font-weight:750; letter-spacing:.2px; }
.svc-state{
  font-size:12px;
  border-radius: 999px;
  padding:6px 10px;
  border:1px solid var(--line);
  font-weight:750;
}
.svc-state.ok{ color: var(--ok); background: rgba(126,231,135,.08); border-color: rgba(126,231,135,.20); }
.svc-state.warn{ color: var(--warn); background: rgba(255,204,102,.08); border-color: rgba(255,204,102,.20); }

.kv{ display:flex; flex-direction:column; gap:10px; }
.kv-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.06);
}
.k{ color: var(--muted); font-weight:650; }
.v{ font-weight:800; }

.footer{
  margin-top: 4px;
  padding: 8px 4px;
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  color: var(--muted);
  font-size: 13px;
}
.link{
  color: inherit;
  text-decoration:none;
  border-bottom:1px dashed rgba(255,255,255,.18);
}
@media (prefers-color-scheme: light){
  .link{ border-bottom-color: rgba(10,20,40,.22); }
}
.link:hover{ color: var(--text); }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.60);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease, transform .18s ease;
  font-weight: 650;
}
.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}
