/* ============================================================
   HestiaCP modern dashboard — styles
   ============================================================ */
:root {
  --accent: #3b82f6;
  --ui-font: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --c-violet: #8b5cf6;
  --c-cyan: #06b6d4;
  --c-amber: #f59e0b;
  --c-ok: #10b981;
  --c-warn: #f59e0b;
  --c-danger: #ef4444;
  --c-info: #0ea5e9;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
}

/* ---- Light theme ---- */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, color-mix(in oklch, var(--accent) 7%, transparent), transparent 60%);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e8ebef;
  --border-strong: #dde1e7;
  --text: #0e1726;
  --text-mid: #475569;
  --text-dim: #8a94a4;
  --track: #eef1f5;
  --avatar-bg: #e2e8f0;
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255,255,255,0.82);
  --accent-soft: color-mix(in oklch, var(--accent) 12%, white);
  --accent-tint: color-mix(in oklch, var(--accent) 9%, transparent);
  --shadow-card: 0 1px 2px rgba(16,23,38,.04), 0 1px 3px rgba(16,23,38,.06);
  --shadow-lg: 0 10px 30px -10px rgba(16,23,38,.18), 0 2px 8px rgba(16,23,38,.06);
  --shadow-pop: 0 16px 40px -12px rgba(16,23,38,.22);
}
/* ---- Dark theme ---- */
:root[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, color-mix(in oklch, var(--accent) 16%, transparent), transparent 55%);
  --surface: #121620;
  --surface-2: #161b27;
  --surface-3: #1b2230;
  --border: #232a38;
  --border-strong: #2c3445;
  --text: #eef2f8;
  --text-mid: #aeb8c8;
  --text-dim: #6b7689;
  --track: #20283600;
  --track: #1d2532;
  --avatar-bg: #2a3343;
  --sidebar-bg: #0e121b;
  --topbar-bg: rgba(14,18,27,0.78);
  --accent-soft: color-mix(in oklch, var(--accent) 26%, #0b0e14);
  --accent-tint: color-mix(in oklch, var(--accent) 16%, transparent);
  --shadow-card: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 16px 40px -14px rgba(0,0,0,.6);
  --shadow-pop: 0 20px 50px -16px rgba(0,0,0,.7);
}

/* ---- Card style variants ---- */
:root[data-cards="soft"]     { --card-bg: var(--surface); --card-border: 1px solid var(--border); --card-shadow: var(--shadow-card); }
:root[data-cards="outlined"] { --card-bg: var(--surface); --card-border: 1px solid var(--border-strong); --card-shadow: none; }
:root[data-cards="elevated"] { --card-bg: var(--surface); --card-border: 1px solid transparent; --card-shadow: var(--shadow-lg); }

/* ---- Density ---- */
:root[data-density="comfortable"] { --pad: 20px; --gap: 18px; --row-h: 52px; --cell-y: 13px; }
:root[data-density="compact"]     { --pad: 14px; --gap: 12px; --row-h: 42px; --cell-y: 8px; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--ui-font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.45;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12.5px; letter-spacing: -0.01em; }
.dim { color: var(--text-dim); }
.small { font-size: 12px; }
.danger-text { color: var(--c-danger); }
button { font-family: inherit; cursor: pointer; }
.row { display: flex; align-items: center; }
.gap4 { gap: 4px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }

/* ============================ APP SHELL ============================ */
.app { display: grid; grid-template-columns: 256px 1fr; height: 100vh; overflow: hidden; }
.app.sb-collapsed { grid-template-columns: 72px 1fr; }
.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); background-image: var(--bg-grad); }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.content-inner { max-width: 1320px; margin: 0 auto; padding: 26px 30px 60px; }
.view { display: flex; flex-direction: column; gap: var(--gap); }
@media (max-width: 1100px){ .content-inner{ padding: 20px; } }

