/* ── Design Tokens ────────────────────────────────────────────────────── */
:root {
  --sb-w:  52px;
  --sb-ew: 220px;
  --topbar-h: 44px;
  --drawer-w: 420px;
  --bg:           #f1f5f9;
  --card:         #ffffff;
  --border:       #e2e8f0;
  --border-strong:#cbd5e1;
  --text:         #0f172a;
  --muted:        #64748b;
  --muted-light:  #94a3b8;
  --sb-bg:        #0f172a;
  --sb-border:    rgba(255,255,255,.06);
  --sb-item:      rgba(255,255,255,.00);
  --sb-hover:     rgba(255,255,255,.07);
  --sb-active:    rgba(37,99,235,.30);
  --sb-text:      #b4bfcc;
  --sb-text-active:#93c5fd;
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light:#eff6ff;
  --ok:           #16a34a;
  --ok-bg:        #f0fdf4;
  --ok-border:    #bbf7d0;
  --warn:         #d97706;
  --warn-bg:      #fffbeb;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --radius:       3px;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,.09);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.13);
}

/* ── Dark mode overrides (neutral grays, sem tons azuis) ────────────────── */
[data-theme="dark"] {
  --bg:           #242424;
  --card:         #2e2e2e;
  --border:       #505050;
  --border-strong:#686868;
  --text:         #e4e4e4;
  --muted:        #a0a0a0;
  --muted-light:  #727272;
  --sb-bg:        #1a1a1a;
  --sb-border:    rgba(255,255,255,.12);
  --primary-light:#1e1530;
  --ok-bg:        #0f2410;
  --ok-border:    #1e5426;
  --warn-bg:      #261a00;
  --danger-bg:    #2a1010;
  --shadow-sm:    0 1px 2px rgba(0,0,0,.35);
  --shadow:       0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:    0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.6);
}

