/* EVYNUM Command Center — Lanofa Design System */
:root {
  --bg: #030508;
  --foreground: #f8fafc;
  --card-from: rgb(18 26 38 / 0.95);
  --card-to: rgb(12 17 26 / 0.98);
  --border: rgb(255 255 255 / 0.08);
  --border-strong: rgb(255 255 255 / 0.1);
  --cyan: #22d3ee;
  --cyan-300: #67e8f9;
  --cyan-glow: rgb(34 211 238 / 0.2);
  --violet: #8b5cf6;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --red-400: #f87171;
  --red-500: #ef4444;
  --sidebar-w: 256px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; scrollbar-gutter: stable; font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
* { scrollbar-width: thin; scrollbar-color: rgb(51 65 85 / 0.85) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: rgb(51 65 85 / 0.55); border-radius: 9999px; border: 2px solid transparent; background-clip: padding-box; }

/* Premium background */
.premium-bg {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.premium-bg .orb-cyan {
  position: absolute;
  left: 25%;
  top: 25%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgb(34 211 238 / 0.08);
  filter: blur(120px);
  animation: authFloat 8s ease-in-out infinite;
}
.premium-bg .orb-violet {
  position: absolute;
  bottom: 25%;
  right: 25%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgb(139 92 246 / 0.08);
  filter: blur(100px);
}
.premium-bg .grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background-image:
    linear-gradient(rgb(255 255 255 / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
}
.premium-bg .landing-mesh {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59,130,246,0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(6,182,212,0.1), transparent),
    radial-gradient(ellipse 50% 30% at 0% 50%, rgba(139,92,246,0.08), transparent);
}

@keyframes authFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Layout */
.app { position: relative; z-index: 1; display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.content { flex: 1; padding: 1rem 1.25rem; }

/* Sidebar */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-strong);
  background: rgb(3 5 8 / 0.9);
  backdrop-filter: blur(24px);
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 64px;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-strong);
  flex-shrink: 0;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 8px 24px rgb(34 211 238 / 0.2);
  flex-shrink: 0;
  overflow: hidden;
}
.brand-mark svg { width: 20px; height: 20px; color: white; }
.brand-letter {
  font-size: 4.25rem;
  font-weight: 400;
  line-height: 0.85;
  color: white;
  font-family: var(--font);
  user-select: none;
  letter-spacing: -0.04em;
  transform: translate(-2px, -5px);
}
.sidebar-brand-text strong { display: block; font-size: 0.875rem; font-weight: 700; color: white; }
.sidebar-brand-text span { display: block; font-size: 0.75rem; color: var(--slate-500); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 1rem 0.5rem 1rem 1rem; }
.nav-group { margin-bottom: 0.25rem; }
.nav-label {
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  margin-bottom: 2px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--slate-400);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover { background: rgb(255 255 255 / 0.05); color: white; }
.nav-item.active {
  background: rgb(34 211 238 / 0.1);
  color: var(--cyan-300);
  box-shadow: 0 0 0 1px rgb(34 211 238 / 0.2);
}
.nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.85; }
.nav-item .sys-nav-icon {
  width: auto;
  min-width: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 1;
}
.nav-item-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  flex-shrink: 0;
}
.hub-api-tag {
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--cyan-300);
  background: rgb(34 211 238 / 0.1);
  border: 1px solid rgb(34 211 238 / 0.35);
}
.nav-item .badge {
  margin-left: auto;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: rgb(239 68 68 / 0.2);
  color: var(--red-400);
  font-size: 0.7rem;
  font-weight: 600;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: var(--emerald-400); box-shadow: 0 0 8px rgb(52 211 153 / 0.5); }
.status-dot.warn { background: var(--amber-400); }
.status-dot.offline { background: var(--red-400); }
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-strong);
  font-size: 0.75rem;
  color: var(--slate-500);
}
.user-card {
  margin-bottom: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: linear-gradient(165deg, var(--card-from), var(--card-to));
  border: 1px solid var(--border);
}
.user-card strong { display: block; font-size: 0.875rem; color: white; }
.user-card span { font-size: 0.75rem; color: var(--slate-400); }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--red-400);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-logout:hover { background: rgb(239 68 68 / 0.1); }

/* Mobile menu */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgb(3 5 8 / 0.9);
  backdrop-filter: blur(24px);
  color: white;
  cursor: pointer;
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
}
@media (max-width: 1023px) {
  .main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .menu-toggle { display: flex; }
}