/* ============================ SIDEBAR ============================ */
.sidebar { background: var(--sidebar-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--accent), color-mix(in oklch, var(--accent) 60%, #000)); box-shadow: 0 4px 12px -4px color-mix(in oklch, var(--accent) 60%, transparent); flex-shrink: 0; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -0.02em; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 10.5px; color: var(--text-dim); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-section { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim); padding: 12px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border: none; background: none; border-radius: var(--r-sm); color: var(--text-mid); font-size: 13.5px; font-weight: 500; text-align: left; width: 100%; position: relative; transition: background .12s, color .12s; }
.sb-collapsed .nav-item { justify-content: center; padding: 10px; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.is-active { background: var(--accent-tint); color: var(--accent); font-weight: 650; }
.nav-item.is-active .nav-ico { color: var(--accent); }
.nav-ico { display: grid; place-items: center; color: var(--text-dim); }
.nav-label { flex: 1; }
.nav-count { font-size: 11px; font-family: var(--mono); color: var(--text-dim); background: var(--surface-3); padding: 1px 7px; border-radius: 20px; }
.nav-item.is-active .nav-count { background: color-mix(in oklch, var(--accent) 18%, transparent); color: var(--accent); }
.nav-alert { width: 7px; height: 7px; border-radius: 50%; background: var(--c-danger); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c-danger) 22%, transparent); }
.nav-dot-collapsed { position: absolute; top: 7px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sidebar-foot { margin-top: 8px; }
.server-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); }
.server-chip.mini { justify-content: center; padding: 10px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--c-ok); flex-shrink: 0; position: relative; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--c-ok); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0%{ transform: scale(.6); opacity: .8; } 100%{ transform: scale(1.6); opacity: 0; } }
.server-host { font-size: 12.5px; font-weight: 650; font-family: var(--mono); }
.server-meta { font-size: 11px; color: var(--text-dim); }

/* ============================ TOPBAR ============================ */
.topbar { height: 60px; display: flex; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border);
  background: var(--topbar-bg); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 30; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.crumb-root { font-family: var(--mono); }
.crumb-cur { color: var(--text); font-weight: 600; }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.global-search { display: flex; align-items: center; gap: 9px; width: 100%; max-width: 460px; padding: 8px 12px; border-radius: 10px; background: var(--surface-3); border: 1px solid transparent; color: var(--text-dim); transition: border .15s, background .15s; }
.global-search:focus-within { border-color: color-mix(in oklch, var(--accent) 45%, transparent); background: var(--surface); }
.global-search input { flex: 1; border: none; background: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text); }
.global-search input::placeholder { color: var(--text-dim); }
.global-search kbd { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 5px; background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-user { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 30px; cursor: pointer; transition: background .12s; flex-shrink: 0; }
.topbar-user-text { white-space: nowrap; }
.topbar-user:hover { background: var(--surface-3); }
.tu-name { font-size: 12.5px; font-weight: 650; line-height: 1.1; }
.tu-role { font-size: 11px; color: var(--text-dim); }
@media (max-width: 980px){ .topbar-user-text, .topbar-center { display: none; } }

/* icon buttons */
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; color: var(--text-mid); position: relative; transition: background .12s, color .12s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.is-active { background: var(--accent-tint); color: var(--accent); }
.bell-badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--c-danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--topbar-bg); }

/* bell popover */
.bell-wrap { position: relative; }
.pop-scrim { position: fixed; inset: 0; z-index: 40; }
.bell-pop { position: absolute; top: 46px; right: 0; width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-pop); z-index: 50; overflow: hidden; animation: popIn .14s ease; }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px); } }
.bell-pop-head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; }
.link-btn { border: none; background: none; color: var(--accent); font-size: 12px; font-weight: 600; }
.bell-item { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.bell-item:last-child { border-bottom: none; }
.bell-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; }
.bell-ico.lvl-warning { background: color-mix(in oklch, var(--c-warn) 16%, transparent); color: var(--c-warn); }
.bell-ico.lvl-critical { background: color-mix(in oklch, var(--c-danger) 16%, transparent); color: var(--c-danger); }
.bell-ico.lvl-info { background: color-mix(in oklch, var(--c-info) 16%, transparent); color: var(--c-info); }
.bell-title { font-size: 12.5px; font-weight: 650; }
.bell-detail { font-size: 11.5px; color: var(--text-mid); margin-top: 1px; }
.bell-time { font-size: 10.5px; color: var(--text-dim); margin-top: 3px; }