/* ── Skeleton loading — transform-based (GPU-composited, zero repaint) ─── */
.skel {
  display: inline-block;
  position: relative;
  overflow: hidden;
  background: var(--border);
  border-radius: var(--radius);
}
.skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--border-strong) 50%, transparent 100%);
  animation: skel-shimmer 1.5s ease-in-out infinite;
  will-change: transform;
}
@keyframes skel-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Button loading state ────────────────────────────────────────────────── */
.btn-loading {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn-loading > * { visibility: hidden; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 12px; height: 12px;
  top: 50%; left: 50%;
  margin: -6px 0 0 -6px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin .55s linear infinite;
}
.btn-loading.btn-outline::after,
.btn-loading.btn-ghost::after {
  border-color: var(--border-strong);
  border-top-color: var(--text);
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 13px; color: var(--text); background: var(--bg);
  display: flex; min-height: 100vh; line-height: 1.5;
}
a { text-decoration: none; color: inherit; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sb-w);
  background: var(--sb-bg);
  display: flex; flex-direction: column;
  border-right: 1px solid var(--sb-border);
  z-index: 200; overflow: hidden;
  transition: width .2s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
}
.sidebar.expanded { width: var(--sb-ew); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; height: var(--topbar-h); flex-shrink: 0;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar-logo-wrap { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.sidebar-logo-icon { flex-shrink: 0; }
.sidebar-brand {
  font-size: 13px; font-weight: 700; color: #f1f5f9;
  letter-spacing: .01em; opacity: 0; transition: opacity .15s .05s;
  white-space: nowrap;
}
.sidebar.expanded .sidebar-brand { opacity: 1; }

.sidebar-toggle {
  width: 26px; height: 26px; border: none; border-radius: var(--radius);
  background: transparent; color: var(--sb-text); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
  opacity: 0; pointer-events: none;
}
.sidebar:hover .sidebar-toggle,
.sidebar.expanded .sidebar-toggle { opacity: 1; pointer-events: auto; }
.sidebar-toggle:hover { background: var(--sb-hover); color: #e2e8f0; }
.sidebar.expanded .sidebar-toggle svg { transform: rotate(0deg); }
.sidebar:not(.expanded) .sidebar-toggle svg { transform: rotate(180deg); }

.sidebar-nav {
  flex: 1; display: flex; flex-direction: column;
  padding: 8px 8px 0; gap: 2px; overflow-y: auto; overflow-x: hidden;
}
.sidebar-footer {
  padding: 8px; border-top: 1px solid var(--sb-border);
}

.nav-btn {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 9px;
  border-radius: var(--radius); border: none;
  background: var(--sb-item); color: var(--sb-text);
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500;
  transition: background .12s, color .12s; text-decoration: none;
  white-space: nowrap; overflow: hidden;
}
.nav-btn:visited { color: var(--sb-text); }
.nav-btn:hover  { background: var(--sb-hover); color: #e2e8f0; }
.nav-btn.active { background: var(--sb-active); color: var(--sb-text-active); }
.nav-icon { flex-shrink: 0; }
.nav-label { opacity: 0; transition: opacity .12s; font-size: 12px; }
.sidebar.expanded .nav-label { opacity: 1; }

.nav-btn--logout { color: #f87171; }
.nav-btn--logout:hover { background: rgba(220,38,38,.15); color: #fca5a5; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sb-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.sidebar.expanded + .main-wrap { margin-left: var(--sb-ew); }
.app-content { flex: 1; padding: 20px 24px; }
.app-content.fill { padding: 0; display: flex; flex-direction: column; overflow: hidden; height: calc(100vh - var(--topbar-h)); }

/* ── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h); background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }

/* Global search */
.topbar-search-wrap {
  position: relative; display: flex; align-items: center; gap: 7px;
  flex: 0 1 260px; margin-left: auto; margin-right: 8px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0 10px; height: 28px;
}
.topbar-search-input {
  border: none; background: transparent; font-size: 12px;
  font-family: inherit; color: var(--text); outline: none; flex: 1; width: 0;
}
.topbar-search-input::placeholder { color: var(--muted-light); }
.topbar-search-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.1); z-index: 200; overflow: hidden;
}
.topbar-search-dropdown.open { display: block; }
.gsr-item {
  display: flex; align-items: flex-start; gap: 9px; padding: 8px 12px;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.gsr-item:last-child { border-bottom: none; }
.gsr-item:hover { background: var(--bg); }
.gsr-type {
  font-size: 10px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); border-radius: 3px; padding: 1px 5px;
  flex-shrink: 0; margin-top: 1px; white-space: nowrap;
}
.gsr-name { font-size: 12px; font-weight: 600; color: var(--text); }
.gsr-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.gsr-empty { padding: 12px; font-size: 12px; color: var(--muted); }

/* VM list search */
.vm-list-search {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0; color: var(--muted);
}
.vm-list-search-input {
  border: none; background: transparent; font-size: 11px; font-family: inherit;
  color: var(--text); outline: none; flex: 1;
}
.vm-list-search-input::placeholder { color: var(--muted-light); }

.breadcrumb { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.breadcrumb-item { color: var(--muted); }
.breadcrumb-item.link { cursor: pointer; transition: color .12s; }
.breadcrumb-item.link:hover { color: var(--primary); }
.breadcrumb-item.current { color: var(--text); font-weight: 600; }
.breadcrumb-sep { color: var(--border-strong); font-size: 11px; }

/* ── Section header ──────────────────────────────────────────────────── */
.section-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text); }
.section-count {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); padding: 1px 7px; border-radius: 10px;
}

/* ── Page header ─────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.page-header-logo {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.page-header-logo img { width: 100%; height: 100%; object-fit: contain; }
.page-header-info { flex: 1; }
.page-header-title { font-size: 18px; font-weight: 700; line-height: 1.2; margin-bottom: 3px; }
.page-header-sub { font-size: 12px; color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-primary, .btn-outline, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 12px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); border-color: var(--border-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-icon { width: 28px; height: 28px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon svg { display: block; }
.btn-danger-outline { background: transparent; border: 1px solid #fca5a5; color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-bg); }

/* ── Status dots ─────────────────────────────────────────────────────── */
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-ok   { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-none { background: #cbd5e1; }

/* ── Home KPI row ────────────────────────────────────────────────────── */
.home-kpi-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 24px;
}
.home-kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px;
}
.home-kpi-icon {
  width: 40px; height: 40px; border-radius: var(--radius); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.home-kpi-icon svg { width: 20px; height: 20px; }
.hki--blue  { background: #eff6ff; color: #2563eb; }
.hki--slate { background: #f1f5f9; color: #475569; }
.hki--green { background: #f0fdf4; color: #16a34a; }
.hki--amber { background: #fffbeb; color: #d97706; }
.home-kpi-body { min-width: 0; }
.home-kpi-num { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.home-kpi-lbl { font-size: 11px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.kpi-health { font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 10px; }
.kpi-health--ok   { background: var(--ok-bg);  color: var(--ok);  border: 1px solid var(--ok-border); }
.kpi-health--warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #fde68a; }

/* ── DC grid (home) ──────────────────────────────────────────────────── */
.dc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

.dc-card-v2 {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.dc-card-v2:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.dc-card-v2-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.dc-logo {
  width: 40px; height: 40px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--muted);
}
.dc-logo img { width: 100%; height: 100%; object-fit: contain; }
.dc-card-v2-info { flex: 1; min-width: 0; }
.dc-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-card-v2-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

.dc-srv-list { padding: 0 16px 10px; display: flex; flex-direction: column; gap: 4px; }
.dc-srv-row {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dc-srv-dot { width: 5px; height: 5px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }
.dc-srv-name { flex: 1; font-size: 11px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-srv-badge {
  font-size: 11px; color: var(--muted); background: var(--card);
  border: 1px solid var(--border); padding: 0 5px; border-radius: 3px; white-space: nowrap;
}
.dc-srv-badge--blue { color: var(--primary); background: #eff6ff; border-color: #bfdbfe; }
.dc-srv-more { font-size: 11px; color: var(--muted); padding: 2px 8px; }

.dc-card-v2-stats { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--border); margin-top: auto; }
.dc-card-v2-stat { padding: 10px 12px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.dc-card-v2-stat:last-child { border-right: none; }
.dc-stat-val { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1; }
.dc-stat-lbl { font-size: 11px;  letter-spacing: .04em; color: var(--muted); }

.dc-card-v2-footer { padding: 8px 12px; border-top: 1px solid var(--border); display: flex; gap: 5px; background: var(--bg); }

/* ── DC banner (DC sub-page) ─────────────────────────────────────────── */
.dc-banner {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px;
  margin-bottom: 20px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dc-banner-logo {
  width: 48px; height: 48px; border-radius: var(--radius); flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.dc-banner-logo img { width: 100%; height: 100%; object-fit: contain; }
.dc-banner-body { flex: 1; min-width: 0; }
.dc-banner-title { font-size: 18px; font-weight: 700; margin-bottom: 7px; }
.dc-banner-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.dc-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 3px;
}
.dc-pill svg { width: 11px; height: 11px; flex-shrink: 0; }
.dc-pill--blue { color: var(--primary); background: #eff6ff; border-color: #bfdbfe; }

/* ── Server grid (DC sub-page) ───────────────────────────────────────── */
.srv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.srv-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s, border-color .15s;
}
.srv-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

.srv-card-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 18px 12px; cursor: pointer;
}

.srv-card-icon-wrap { position: relative; flex-shrink: 0; }
.srv-card-icon {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
}
.srv-card-icon svg { width: 20px; height: 20px; }

.srv-dot-badge {
  position: absolute; bottom: -2px; right: -2px;
  width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--card);
}
.srv-dot-badge.st--ok   { background: var(--ok); }
.srv-dot-badge.st--warn { background: var(--warn); }
.srv-dot-badge.st--none { background: #cbd5e1; }

.srv-card-title { flex: 1; min-width: 0; }
.srv-card-name  { font-size: 15px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-card-host  { font-size: 12px; color: var(--muted); font-family: monospace; margin-top: 2px; }
.srv-card-desc  { font-size: 12px; color: var(--muted-light); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.srv-card-status { flex-shrink: 0; margin-top: 2px; }

.srv-card-dots {
  padding: 0 18px 14px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.srv-vm-dots { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.srv-vm-extra { font-size: 11px; color: var(--muted); margin-left: 2px; }

.srv-card-metrics {
  display: grid; grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.srv-card-metric { padding: 14px 18px; display: flex; flex-direction: column; }
.srv-card-metric + .srv-card-metric { border-left: 1px solid var(--border); }
.srv-card-metric-val { font-size: 26px; font-weight: 800; line-height: 1; color: var(--text); }
.srv-card-metric-val--blue { color: var(--primary); }
.srv-card-metric-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }

.srv-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-top: 1px solid var(--border); background: var(--bg);
  margin-top: auto;
}
.srv-card-foot-actions { display: flex; gap: 6px; }

.srv-status-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 3px; border: 1px solid transparent; white-space: nowrap;
}
.srv-status-badge.st--ok   { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-border); }
.srv-status-badge.st--warn { background: var(--warn-bg);  color: var(--warn); border-color: #fde68a; }
.srv-status-badge.st--none { background: var(--bg); color: var(--muted); border-color: var(--border); }

/* ── Card grid (generic) ─────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-icon { margin-bottom: 12px; opacity: .3; }
.empty-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.empty-desc { font-size: 12px; }

/* ── Settings page ───────────────────────────────────────────────────── */
.settings-wrap {
  display: flex; flex: 1; overflow: hidden; height: 100%;
}
.settings-nav {
  width: 200px; flex-shrink: 0;
  background: var(--card); border-right: 1px solid var(--border);
  padding: 16px 8px; overflow-y: auto;
}
.settings-nav-group-label {
  font-size: 10px; font-weight: 700; color: var(--muted);
  letter-spacing: .07em; padding: 4px 8px 8px;
}
.settings-nav-item {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 7px 8px; border-radius: var(--radius); border: none;
  background: transparent; font-family: inherit; font-size: 12px;
  font-weight: 500; color: var(--text); cursor: pointer;
  transition: background .1s; text-align: left;
}
.settings-nav-item:hover { background: var(--bg); }
.settings-nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.settings-nav-badge {
  margin-left: auto; padding: 1px 6px; border-radius: 10px; font-size: 10px;
  font-weight: 700; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); flex-shrink: 0; line-height: 1.6;
}
.settings-nav-item.active .settings-nav-badge {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.settings-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.settings-content-header {
  padding: 18px 24px 14px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.settings-content-title { font-size: 15px; font-weight: 700; color: var(--text); }
.settings-content-desc  { font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
}
.settings-search-wrap {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 5px 9px; background: var(--bg);
}
.settings-search-input {
  border: none; background: transparent; font-size: 12px;
  color: var(--text); font-family: inherit; outline: none; width: 200px;
}
.settings-table-wrap { flex: 1; overflow-y: auto; background: var(--bg); }
.settings-table { width: 100%; border-collapse: collapse; background: var(--card); }
.settings-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--bg); padding: 8px 20px;
  text-align: left; font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .05em; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.settings-table tbody td {
  padding: 11px 20px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text); vertical-align: middle;
  background: var(--card);
}
.settings-table tbody tr:hover td { background: var(--bg); }
.settings-empty { display: flex; align-items: center; justify-content: center; padding: 60px 0; }
.st-cell-primary { display: flex; align-items: center; gap: 10px; }
.st-entity-icon {
  width: 28px; height: 28px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--muted-light);
}
.st-avatar {
  width: 26px; height: 26px; border-radius: var(--radius);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.st-entity-name { font-weight: 600; font-size: 12px; color: var(--text); }
.st-entity-sub  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.st-mono  { font-family: monospace; font-size: 11px; color: var(--text); }
.st-muted { font-size: 11px; color: var(--muted-light); }
.st-count { font-size: 11px; color: var(--muted); }
.st-tag {
  display: inline-block; padding: 2px 7px; border-radius: 3px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 11px; color: var(--text); white-space: nowrap;
}
.st-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 500;
  border: 1px solid var(--border); color: var(--muted); background: var(--bg);
}
.st-badge::before { content:''; width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.5; }
.st-badge-ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ok); }
.st-actions-cell { text-align: right; white-space: nowrap; }
.st-del-btn { color: var(--danger) !important; }

/* ── Drawer ──────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.4);
  z-index: 300; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--drawer-w); max-width: 100vw;
  background: var(--card); border-left: 1px solid var(--border);
  z-index: 400; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; height: var(--topbar-h); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.drawer-header h3 { font-size: 14px; font-weight: 600; flex: 1; }
.drawer-close-btn {
  width: 26px; height: 26px; border: none; border-radius: var(--radius);
  background: transparent; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.drawer-close-btn:hover { background: var(--bg); color: var(--text); }

.drawer-tab-bar {
  display: flex; border-bottom: 1px solid var(--border);
  padding: 0 16px; flex-shrink: 0; background: var(--bg);
}
.drawer-tab {
  padding: 9px 12px; border: none; background: transparent;
  font-family: inherit; font-size: 12px; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .12s, border-color .12s;
}
.drawer-tab:hover { color: var(--text); }
.drawer-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; }
.drawer-tab-pane { display: none; flex-direction: column; gap: 12px; }
.drawer-tab-pane.active { display: flex; }

.drawer-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 6px; flex-shrink: 0; background: var(--bg);
}

/* Form fields */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12px; font-weight: 500; color: var(--text); }
.form-input, .form-select, .form-textarea {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12px; font-family: inherit; background: var(--card); color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted-light); }
.form-textarea { resize: vertical; min-height: 72px; font-family: monospace; font-size: 11px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 1px; }

.logo-upload-wrap { display: flex; align-items: center; gap: 12px; }
.logo-preview-box {
  width: 52px; height: 52px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--muted);
}
.logo-preview-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-upload-actions { display: flex; flex-direction: column; gap: 5px; }
.logo-upload-label {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: var(--radius); border: 1px solid var(--border);
  font-size: 11px; font-weight: 500; cursor: pointer; color: var(--text); background: #fff;
}
.logo-upload-label:hover { background: var(--bg); }
.logo-remove-btn { font-size: 11px; color: var(--danger); background: none; border: none; cursor: pointer; }
.form-section { padding-top: 12px; margin-top: 4px; border-top: 1px solid var(--border); }
.form-section-title { font-size: 11px; font-weight: 700; color: var(--muted);  letter-spacing: .06em; margin-bottom: 10px; }

/* ── Modals ──────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.55); z-index: 500;
  align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; max-height: 90vh;
}
.modal--logs     { width: min(900px, 100%); }
.modal--terminal { width: min(1000px, 100%); }
.modal--sftp     { width: min(860px, 100%); }

.modal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: var(--topbar-h);
  border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.modal-title { font-size: 13px; font-weight: 600; flex: 1; }
.modal-close {
  width: 26px; height: 26px; border: none; background: transparent; color: var(--muted);
  cursor: pointer; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.modal-close:hover { background: var(--border); }

.modal-toolbar {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.log-path-input { flex: 1; padding: 5px 9px; border: 1px solid var(--border); border-radius: var(--radius); font-family: monospace; font-size: 12px; }
.log-path-input:focus { outline: none; border-color: var(--primary); }
.log-lines-input { width: 66px; padding: 5px 7px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; text-align: center; }
.toggle-label { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.log-viewer {
  flex: 1; overflow: auto; padding: 12px 14px;
  font-family: "Cascadia Code", "Fira Mono", Consolas, monospace; font-size: 12px; line-height: 1.6;
  background: #0d1117; color: #8b949e; white-space: pre-wrap; word-break: break-all;
  min-height: 280px; max-height: 60vh;
}

#terminalContainer { padding: 0; background: #0d1117; min-height: 420px; flex: 1; }
.xterm { padding: 10px; }

.sftp-toolbar {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0;
}
.sftp-breadcrumb { flex: 1; font-family: monospace; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sftp-upload-label {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; background: var(--primary); color: #fff;
  border-radius: var(--radius); font-size: 11px; font-weight: 500; cursor: pointer;
}
.sftp-upload-label:hover { background: var(--primary-dark); }
.sftp-table-wrap { flex: 1; overflow-y: auto; max-height: 55vh; }
.sftp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sftp-table th {
  text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;  letter-spacing: .05em;
  color: var(--muted); background: var(--bg); position: sticky; top: 0;
}
.sftp-table td { padding: 7px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sftp-table tr:last-child td { border-bottom: none; }
.sftp-table tbody tr:hover td { background: var(--bg); }
.sftp-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.sftp-name--dir { cursor: pointer; }
.sftp-name--dir:hover { color: var(--primary); }
.sftp-file-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex-shrink: 0; }
.sftp-size, .sftp-mtime { color: var(--muted); font-size: 11px; }
.sftp-actions { display: flex; gap: 3px; justify-content: flex-end; }

/* ── VMs page filter bar ─────────────────────────────────────────────── */
.vm-filter-bar { padding: 0 0 14px; }
.vm-filter-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); overflow: hidden; height: 36px;
  transition: border-color .15s;
}
.vm-filter-group:focus-within { border-color: var(--primary); }
.vm-filter-select {
  height: 100%; padding: 0 28px 0 12px;
  border: none; border-right: 1px solid var(--border);
  background: transparent; color: var(--text);
  font-size: 13px; font-family: inherit; cursor: pointer; outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: background-color .12s;
}
.vm-filter-select:hover { background-color: var(--bg); }
.vm-filter-select:focus { background-color: var(--bg); }
.vm-filter-search-wrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px; flex: 1; color: var(--muted); min-width: 160px;
}
.vm-filter-search-input {
  border: none; background: transparent; font-size: 13px; font-family: inherit;
  color: var(--text); outline: none; flex: 1; min-width: 0;
}
.vm-filter-search-input::placeholder { color: var(--muted-light); }

.vl-srv-tag {
  font-size: 10px; color: var(--muted); padding-left: 22px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: -2px;
}

/* ── Two-panel VM page ───────────────────────────────────────────────── */
.server-layout {
  display: grid; grid-template-columns: 240px 1fr;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
  height: calc(100vh - var(--topbar-h) - 48px); min-height: 440px;
}

.vm-list-panel {
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
.vm-list-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; height: 36px; border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 700;  letter-spacing: .06em; color: var(--muted); flex-shrink: 0; background: var(--card);
}
.vm-list-items { overflow-y: auto; flex: 1; }

.vm-list-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 14px; cursor: pointer;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
  transition: background .1s, border-color .1s;
}
.vm-list-item:hover  { background: var(--bg); }
.vm-list-item.active { background: var(--bg); border-left-color: var(--primary); }

.vl-top  { display: flex; align-items: center; gap: 7px; }
.vl-avatar {
  width: 22px; height: 22px; border-radius: var(--radius);
  overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.vl-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.vl-org  { font-size: 11px; color: var(--muted); padding-left: 43px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vl-meters    {
  display: flex;
  margin: 5px 0 0 43px;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: var(--bg);
  font-size: 11px;
}
.vl-meter     {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .35em;
  padding: .28em .55em;
  border-right: 1px solid var(--border);
}
.vl-meter:last-child  { border-right: none; }
.vl-meter-lbl { font-size: .82em; color: var(--muted-light); }
.vl-meter-val { font-size: 1em; font-weight: 700; }

/* VM detail (right panel) */
.vm-detail-panel { overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.vm-detail-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--muted-light); font-size: 12px; gap: 8px;
}

/* VM detail – new header */
.vd-header {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; background: var(--card);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.vd-identity { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.vd-name     { font-size: 14px; font-weight: 700; color: var(--text); }
.vd-desc     { font-size: 11px; color: var(--muted-light); }
.vd-actions  { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.vd-actions-sep { width: 1px; height: 18px; background: var(--border); margin: 0 3px; }

.vm-org-tag { background: var(--bg); border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px; font-size: 11px; }
.vm-host { font-family: monospace; font-size: 11px; color: var(--muted); }

/* Metric strip */
.vd-metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); background: var(--card); flex-shrink: 0; }
.vd-metric-card  { padding: 12px 18px; border-right: 1px solid var(--border); }
.vd-metric-card:last-child { border-right: none; }
.vd-metric-top   { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.vd-metric-label { font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 3px; }
.vd-metric-pct   { font-size: 24px; font-weight: 800; line-height: 1; }
.vd-metric-detail { font-size: 11px; color: var(--muted); margin-top: 5px; font-family: monospace; }

/* ── Home page charts ────────────────────────────────────────────────────── */
.home-charts-row {
  display: grid;
  grid-template-columns: 180px 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.home-chart-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
}
.home-chart-title {
  font-size: 12px; font-weight: 600; color: var(--muted);
  margin-bottom: 10px;
}
.home-chart-body { position: relative; height: 130px; }
.home-status-legend {
  display: flex; flex-direction: column; gap: 5px; margin-top: 8px;
}
.home-status-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.home-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.home-status-count { font-weight: 700; color: var(--text); margin-left: auto; }

/* ── Drag and Drop ───────────────────────────────────────────────────────── */
.drag-ghost { opacity: 0.3 !important; box-shadow: none !important; }

.drag-handle {
  cursor: grab;
  color: var(--border-strong);
  opacity: 0;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  border-radius: 4px;
  user-select: none;
}
.drag-handle:hover { color: var(--muted); }
.srv-card:hover .drag-handle,
.vm-list-item:hover .drag-handle { opacity: 1; }

/* Overview pane — 2-column grid */
.vd-overview-grid {
  display: grid; grid-template-columns: 1fr 220px;
  flex: 1; min-height: 0;
}
.vd-overview-left {
  padding: 16px 20px; background: var(--card);
  border-right: 1px solid var(--border); overflow-y: auto;
  display: flex; flex-direction: column;
}
.vd-overview-right {
  padding: 14px 12px; background: var(--bg);
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
}
.vd-stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center;
}
.vd-stat-icon { color: var(--primary); opacity: .7; margin-bottom: 4px; }
.vd-stat-num  { font-size: 42px; font-weight: 800; color: var(--primary); line-height: 1; }
.vd-stat-label { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 2px; }
.vd-stat-sub   { font-size: 11px; color: var(--muted); }

.vd-section-title   { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 8px; letter-spacing: .04em; }
.vd-section-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.vd-info-table { width: 100%; border-collapse: collapse; }
.vd-info-table tr { border-bottom: 1px solid var(--bg); }
.vd-info-table tr:last-child { border-bottom: none; }
.vd-info-table td { padding: 5px 0; font-size: 12px; vertical-align: middle; color: var(--text); }
.vd-info-table td:first-child { color: var(--muted); width: 100px; font-size: 11px; }
.vd-pg-row   { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.vd-pg-num   { font-size: 28px; font-weight: 800; color: var(--primary); line-height: 1; }
.vd-pg-lbl   { font-size: 12px; color: var(--muted); }

/* Detail tabs */
.det-tab-bar {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0; padding: 0 14px;
}
.det-tab {
  padding: 8px 12px; border: none; background: transparent;
  font-family: inherit; font-size: 11px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s, border-color .12s;
}
.det-tab:hover { color: var(--text); }
.det-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

.det-pane { display: none; flex-direction: column; overflow-y: auto; flex: 1; min-height: 0; }
.det-pane.active { display: flex; }

.vm-info-section { padding: 14px; border-right: 1px solid var(--border); background: var(--card); overflow-y: auto; }
.vm-distro-header { margin-bottom: 14px; }
.vm-distro-badge { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.vm-distro-text  { display: flex; flex-direction: column; gap: 2px; }
.vm-distro-name  { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }
.vm-distro-id    { font-size: 11px; color: var(--muted); }
.vm-info-title { font-size: 11px; font-weight: 700;  letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; }
.vm-info-row { display: flex; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--bg); align-items: baseline; }
.vm-info-row:last-child { border-bottom: none; }
.vm-info-key { font-size: 11px; color: var(--muted); width: 68px; flex-shrink: 0; }
.vm-info-val { font-size: 11px; color: var(--text); font-weight: 500; word-break: break-all; }
.vm-info-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }

.vm-db-badge { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.vm-db-badge-num { font-size: 24px; font-weight: 800; color: var(--primary); line-height: 1; }
.vm-db-badge-lbl { font-size: 11px; color: var(--muted);  letter-spacing: .04em; }

.vm-errors { margin-top: 8px; font-size: 11px; color: var(--danger); background: var(--danger-bg); border: 1px solid #fecaca; border-radius: var(--radius); padding: 5px 8px; }


.pct-ok     { color: var(--ok); }
.pct-warn   { color: var(--warn); }
.pct-danger { color: var(--danger); }
.pct-none   { color: var(--muted); }

/* Sparkline (SVG) */
.chart-wrap { height: 48px; width: 100%; margin: 3px 0; overflow: hidden; }

/* Disk tab */
.disk-tab-body { padding: 14px; background: var(--bg); flex: 1; overflow-y: auto; }
.disk-view-toggle { display: flex; gap: 4px; margin-bottom: 12px; }
.disk-view-btn {
  display: flex; align-items: center; gap: 5px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); font-size: 11px; font-weight: 500;
  color: var(--muted); cursor: pointer; transition: all .12s; font-family: inherit;
}
.disk-view-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.df-cards-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px;
}
.df-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px 10px;
}
.df-card-mount { font-size: 14px; font-weight: 700; color: var(--text); }
.df-card-fs    { font-size: 11px; color: var(--muted); font-family: monospace; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.df-card-stats { display: flex; justify-content: space-between; margin-top: 4px; }
.df-card-stat  { display: flex; flex-direction: column; gap: 1px; }
.df-card-stat-val { font-size: 12px; font-weight: 600; color: var(--text); }
.df-card-stat-lbl { font-size: 10px; color: var(--muted); }
.disk-tab-title { font-size: 11px; font-weight: 700;  letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
.df-table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.df-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.df-table th {
  background: var(--bg); padding: 6px 10px; text-align: left;
  font-weight: 700; color: var(--muted); font-size: 11px;
   letter-spacing: .04em; border-bottom: 1px solid var(--border);
}
.df-table td { padding: 6px 10px; border-top: 1px solid var(--border); color: var(--text); }
.df-table tr:first-child td { border-top: none; }
.df-table tbody tr:hover td { background: var(--bg); }
.df-use-bar { display: flex; align-items: center; gap: 6px; min-width: 80px; }
.df-bar { flex: 1; height: 3px; background: var(--border); border-radius: 1px; }
.df-bar-fill { height: 100%; border-radius: 1px; }

/* DB explorer */
.db-explorer { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); flex: 1; }
.db-explorer-header { font-size: 11px; font-weight: 700;  letter-spacing: .06em; color: var(--muted); margin-bottom: 2px; }
.db-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.db-item-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; transition: background .1s; user-select: none;
}
.db-item-header:hover { background: var(--bg); }
.db-item-icon { flex-shrink: 0; }
.db-item-name { flex: 1; font-size: 11px; font-weight: 600; font-family: monospace; color: var(--text); }
.db-item-size {
  font-size: 11px; color: var(--muted); background: var(--bg);
  border: 1px solid var(--border); padding: 1px 6px; border-radius: 3px;
}
.db-item-chevron { font-size: 8px; color: var(--muted); transition: transform .15s; }
.db-item.open .db-item-chevron { transform: rotate(90deg); }
.db-tables-wrap { border-top: 1px solid var(--border); display: none; }
.db-item.open .db-tables-wrap { display: block; }
.db-tables-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.db-tables-table th {
  background: var(--bg); padding: 5px 10px; text-align: left;
  font-size: 11px; font-weight: 700;  letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border);
}
.db-tables-table td { padding: 5px 10px; border-top: 1px solid var(--border); color: var(--text); }
.db-tables-table td:first-child { font-family: monospace; }
.db-tables-table tr:first-child td { border-top: none; }
.db-tables-table tbody tr:hover td { background: var(--bg); }
.db-tbl-num  { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.db-tbl-size { color: var(--muted); text-align: right; font-family: monospace; font-size: 11px; }

/* ── Toast notifications ─────────────────────────────────────────────── */
.toast-msg {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  padding: 10px 16px; border-radius: 8px; font-size: 13px;
  max-width: 360px; box-shadow: var(--shadow-md); font-family: inherit;
}
.toast-ok    { background: var(--ok-bg);     color: var(--ok);     border: 1px solid var(--ok-border); }
.toast-error { background: var(--danger-bg); color: var(--danger); border: 1px solid #fecaca; }

/* ── Theme toggle ────────────────────────────────────────────────────── */
.theme-toggle-btn {
  width: 30px; height: 30px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--card);
  color: var(--muted); cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.theme-toggle-btn:hover { background: var(--bg); color: var(--text); border-color: var(--border-strong); }

/* ── DB toolbar ──────────────────────────────────────────────────────── */
.db-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: var(--card);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.db-toolbar-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }

/* ── Users settings ──────────────────────────────────────────────────── */
.st-role-admin { color: var(--primary); font-weight: 600; }

/* ── Utility ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.flex-gap { display: flex; gap: 8px; align-items: center; }