/* Page header */
.page-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgb(30 41 59 / 0.8);
}
.page-top h1 { font-size: 1.125rem; font-weight: 700; color: white; }
.page-top .greeting { font-size: 0.75rem; color: rgb(52 211 153 / 0.9); }
.page-top .sync-time { font-size: 0.625rem; color: var(--slate-500); }
.page-top-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* Cards */
.card {
  background: linear-gradient(165deg, var(--card-from) 0%, var(--card-to) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.45), 0 0 0 1px rgb(255 255 255 / 0.04) inset;
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-grid-wide { margin-top: 0; }
@media (min-width: 1280px) { .stat-grid-wide { grid-template-columns: repeat(4, 1fr); } }
.overview-detail-grid { margin-top: 0.75rem; align-items: start; }
.muted-inline { color: var(--slate-500); font-size: 0.75rem; font-weight: 400; }
.stat-card {
  position: relative;
  min-height: 7.25rem;
  padding: 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--slate-600); }
.stat-card .accent-bar {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 2px;
}
.stat-card .accent-bar.emerald { background: var(--emerald-500); }
.stat-card .accent-bar.amber { background: var(--amber-500); }
.stat-card .accent-bar.red { background: var(--red-500); }
.stat-card .accent-bar.cyan { background: var(--cyan); }
.stat-card .accent-bar.violet { background: var(--violet); }
.stat-card .accent-bar.blue { background: #3b82f6; }
.stat-card .stat-label { font-size: 0.75rem; color: var(--slate-500); padding-left: 0.25rem; }
.stat-card .stat-value { margin-top: 0.25rem; font-size: 1.5rem; font-weight: 700; color: white; line-height: 1.2; padding-left: 0.25rem; }
.stat-card .stat-sub { margin-top: 0.125rem; height: 14px; font-size: 0.625rem; color: var(--slate-500); padding-left: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card .stat-icon { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; opacity: 0.9; }
.stat-card .stat-icon.emerald { color: var(--emerald-400); }
.stat-card .stat-icon.amber { color: var(--amber-400); }
.stat-card .stat-icon.red { color: var(--red-400); }
.stat-card .stat-icon.cyan { color: var(--cyan); }
.stat-card .stat-icon.violet { color: #a78bfa; }

/* Panel shell */
.panel-grid { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
@media (min-width: 1024px) { .panel-grid { grid-template-columns: 1fr 1fr; } }
.panel-stack { display: flex; flex-direction: column; gap: 0.75rem; }
.panel-grid-3 { display: grid; gap: 0.75rem; margin-bottom: 0.75rem; }
@media (min-width: 1024px) { .panel-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.panel-shell {
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--slate-800);
}
.panel-head h2 { font-size: 0.875rem; font-weight: 600; color: white; }
.panel-head .panel-sub { font-size: 0.625rem; color: var(--slate-500); }
.panel-head .panel-meta { font-size: 0.625rem; color: var(--slate-500); }
.panel-body { padding: 0.75rem; flex: 1; }
.panel-body.flush { padding: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(to right, var(--cyan), #06b6d4);
  color: #020617;
  font-weight: 600;
  box-shadow: 0 8px 24px rgb(34 211 238 / 0.2);
}
.btn-primary:hover { background: linear-gradient(to right, #67e8f9, var(--cyan)); }
.btn-secondary {
  border: 1px solid var(--border-strong);
  background: rgb(255 255 255 / 0.05);
  color: var(--foreground);
}
.btn-secondary:hover { background: rgb(255 255 255 / 0.1); }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: rgb(255 255 255 / 0.05);
  color: var(--slate-400);
  cursor: pointer;
  transition: all var(--transition);
}
.btn-icon:hover { background: rgb(255 255 255 / 0.1); color: white; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-success { background: rgb(34 197 94 / 0.2); color: var(--emerald-400); }
.badge-warning { background: rgb(234 179 8 / 0.2); color: var(--amber-400); }
.badge-danger { background: rgb(239 68 68 / 0.2); color: var(--red-400); }
.badge-info { background: rgb(34 211 238 / 0.2); color: var(--cyan); }
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  padding: 0.125rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.status-pill.online { background: rgb(34 197 94 / 0.2); color: var(--emerald-400); }
.status-pill.warn { background: rgb(234 179 8 / 0.2); color: var(--amber-400); }
.status-pill.offline { background: rgb(239 68 68 / 0.2); color: var(--red-400); }

/* Alerts */
.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.375rem;
  border-radius: 8px;
  font-size: 0.75rem;
  border: 1px solid;
}
.alert-banner.amber { border-color: rgb(245 158 11 / 0.3); background: rgb(245 158 11 / 0.1); color: #fde68a; }
.alert-banner.red { border-color: rgb(239 68 68 / 0.3); background: rgb(239 68 68 / 0.1); color: #fecaca; }
.alert-list { display: flex; flex-direction: column; }
.alert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--slate-800);
  transition: background var(--transition);
}
.alert-item:last-child { border-bottom: none; }
.alert-item:hover { background: rgb(30 41 59 / 0.4); }
.alert-sev { font-size: 0.625rem; font-weight: 700; text-transform: uppercase; padding: 0.125rem 0.375rem; border-radius: 4px; flex-shrink: 0; }
.alert-sev.critical { background: rgb(239 68 68 / 0.2); color: var(--red-400); }
.alert-sev.warning { background: rgb(234 179 8 / 0.2); color: var(--amber-400); }
.alert-body { flex: 1; min-width: 0; }
.alert-body strong { display: block; font-size: 0.875rem; color: white; }
.alert-body span { display: block; font-size: 0.75rem; color: var(--slate-500); }
.alert-time { font-size: 0.625rem; color: var(--slate-500); flex-shrink: 0; }

/* System map */
.system-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.5rem; }
.system-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgb(30 41 59 / 0.8);
  background: rgb(15 23 42 / 0.5);
  cursor: pointer;
  transition: all var(--transition);
}
.system-chip:hover { border-color: var(--slate-600); background: rgb(30 41 59 / 0.4); }
.system-chip .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.system-chip .dot.online { background: var(--emerald-400); }
.system-chip .dot.warn { background: var(--amber-400); }
.system-chip .dot.offline { background: var(--red-400); }
.system-chip .name { font-size: 0.8125rem; font-weight: 500; color: white; }
.system-chip .meta { font-size: 0.625rem; color: var(--slate-500); }

/* Charts */
.chart-wrap { position: relative; height: 140px; }
.chart-wrap.tall { height: 200px; }
.chart-wrap.xl { height: 240px; }
.chart-wrap canvas { display: block; width: 100% !important; height: 100% !important; }

/* Performance tab */
.perf-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}
.perf-range-group { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.perf-range-btn {
  border: 1px solid var(--slate-700);
  background: rgb(15 23 42 / 0.6);
  color: var(--slate-400);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.perf-range-btn:hover { border-color: var(--slate-500); color: white; }
.perf-range-btn.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgb(34 211 238 / 0.08);
}
.perf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.perf-kpi {
  border: 1px solid var(--slate-800);
  background: linear-gradient(180deg, rgb(15 23 42 / 0.85), rgb(15 23 42 / 0.45));
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  min-height: 72px;
}
.perf-kpi-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  margin: 0;
}
.perf-kpi-value {
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}
.perf-kpi-sub {
  margin: 0.15rem 0 0;
  font-size: 0.625rem;
  color: var(--slate-500);
}
.perf-kpi.tone-cyan .perf-kpi-value { color: var(--cyan); }
.perf-kpi.tone-violet .perf-kpi-value { color: #a78bfa; }
.perf-kpi.tone-blue .perf-kpi-value { color: #60a5fa; }
.perf-kpi.tone-amber .perf-kpi-value { color: var(--amber-400); }
.perf-kpi.tone-red .perf-kpi-value { color: var(--red-400); }
.perf-kpi.tone-emerald .perf-kpi-value { color: var(--emerald-400); }
.perf-live-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  background: rgb(34 211 238 / 0.08);
  border: 1px solid rgb(34 211 238 / 0.2);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
}
.perf-grid-3 { grid-template-columns: 1fr; }
@media (min-width: 900px) { .perf-grid-3 { grid-template-columns: repeat(3, 1fr); } }
.chart-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.68rem;
  color: var(--slate-400);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.chart-legend span::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.legend-cyan { color: var(--cyan); }
.legend-violet { color: #a78bfa; }
.perf-table-wrap { overflow-x: auto; }
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}
.perf-table th,
.perf-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgb(148 163 184 / 0.08);
  white-space: nowrap;
}
.perf-table th {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate-500);
  background: rgb(15 23 42 / 0.35);
}
.perf-table tbody tr:hover { background: rgb(148 163 184 / 0.04); }

/* Metric pills */
.metric-pill {
  border-radius: 8px;
  border: 1px solid var(--slate-800);
  background: rgb(15 23 42 / 0.5);
  padding: 0.5rem 0.75rem;
}
.metric-pill .lbl { font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-500); }
.metric-pill .val { font-size: 0.875rem; font-weight: 600; color: white; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
@media (min-width: 640px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }

/* Table */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.page-header h2 { font-size: 1.125rem; font-weight: 700; color: white; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; direction: ltr; }
.data-table th, .data-table td { text-align: left; padding: 0.625rem 0.75rem; font-size: 0.8125rem; border-bottom: 1px solid var(--slate-800); }
.data-table th { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--slate-500); background: rgb(15 23 42 / 0.4); }
.data-table tbody tr { cursor: pointer; transition: background var(--transition); }
.data-table tbody tr:hover { background: rgb(30 41 59 / 0.4); }
.sys-cell { display: flex; align-items: center; gap: 0.625rem; }
.sys-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; flex-shrink: 0;
}
.mono { font-family: var(--mono); font-size: 0.8125rem; }
.mini-bar { height: 4px; background: var(--slate-800); border-radius: 2px; margin-top: 2px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 2px; }
.mini-bar span.low { background: var(--emerald-400); }
.mini-bar span.mid { background: var(--amber-400); }
.mini-bar span.high { background: var(--red-400); }
.bar-cell { min-width: 80px; }