/* ============================ CARD ============================ */
.card { background: var(--card-bg); border: var(--card-border); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.card-pad { padding: var(--pad); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head.pad { padding: var(--pad) var(--pad) 0; }
.card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.card-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ============================ SECTION HEAD ============================ */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 2px; }
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; margin: 0; white-space: nowrap; }
.section-sub { font-size: 13px; color: var(--text-dim); margin: 4px 0 0; }
.section-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ============================ BUTTON ============================ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 9px; font-weight: 600; font-size: 13px; border: 1px solid transparent; white-space: nowrap; transition: background .12s, border-color .12s, transform .06s; }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-md { padding: 9px 15px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px -2px color-mix(in oklch, var(--accent) 55%, transparent); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 88%, #000); }
.btn-default { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-default:hover { background: var(--surface-3); }
.btn-ghost { background: transparent; color: var(--text-mid); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

/* ============================ BADGE ============================ */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; font-weight: 600; line-height: 1; white-space: nowrap; }
.badge-md { padding: 5px 10px; font-size: 11.5px; }
.badge-sm { padding: 3px 8px; font-size: 11px; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { background: var(--surface-3); color: var(--text-mid); }
.badge-accent { background: var(--accent-tint); color: var(--accent); }
.badge-ok { background: color-mix(in oklch, var(--c-ok) 14%, transparent); color: color-mix(in oklch, var(--c-ok) 80%, var(--text)); }
.badge-warn { background: color-mix(in oklch, var(--c-warn) 16%, transparent); color: color-mix(in oklch, var(--c-warn) 78%, var(--text)); }
.badge-danger { background: color-mix(in oklch, var(--c-danger) 14%, transparent); color: color-mix(in oklch, var(--c-danger) 82%, var(--text)); }
.badge-info { background: color-mix(in oklch, var(--c-info) 14%, transparent); color: color-mix(in oklch, var(--c-info) 80%, var(--text)); }
.badge-muted { background: var(--surface-3); color: var(--text-dim); }

/* ============================ PROGRESS ============================ */
.progress-wrap { display: flex; align-items: center; gap: 8px; }
.progress-track { flex: 1; background: var(--track); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 20px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.fill-accent { background: var(--accent); }
.fill-warn { background: var(--c-warn); }
.fill-danger { background: var(--c-danger); }
.progress-label { font-family: var(--mono); font-size: 11px; color: var(--text-dim); }

/* ============================ TOGGLE ============================ */
.toggle { width: 38px; height: 22px; border-radius: 20px; border: none; background: var(--border-strong); position: relative; transition: background .18s; padding: 0; }
.toggle.on { background: var(--accent); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle.on .toggle-knob { transform: translateX(16px); }

/* ============================ AVATAR ============================ */
.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: var(--text); flex-shrink: 0; }
.avatar[style*="--accent"], .topbar-user .avatar { color: #fff; }

/* ============================ GRIDS ============================ */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.grid-2.align-start { align-items: start; }
.grid-main { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 1180px){ .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-main, .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ============================ STAT CARD ============================ */
.stat-card { padding: var(--pad); display: flex; flex-direction: column; }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.stat-trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; font-family: var(--mono); padding: 3px 7px; border-radius: 20px; }
.stat-trend.up { color: var(--c-ok); background: color-mix(in oklch, var(--c-ok) 12%, transparent); }
.stat-trend.down { color: var(--text-mid); background: var(--surface-3); }
.stat-label { font-size: 12.5px; color: var(--text-dim); margin-top: 14px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-top: 2px; font-feature-settings: "tnum"; }
.stat-unit { font-size: 14px; font-weight: 600; color: var(--text-dim); margin-left: 2px; }
.stat-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.stat-spark { margin-top: 12px; margin-left: -2px; }

/* ============================ ACTIVITY CARD ============================ */
.activity-card { padding: var(--pad); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg.subtle { background: transparent; border: 1px solid var(--border); }
.seg-btn { border: none; background: none; padding: 5px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-dim); transition: background .12s, color .12s; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.seg.subtle .seg-btn.on { background: var(--accent-tint); color: var(--accent); box-shadow: none; }
.activity-now { display: flex; align-items: baseline; gap: 9px; margin: 16px 0 4px; }
.now-val { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; font-family: var(--mono); }
.now-lbl { font-size: 12.5px; color: var(--text-dim); }
.live-dot { width: 7px; height: 7px; margin-left: auto; position: relative; display: inline-block; }
.live-dot span { position: absolute; inset: 0; border-radius: 50%; background: var(--c-ok); }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--c-ok); animation: pulse 1.8s ease-out infinite; }
.live-txt { font-size: 11px; color: var(--c-ok); font-weight: 600; }

/* ============================ RESOURCES ============================ */
.resources-card { padding: var(--pad); }
.res-list { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.res-row { display: flex; align-items: center; gap: 12px; }
.res-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-mid); flex-shrink: 0; }
.res-main { flex: 1; min-width: 0; }
.res-line { display: flex; justify-content: space-between; margin-bottom: 6px; }
.res-label { font-size: 12.5px; font-weight: 600; }
.res-val { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.res-val b { color: var(--text); font-weight: 700; }
.res-pct { font-family: var(--mono); font-size: 12.5px; font-weight: 700; width: 38px; text-align: right; }
.uptime-strip { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--border); }
.uptime-bars { display: flex; gap: 2px; height: 30px; align-items: flex-end; }
.ub { flex: 1; border-radius: 2px; height: 100%; }
.ub.ok { background: color-mix(in oklch, var(--c-ok) 55%, transparent); }
.ub.warn { background: var(--c-warn); height: 60%; }
.uptime-legend { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.uptime-legend b { color: var(--c-ok); font-family: var(--mono); }

/* ============================ ALERTS ============================ */
.alerts-card, .services-card { padding: var(--pad); }
.alert-list { display: flex; flex-direction: column; margin-top: 14px; }
.alert-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: center; }
.alert-item:last-child { border-bottom: none; padding-bottom: 0; }
.alert-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.alert-item.lvl-warning .alert-ico { background: color-mix(in oklch, var(--c-warn) 15%, transparent); color: var(--c-warn); }
.alert-item.lvl-critical .alert-ico { background: color-mix(in oklch, var(--c-danger) 15%, transparent); color: var(--c-danger); }
.alert-item.lvl-info .alert-ico { background: color-mix(in oklch, var(--c-info) 15%, transparent); color: var(--c-info); }
.alert-main { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 650; }
.alert-detail { font-size: 12px; color: var(--text-mid); margin-top: 1px; }
.alert-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.alert-time { font-size: 11px; color: var(--text-dim); }
.alert-action { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 7px; }
.alert-action:hover { background: var(--surface-3); }

/* ============================ SERVICES ============================ */
.svc-list { display: flex; flex-direction: column; margin-top: 12px; }
.svc-row { display: flex; align-items: center; gap: 11px; padding: 8.5px 0; border-bottom: 1px solid var(--border); }
.svc-row:last-child { border-bottom: none; }
.svc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.svc-dot.running { background: var(--c-ok); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c-ok) 18%, transparent); }
.svc-dot.warning { background: var(--c-warn); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c-warn) 18%, transparent); }
.svc-name { font-size: 12.5px; font-weight: 600; flex: 1; }
.svc-meta { font-size: 11.5px; color: var(--text-dim); font-family: var(--mono); }
.svc-since { font-size: 11px; color: var(--text-dim); width: 36px; text-align: right; }
.svc-act { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text-mid); display: grid; place-items: center; }
.svc-act:hover { background: var(--surface-3); color: var(--text); }

