:root {
  --ink: #16181D;
  --muted: #5B616B;
  --ground: #F4F5F7;
  --panel: #FFFFFF;
  --line: #E1E4E8;
  --line-soft: #EEF0F2;
  --field: #C9CED6;
  --accent: #0F5F59;
  --accent-dark: #0A4540;
  --accent-tint: #E0F2F1;
  --side: #16181D;
  --side-hover: #262A31;
  --ok-bg: #E3F4EA; --ok: #14653A;
  --warn-bg: #FDF0DC; --warn: #8A4A06;
  --bad-bg: #FBE4E4; --bad: #9B1C1C;
  --mute-bg: #EEF0F2; --mute: #4A505A;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: var(--ground); font-size: 15px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1 { font-size: 28px; margin: 0; font-weight: 600; }
h2 { font-size: 16px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 0; font-weight: 600; }
.mono { font-family: var(--mono); font-size: 13px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 220px; background: var(--side); color: #E8EAED; padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.logo { width: 36px; height: 36px; border-radius: 8px; background: #2DD4BF; color: var(--side); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.brand b { display: block; font-size: 15px; }
.brand small { display: block; font-size: 12px; color: #9EA4AD; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { color: #C9CDD3; text-decoration: none; padding: 0 12px; border-radius: 8px; font: inherit; font-size: 14px; min-height: 44px; display: flex; align-items: center; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--side-hover); color: #FFFFFF; }
.nav a[aria-current="page"] { background: var(--side-hover); color: #FFFFFF; font-weight: 600; }
.nav-foot { margin-top: auto; border-top: 1px solid #2C3038; padding-top: 16px; }
.nav-foot span { font-size: 13px; color: #9EA4AD; padding: 0 12px; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px 40px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 640px) { .main { padding: 24px 16px; } }

.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.top p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head a { font-size: 13px; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); align-items: start; }
.tiles { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.tile .l { font-size: 13px; color: var(--muted); }
.tile .v { font-size: 28px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* buttons + fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; background: var(--accent); color: #FFFFFF; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn.secondary { background: #FFFFFF; color: var(--ink); border-color: var(--field); }
.btn.secondary:hover { background: var(--ground); color: var(--ink); }
.btn.danger { background: #FFFFFF; color: var(--bad); border-color: var(--field); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: 13px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f label { font-size: 13px; font-weight: 600; }
.f.compact label { font-size: 12px; color: var(--muted); }
input, select, textarea { min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; font: inherit; font-size: 14px; background: #FFFFFF; color: var(--ink); width: 100%; }
textarea { padding: 10px 12px; min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.err { color: var(--bad); font-size: 13px; }
.f.has-err input, .f.has-err select { border-color: var(--bad); }
.fields { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .f { flex: 0 1 190px; }
.filters .f.grow { flex: 1 1 260px; }

/* tables */
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; vertical-align: middle; }
td.wrap { white-space: normal; word-break: break-word; }
td a { text-decoration: none; font-weight: 500; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.changed { background: var(--accent-tint); }
tr.removed td { text-decoration: line-through; color: var(--muted); }
.actions { display: flex; gap: 6px; }
.actions form { margin: 0; }

/* pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.mute { background: var(--mute-bg); color: var(--mute); }
.pill.accent { background: var(--accent-tint); color: var(--accent); }
.ty { display: inline-block; min-width: 52px; text-align: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; font-family: var(--mono); background: var(--mute-bg); color: #2E333B; }
.t-bad { color: var(--bad); font-weight: 600; }
.t-warn { color: var(--warn); font-weight: 600; }
.t-ok { color: var(--ok); }

/* alerts */
.flash { border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.error { background: var(--bad-bg); color: var(--bad); }
.flash.warn { background: var(--warn-bg); color: #6B3A05; }

/* bars */
.bars { display: flex; flex-direction: column; }
.srvbar { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.srvbar:first-child { border-top: 0; padding-top: 0; }
.srvbar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.srvbar-name { font-size: 14px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srvbar-marge { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.srvbar-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 84px; gap: 12px; align-items: center; font-size: 12px; }
.track { display: block; height: 8px; border-radius: 4px; background: var(--line-soft); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.track i.cost { background: #9AA1AB; }

/* hosting */
.servers { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.stats div { display: flex; flex-direction: column; gap: 2px; }
.stats span:first-child { font-size: 12px; color: var(--muted); }
.stats span:last-child { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dl { list-style: none; margin: 0; padding: 0; }
.dl li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.dl a { font-family: var(--mono); text-decoration: none; }
.dl span { color: var(--muted); text-align: right; }

/* dns */
.pending { border: 2px solid var(--accent); }
.diff { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--mono); font-size: 13px; background: var(--ground); border-radius: 8px; padding: 10px 14px; }
.diff .old { color: var(--bad); text-decoration: line-through; }
.diff .new { color: var(--ok); }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; background: var(--side); }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 24px; }
.login .brand { color: #E8EAED; padding: 0; }
.login .card { padding: 28px; gap: 18px; border: 0; border-radius: 14px; }
.login .foot { font-size: 12px; color: #9EA4AD; margin: 0; text-align: center; }
.code { font-family: var(--mono); font-size: 18px; letter-spacing: 4px; }