/* Drawer */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(0 0 0 / 0.6); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 101;
  width: min(420px, 100vw);
  background: linear-gradient(165deg, var(--card-from), var(--card-to));
  border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform var(--transition);
  display: flex; flex-direction: column;
}
.drawer-overlay.open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--slate-800);
}
.drawer-head strong { font-size: 0.9375rem; color: white; }
.drawer-close { background: none; border: none; color: var(--slate-400); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; margin-bottom: 1.25rem; }
.detail-stat { padding: 0.75rem; border-radius: 8px; border: 1px solid var(--slate-800); background: rgb(15 23 42 / 0.5); }
.detail-stat .lbl { font-size: 0.625rem; color: var(--slate-500); text-transform: uppercase; }
.detail-stat .val { font-size: 1.125rem; font-weight: 700; color: white; margin-top: 0.125rem; }
.health-list { display: flex; flex-direction: column; gap: 0.375rem; }
.health-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-radius: 8px; border: 1px solid var(--slate-800); font-size: 0.8125rem; }

/* Placeholder */
.placeholder { text-align: center; padding: 3rem 1.5rem; }
.placeholder .icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.4; }
.placeholder h2 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.placeholder p { color: var(--slate-500); font-size: 0.875rem; max-width: 400px; margin: 0 auto; }