/* ============================ DATA TABLE ============================ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); padding: 12px var(--pad); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody td { padding: var(--cell-y) var(--pad); border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable { cursor: pointer; transition: background .1s; }
.data-table tbody tr.clickable:hover { background: var(--surface-2); }
.data-table tbody tr.row-off { opacity: 0.5; }
.cell-domain { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.cell-meta { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.favico { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); flex-shrink: 0; }
.favico.db { background: color-mix(in oklch, var(--c-violet) 14%, transparent); color: var(--c-violet); }
.cell-act { text-align: right; width: 1%; white-space: nowrap; }
.row-act { width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--text-dim); display: inline-grid; place-items: center; vertical-align: middle; transition: background .1s, color .1s; }
.row-act:hover { background: var(--surface-3); color: var(--text); }
.row-act.danger:hover { background: color-mix(in oklch, var(--c-danger) 14%, transparent); color: var(--c-danger); }
.row-act[disabled] { opacity: .3; pointer-events: none; }
.row-act:not([class*="icon"]):not(:has(svg)) { width: auto; padding: 0 10px; font-size: 12px; font-weight: 600; }

/* table toolbar */
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px var(--pad); border-bottom: 1px solid var(--border); }
.search { display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 9px; background: var(--surface-3); border: 1px solid transparent; color: var(--text-dim); min-width: 200px; transition: border .15s; }
.search:focus-within { border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.search input { border: none; background: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text); width: 100%; }
.search input::placeholder { color: var(--text-dim); }