/* Views */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.15s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

/* Footer */
.app-footer {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  border-top: 1px solid var(--border-strong);
  background: rgb(3 5 8 / 0.8);
  backdrop-filter: blur(24px);
}
.footer-legal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.25rem; padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border-strong);
  font-size: 0.6875rem;
}
.footer-legal a { color: var(--slate-400); text-decoration: none; transition: color var(--transition); }
.footer-legal a:hover { color: var(--cyan-300); }
.footer-legal .sep { color: var(--slate-700); padding: 0 0.25rem; }
.footer-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 1rem; padding: 0.75rem 1rem 0.75rem 1.5rem;
}
.footer-brand { display: flex; align-items: center; gap: 0.625rem; }
.footer-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; overflow: hidden; }
.footer-brand .brand-letter { font-size: 2.75rem; font-weight: 400; line-height: 0.85; transform: translate(-1px, -3px); }
.footer-brand-text strong { font-size: 0.875rem; font-weight: 700; color: white; }
.footer-brand-text span { font-size: 0.875rem; color: var(--slate-500); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.75rem; color: var(--slate-500); }
.footer-host {
  padding: 0.125rem 0.5rem; border-radius: 6px;
  border: 1px solid var(--border-strong); background: rgb(255 255 255 / 0.05);
  font-family: var(--mono); font-size: 0.6875rem; color: var(--slate-400);
}

/* Quick links */
.quick-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.375rem; padding: 0.5rem; }
.quick-link {
  display: flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem; border-radius: 8px;
  border: 1px solid rgb(30 41 59 / 0.8);
  font-size: 0.75rem; color: var(--slate-400);
  text-decoration: none; transition: all var(--transition);
}
.quick-link:hover { border-color: var(--slate-600); background: rgb(30 41 59 / 0.4); color: white; }
.quick-link svg { width: 14px; height: 14px; flex-shrink: 0; }

/* List rows */
.list-rows { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--slate-800);
  transition: background var(--transition); cursor: pointer;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: rgb(30 41 59 / 0.4); }