/* ============================ STAT STRIP / MINISTAT ============================ */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
@media (max-width: 1180px){ .stat-strip { grid-template-columns: repeat(2,1fr); } }
.ministat { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: var(--card-bg); border: var(--card-border); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.ministat-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-mid); flex-shrink: 0; }
.ministat-ico.accent { background: var(--accent-tint); color: var(--accent); }
.ministat-ico.cyan { background: color-mix(in oklch, var(--c-cyan) 14%, transparent); color: var(--c-cyan); }
.ministat-ico.amber { background: color-mix(in oklch, var(--c-amber) 16%, transparent); color: var(--c-amber); }
.ministat-ico.violet { background: color-mix(in oklch, var(--c-violet) 14%, transparent); color: var(--c-violet); }
.ministat-ico.ok { background: color-mix(in oklch, var(--c-ok) 14%, transparent); color: var(--c-ok); }
.ministat-ico.warn { background: color-mix(in oklch, var(--c-warn) 16%, transparent); color: var(--c-warn); }
.ministat-ico.danger { background: color-mix(in oklch, var(--c-danger) 14%, transparent); color: var(--c-danger); }
.ministat-val { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; white-space: nowrap; }
.ministat > div { min-width: 0; }
.ministat-lbl { font-size: 12px; color: var(--text-dim); }
.ministat-sub { color: var(--text-dim); }

/* ============================ FILTER TABS ============================ */
.ftabs { display: inline-flex; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 10px; }
.ftab { display: inline-flex; align-items: center; gap: 7px; border: none; background: none; padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--text-mid); }
.ftab.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.ftab-count { font-family: var(--mono); font-size: 10.5px; padding: 1px 6px; border-radius: 20px; background: var(--surface-3); color: var(--text-dim); }
.ftab.on .ftab-count { background: var(--accent-tint); color: var(--accent); }