.list-row .row-title { font-size: 0.875rem; font-weight: 500; color: white; }
.list-row .row-sub { font-size: 0.625rem; color: var(--slate-500); margin-top: 0.125rem; }

/* System detail & forms */
.form-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .form-grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 0.375rem; }
.form-group label { font-size: 0.8125rem; font-weight: 500; color: #cbd5e1; }
.form-group .hint { font-size: 0.6875rem; color: var(--slate-500); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.625rem 0.875rem; border-radius: 12px;
  border: 1px solid rgb(255 255 255 / 0.1); background: #0b1018;
  color: white; font: inherit; font-size: 0.875rem;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: rgb(34 211 238 / 0.4); box-shadow: 0 0 0 2px rgb(34 211 238 / 0.15);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.tab-bar { display: flex; gap: 0.25rem; margin-bottom: 1rem; border-bottom: 1px solid var(--slate-800); }
.tab-btn {
  padding: 0.5rem 0.875rem; border: none; background: transparent; color: var(--slate-400);
  font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--cyan-300); border-bottom-color: var(--cyan); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.system-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.system-header-main { display: flex; align-items: center; gap: 0.875rem; }
.system-header .sys-icon { width: 48px; height: 48px; font-size: 1rem; }
.sys-logo-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.toast { padding: 0.625rem 0.875rem; border-radius: 8px; font-size: 0.8125rem; margin-bottom: 0.75rem; }
.toast.ok { background: rgb(16 185 129 / 0.15); color: #6ee7b7; border: 1px solid rgb(16 185 129 / 0.3); }
.toast.err { background: rgb(239 68 68 / 0.15); color: #fca5a5; border: 1px solid rgb(239 68 68 / 0.3); }

/* HUB-linked system overview */
.hub-overview-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
@media (min-width: 1024px) {
  .hub-overview-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}
.hub-panel .panel-sub { font-size: 0.75rem; color: var(--slate-500); margin-top: 0.125rem; }
.hub-hint { font-size: 0.75rem; color: var(--slate-500); margin: 0.5rem 0; }
.hub-quota { margin-bottom: 0.75rem; }
.hub-quota-head {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.75rem; color: var(--slate-400); margin-bottom: 0.375rem;
}
.hub-quota-track {
  height: 6px; border-radius: 9999px; background: rgb(255 255 255 / 0.06); overflow: hidden;
}
.hub-quota-fill {
  height: 100%; border-radius: inherit; transition: width 0.3s ease;
}
.hub-quota-fill.ok { background: linear-gradient(90deg, #10b981, #34d399); }
.hub-quota-fill.warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.hub-quota-fill.danger { background: linear-gradient(90deg, #ef4444, #f87171); }
.hub-dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.375rem 1rem;
  margin-top: 0.75rem; font-size: 0.8125rem;
}
.hub-dl dt { color: var(--slate-500); }
.hub-dl dd { color: #e2e8f0; margin: 0; }
.hub-table-wrap { overflow-x: auto; }
.hub-svc-table {
  width: 100%; border-collapse: collapse; font-size: 0.8125rem;
}
.hub-svc-table thead th {
  text-align: left; padding: 0.625rem 1rem; font-size: 0.6875rem;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate-500);
  border-bottom: 1px solid var(--border);
}
.hub-svc-table tbody td {
  padding: 0.75rem 1rem; border-bottom: 1px solid rgb(255 255 255 / 0.04); vertical-align: middle;
}
.hub-svc-table tbody tr:last-child td { border-bottom: none; }
.hub-svc-name { margin-bottom: 0.25rem; }
.hub-svc-role { font-weight: 600; color: white; text-transform: capitalize; }
.hub-svc-container {
  display: block; font-family: var(--mono); font-size: 0.6875rem;
  color: var(--slate-500); word-break: break-all;
}
.hub-svc-metric { font-size: 0.75rem; color: var(--slate-400); white-space: nowrap; }
.hub-status-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.625rem; border-radius: 9999px; font-size: 0.6875rem;
  font-weight: 600; letter-spacing: 0.04em;
}
.hub-status-badge.running {
  color: #34d399; background: rgb(16 185 129 / 0.12); border: 1px solid rgb(16 185 129 / 0.35);
}
.hub-status-badge.stopped {
  color: #f87171; background: rgb(239 68 68 / 0.12); border: 1px solid rgb(239 68 68 / 0.35);
}
.hub-status-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.hub-table-empty {
  padding: 1.25rem; text-align: center; color: var(--slate-500); font-size: 0.8125rem;
}
.hub-services-panel .panel-body.flush { padding: 0; }