/* ============================ MAIL ============================ */
.maildomain-list { display: flex; flex-direction: column; }
.maildomain { padding: 15px var(--pad); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.maildomain:last-child { border-bottom: none; }
.md-top { display: flex; align-items: center; gap: 9px; }
.md-name { font-weight: 650; font-size: 13px; flex: 1; }
.md-meta { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.mailbox-list { display: flex; flex-direction: column; }
.mailbox-row { display: flex; align-items: center; gap: 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--border); }
.mailbox-row:last-child { border-bottom: none; }
.mb-main { flex: 1; min-width: 0; }
.mb-addr { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.mb-right { text-align: right; flex-shrink: 0; }
.mb-quota { display: block; }
.mb-unread { font-size: 10.5px; color: var(--accent); font-weight: 600; }

/* ============================ DB ============================ */
.db-size { display: flex; align-items: center; gap: 10px; }
.db-bar { width: 60px; height: 5px; border-radius: 20px; background: var(--track); overflow: hidden; }
.db-bar span { display: block; height: 100%; background: var(--c-violet); border-radius: 20px; }

/* ============================ DNS ============================ */
.dns-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--gap); align-items: start; }
@media (max-width: 1100px){ .dns-layout { grid-template-columns: 1fr; } }
.zone-list { display: flex; flex-direction: column; }
.zone-item { display: flex; align-items: center; gap: 11px; padding: 13px var(--pad); border: none; border-bottom: 1px solid var(--border); background: none; text-align: left; width: 100%; }
.zone-item:last-child { border-bottom: none; }
.zone-item:hover { background: var(--surface-2); }
.zone-item.on { background: var(--accent-tint); }
.zone-main { flex: 1; min-width: 0; }
.zone-name { font-size: 13px; font-weight: 650; }
.zone-item.on .zone-name { color: var(--accent); }
.zone-meta { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.val-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================ BACKUP ============================ */
.target-card { padding: var(--pad); display: flex; flex-direction: column; gap: 14px; }
.target-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.target-ico.offline { background: var(--surface-3); color: var(--text-dim); }
.target-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.target-gauge { display: grid; place-items: center; padding: 6px 0; }
.target-meta { text-align: center; color: var(--text-dim); font-size: 12px; }
.target-offline { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 0; color: var(--text-dim); }

/* ============================ USERS ============================ */
.user-list { display: flex; flex-direction: column; }
.user-row { display: flex; align-items: center; gap: 13px; padding: 13px var(--pad); border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-row.susp { opacity: 0.6; }
.user-main { flex: 1; min-width: 0; }
.user-name { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.user-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.user-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.user-last { font-size: 11px; color: var(--text-dim); }
.pkg-list { display: flex; flex-direction: column; gap: 12px; padding: var(--pad); }
.pkg-card { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; }
.pkg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pkg-name { font-weight: 700; text-transform: capitalize; font-size: 14px; }
.pkg-users { font-size: 11px; color: var(--text-dim); font-family: var(--mono); }
.pkg-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pkg-grid > div { display: flex; flex-direction: column; gap: 2px; }
.pkg-k { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.pkg-v { font-size: 13px; font-weight: 700; font-family: var(--mono); }
@media (max-width: 1180px){ .pkg-grid { grid-template-columns: repeat(3,1fr); } }

/* ============================ DRAWER ============================ */
.drawer-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.drawer-root.open { pointer-events: auto; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(8,12,20,.42); opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.drawer-root.open .drawer-scrim { opacity: 1; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .3s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; max-width: 92vw; }
.drawer-root.open .drawer-panel { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.drawer-body { padding: 20px; overflow-y: auto; }
.dd { display: flex; flex-direction: column; gap: 16px; }
.dd-hero { display: flex; align-items: center; gap: 12px; }
.dd-favico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); }
.dd-domain { font-weight: 700; font-size: 15px; }
.dd-ip { font-size: 12px; color: var(--text-dim); }
.dd-hero .badge { margin-left: auto; }
.dd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.dd-cell { background: var(--surface); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.dd-k { font-size: 11px; color: var(--text-dim); }
.dd-v { font-size: 14px; font-weight: 700; }
.dd-section { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); margin-top: 4px; }
.dd-ssl { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r); border: 1px solid var(--border); }
.dd-ssl.ok { background: color-mix(in oklch, var(--c-ok) 8%, transparent); border-color: color-mix(in oklch, var(--c-ok) 25%, transparent); color: var(--c-ok); }
.dd-ssl.warn { background: color-mix(in oklch, var(--c-warn) 8%, transparent); border-color: color-mix(in oklch, var(--c-warn) 25%, transparent); color: var(--c-warn); }
.dd-ssl.none { color: var(--text-dim); }
.dd-ssl > div { flex: 1; }
.dd-ssl .btn { color: var(--text); }
.dd-ssl-title { font-weight: 650; font-size: 13px; }
.dd-ssl-sub { font-size: 11.5px; color: var(--text-dim); }

/* ============================ CHART ANIMATIONS ============================ */
.chart-reveal { transform-origin: left; animation: reveal 1.1s cubic-bezier(.3,.8,.3,1) forwards; transform: scaleX(0); }
@keyframes reveal { to { transform: scaleX(1); } }
.chart-dot { animation: fadeIn .4s 1s both; }
@keyframes fadeIn { from { opacity: 0; } }
.spark-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.donut-arc { animation: donut 1.1s cubic-bezier(.3,.8,.3,1) forwards; stroke-dashoffset: var(--c); }
@keyframes donut { from { stroke-dashoffset: var(--c); } }
.gauge-arc { transition: stroke-dashoffset 1.1s cubic-bezier(.3,.8,.3,1); }
.mini-bar { animation: barGrow .6s var(--d) cubic-bezier(.3,.8,.3,1) backwards; transform-origin: bottom; }
@keyframes barGrow { from { transform: scaleY(0); } }

@media (prefers-reduced-motion: reduce) {
  .chart-reveal, .spark-draw, .donut-arc, .mini-bar, .pulse::after, .live-dot::after { animation: none !important; }
  .chart-reveal { transform: scaleX(1); }
  .spark-draw { stroke-dashoffset: 0; }
}

/* scrollbar */
.content::-webkit-scrollbar, .drawer-body::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 3px solid var(--bg); }
.content::-webkit-scrollbar-track { background: transparent; }

/* ============================ SETTINGS PANEL ============================ */
.set-fab { position: fixed; right: 22px; bottom: 22px; z-index: 60; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-mid); display: grid; place-items: center;
  box-shadow: var(--shadow-lg); transition: transform .15s cubic-bezier(.3,.8,.3,1), color .15s, background .15s; }
.set-fab:hover { transform: translateY(-2px) rotate(35deg); color: var(--accent); background: var(--surface-2); }
.set-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(8,12,20,.28); backdrop-filter: blur(1px); animation: setFade .18s ease; }
@keyframes setFade { from { opacity: 0; } }
.set-panel { position: fixed; top: 0; right: 0; height: 100%; width: 320px; max-width: 92vw; z-index: 80;
  background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; animation: setSlide .26s cubic-bezier(.2,.8,.2,1); }
@keyframes setSlide { from { transform: translateX(100%); } }
.set-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 16px 20px; border-bottom: 1px solid var(--border); }
.set-head b { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.set-body { padding: 6px 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.set-section { font-size: 10.5px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-dim); padding: 14px 0 0; }
.set-section:first-child { padding-top: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.set-label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.set-seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.set-seg-btn { border: none; background: none; padding: 6px 11px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-dim); transition: background .12s, color .12s; }
.set-seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.set-select { appearance: none; padding: 8px 28px 8px 11px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 600; outline: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238a94a4' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.set-select:focus { border-color: color-mix(in oklch, var(--accent) 45%, transparent); }
.set-chips { display: flex; gap: 8px; }
.set-chip { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; padding: 0;
  box-shadow: 0 0 0 1px var(--border) inset; transition: transform .12s; position: relative; }
.set-chip:hover { transform: scale(1.1); }
.set-chip.on { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
