/* ============================================================================
   Control Center — design system (v2 "malade")
   Dark command-center. One vivid accent (electric cyan). Semantic status colors.
   Vanilla, no framework. All untrusted text is set via textContent in JS.
   ========================================================================== */

/* ---- Tokens --------------------------------------------------------------- */
:root,
[data-theme="dark"] {
  --bg:            #0b0d10;
  --bg-deep:       #07080a;
  --surface:       #11141a;
  --surface-2:     #161a22;
  --surface-3:     #1c212b;
  --glass:         rgba(22, 26, 34, 0.72);
  --hairline:      rgba(255, 255, 255, 0.08);
  --hairline-2:    rgba(255, 255, 255, 0.14);

  --text:          #e7ecf3;
  --text-dim:      #9aa6b6;
  --text-faint:    #5f6b7c;

  --accent:        #2ee6c8;   /* electric cyan/green */
  --accent-2:      #19c4ff;
  --accent-ink:    #04211d;
  --accent-soft:   rgba(46, 230, 200, 0.14);

  --running:       #34d399;   /* emerald */
  --stopped:       #64748b;   /* slate */
  --crashed:       #f43f5e;   /* red */
  --backoff:       #f59e0b;   /* amber */
  --unhealthy:     #fb923c;   /* orange */
  --starting:      #38bdf8;
  --info:          #38bdf8;
  --warning:       #f59e0b;
  --critical:      #f43f5e;

  --radius:        14px;
  --radius-sm:     9px;
  --radius-lg:     20px;
  --shadow:        0 10px 30px -12px rgba(0,0,0,0.7), 0 2px 8px -2px rgba(0,0,0,0.5);
  --shadow-lg:     0 24px 60px -20px rgba(0,0,0,0.8);

  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --sidebar-w: 240px;
  --topbar-h: 60px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg:            #f4f6fa;
  --bg-deep:       #e9edf3;
  --surface:       #ffffff;
  --surface-2:     #f7f9fc;
  --surface-3:     #eef2f7;
  --glass:         rgba(255, 255, 255, 0.78);
  --hairline:      rgba(15, 23, 42, 0.10);
  --hairline-2:    rgba(15, 23, 42, 0.18);
  --text:          #0d1320;
  --text-dim:      #51607a;
  --text-faint:    #8493a8;
  --accent:        #0bb89c;
  --accent-2:      #0a8fd0;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(11, 184, 156, 0.14);
  --shadow:        0 10px 30px -16px rgba(15,23,42,0.25), 0 2px 6px -2px rgba(15,23,42,0.12);
  --shadow-lg:     0 24px 60px -24px rgba(15,23,42,0.3);
}

/* ---- Reset ---------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(25,196,255,0.06), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(46,230,200,0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
h1,h2,h3,h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
a { color: var(--accent-2); text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent-soft); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
*::-webkit-scrollbar-thumb:hover { background: var(--hairline-2); }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Boot splash ---------------------------------------------------------- */
.boot-splash {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
}
.boot-logo {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-weight: 700; letter-spacing: 0.18em;
  font-size: 15px; color: var(--text-dim);
}
.boot-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: pulse 1.4s var(--ease) infinite;
}
.boot-bar {
  width: 220px; height: 3px; border-radius: 3px;
  background: var(--surface-3); overflow: hidden;
}
.boot-bar i {
  display: block; width: 40%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.2s var(--ease) infinite;
}
@keyframes slide { 0% { transform: translateX(-120%);} 100% { transform: translateX(360%);} }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity: 0.45; transform: scale(0.82);} }

/* ============================================================================
   LOGIN
   ========================================================================== */
.login-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px;
  animation: rise 0.4s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }
.login-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 6px;
}
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 22px -4px var(--accent);
  position: relative; flex: none;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 9px; border-radius: 4px;
  background: var(--bg-deep);
}
.login-brand h1 { font-size: 19px; }
.login-sub { color: var(--text-dim); margin: 4px 0 24px; font-size: 13px; }
.login-error {
  margin-top: 14px; color: var(--critical); font-size: 13px;
  background: rgba(244,63,94,0.1); border: 1px solid rgba(244,63,94,0.25);
  padding: 9px 12px; border-radius: var(--radius-sm);
}

/* ============================================================================
   APP SHELL
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "sidebar topbar" "sidebar main";
  height: 100vh; height: 100dvh;
}

/* ---- Topbar --------------------------------------------------------------- */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--hairline);
  background: var(--glass);
  backdrop-filter: blur(14px);
  position: relative; z-index: 30;
}
.topbar .spacer { flex: 1; }
.topbar-burger {
  display: none;
  background: none; border: 0; color: var(--text); cursor: pointer;
  width: 38px; height: 38px; border-radius: 9px;
}
.topbar-burger:hover { background: var(--surface-2); }

.health-summary {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--hairline);
  font-size: 12.5px; cursor: default;
}
.health-summary .seg { display: flex; align-items: center; gap: 5px; }
.health-summary .seg b { font-variant-numeric: tabular-nums; }
.health-summary .sep { width: 1px; height: 14px; background: var(--hairline-2); }

.conn-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--hairline);
}
.conn-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.conn-pill.ok   { color: var(--running); background: rgba(52,211,153,0.1); }
.conn-pill.ok .dot { background: var(--running); box-shadow: 0 0 8px var(--running); animation: pulse 2s infinite; }
.conn-pill.down { color: var(--crashed); background: rgba(244,63,94,0.1); }
.conn-pill.down .dot { background: var(--crashed); }
.conn-pill.wait { color: var(--backoff); background: rgba(245,158,11,0.1); }
.conn-pill.wait .dot { background: var(--backoff); animation: pulse 1s infinite; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-dim);
  cursor: pointer; transition: all 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--hairline); }
.icon-btn svg { width: 19px; height: 19px; }

.palette-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--hairline);
  color: var(--text-dim); font-size: 12.5px;
}
.palette-btn:hover { border-color: var(--hairline-2); color: var(--text); }
.palette-btn kbd {
  font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-3); border: 1px solid var(--hairline); color: var(--text-dim);
}

.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 5px 10px 5px 6px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text);
}
.user-chip:hover { border-color: var(--hairline-2); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
}
.user-chip .uname { font-size: 13px; font-weight: 600; }
.user-chip .urole { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 210px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
  animation: rise 0.15s var(--ease);
}
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 9px; background: none; border: 0;
  color: var(--text); cursor: pointer; font-size: 13px;
}
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop .menu-sep { height: 1px; background: var(--hairline); margin: 5px 4px; }
.menu-pop .who { padding: 8px 11px 4px; }
.menu-pop .who b { display: block; }
.menu-pop .who span { color: var(--text-faint); font-size: 12px; }

/* ---- Sidebar -------------------------------------------------------------- */
.sidebar {
  grid-area: sidebar;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--hairline);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  padding: 16px 12px; gap: 4px;
  z-index: 40;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px;
}
.sidebar-brand .name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sidebar-brand .ver { font-size: 10px; color: var(--text-faint); font-family: var(--mono); }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  background: none; border: 0; color: var(--text-dim); font-size: 13.5px; font-weight: 550;
  width: 100%; text-align: left; transition: all 0.15s var(--ease); position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft); color: var(--text);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}
.nav-item .nav-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: none; }
.nav-item .nav-icon svg { width: 18px; height: 18px; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; display: grid; place-items: center;
  background: var(--crashed); color: #fff;
}
.sidebar-foot { padding: 10px 8px 0; border-top: 1px solid var(--hairline); margin-top: 6px; }
.sidebar-foot .hint { font-size: 11px; color: var(--text-faint); }

/* ---- Main ----------------------------------------------------------------- */
.main {
  grid-area: main;
  overflow-y: auto; overflow-x: hidden;
  padding: 24px 28px 60px;
  position: relative;
}
.view-head {
  display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.view-head h1 { font-size: 22px; }
.view-head .sub { color: var(--text-dim); font-size: 13px; }
.view-head .spacer { flex: 1; }
.view-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint); margin: 28px 0 12px;
}
.view-section-title:first-child { margin-top: 0; }

/* offline banner */
.offline-banner {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  background: rgba(245,158,11,0.14); color: var(--backoff);
  border-bottom: 1px solid rgba(245,158,11,0.3);
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  position: sticky; top: 0; z-index: 25;
}
.offline-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--backoff); animation: pulse 1s infinite; }

/* ============================================================================
   CARDS / GRID
   ========================================================================== */
.grid { display: grid; gap: 16px; }
.grid.cols-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-stat { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.card {
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.card.hoverable:hover { transform: translateY(-2px); border-color: var(--hairline-2); box-shadow: var(--shadow-lg); }
.card.clickable { cursor: pointer; }
.card-pad { padding: 16px 18px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--hairline);
}
.card-head h3 { font-size: 14.5px; }
.card-head .spacer { flex: 1; }

.stat-card { padding: 16px 18px; }
.stat-card .label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 30px; font-weight: 700; font-family: var(--mono); margin-top: 6px; letter-spacing: -0.02em; }
.stat-card .value small { font-size: 14px; color: var(--text-faint); font-weight: 500; }
.stat-card .delta { font-size: 12px; margin-top: 4px; }

/* aggregate health banner */
.health-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--radius);
  border: 1px solid var(--hairline); background: var(--glass);
  position: relative; overflow: hidden;
}
.health-banner::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.health-banner.ok::before { background: var(--running); }
.health-banner.warn::before { background: var(--backoff); }
.health-banner.crit::before { background: var(--critical); }
.health-banner .hb-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.health-banner.ok .hb-icon { background: rgba(52,211,153,0.15); color: var(--running); }
.health-banner.warn .hb-icon { background: rgba(245,158,11,0.15); color: var(--backoff); }
.health-banner.crit .hb-icon { background: rgba(244,63,94,0.15); color: var(--critical); }
.health-banner .hb-text h2 { font-size: 17px; }
.health-banner .hb-text p { margin: 3px 0 0; color: var(--text-dim); font-size: 13px; }
.health-banner .hb-stats { margin-left: auto; display: flex; gap: 22px; }
.health-banner .hb-stat { text-align: center; }
.health-banner .hb-stat b { display: block; font-size: 22px; font-family: var(--mono); }
.health-banner .hb-stat span { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }

/* machine tile */
.machine-tile { padding: 0; overflow: hidden; }
.machine-tile .mt-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 10px; }
.machine-tile .mt-os {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center; background: var(--surface-3); color: var(--text-dim);
}
.machine-tile .mt-name { font-weight: 650; font-size: 14.5px; }
.machine-tile .mt-meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }
.machine-tile .mt-spark { height: 46px; padding: 0 6px; }
.machine-tile .mt-spark canvas { width: 100%; height: 100%; display: block; }
.machine-tile .mt-foot {
  display: flex; gap: 14px; padding: 10px 18px 15px; border-top: 1px solid var(--hairline);
  font-size: 12px;
}
.machine-tile .mt-foot .m { display: flex; flex-direction: column; gap: 1px; }
.machine-tile .mt-foot .m b { font-family: var(--mono); font-size: 13px; }
.machine-tile .mt-foot .m span { color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ============================================================================
   PILLS / BADGES / STATUS
   ========================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  white-space: nowrap; line-height: 1.4;
}
.pill .sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.pill.s-running   { color: var(--running);   background: rgba(52,211,153,0.13); }
.pill.s-running .sdot { background: var(--running); box-shadow: 0 0 7px var(--running); animation: pulse 2.4s infinite; }
.pill.s-starting  { color: var(--starting);  background: rgba(56,189,248,0.13); }
.pill.s-starting .sdot { background: var(--starting); animation: pulse 0.9s infinite; }
.pill.s-stopping  { color: var(--backoff);   background: rgba(245,158,11,0.12); }
.pill.s-stopping .sdot { background: var(--backoff); animation: pulse 0.9s infinite; }
.pill.s-stopped   { color: var(--stopped);   background: rgba(100,116,139,0.16); }
.pill.s-stopped .sdot { background: var(--stopped); }
.pill.s-crashed   { color: var(--crashed);   background: rgba(244,63,94,0.14); }
.pill.s-crashed .sdot { background: var(--crashed); }
.pill.s-backoff   { color: var(--backoff);   background: rgba(245,158,11,0.14); }
.pill.s-backoff .sdot { background: var(--backoff); animation: pulse 0.7s infinite; }
.pill.s-unhealthy { color: var(--unhealthy); background: rgba(251,146,60,0.14); }
.pill.s-unhealthy .sdot { background: var(--unhealthy); animation: pulse 1.4s infinite; }
.pill.s-online    { color: var(--running);   background: rgba(52,211,153,0.13); }
.pill.s-online .sdot { background: var(--running); box-shadow: 0 0 7px var(--running); }
.pill.s-offline   { color: var(--stopped);   background: rgba(100,116,139,0.16); }
.pill.s-offline .sdot { background: var(--stopped); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 7px; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--hairline);
}
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.info { color: var(--info); background: rgba(56,189,248,0.12); border-color: transparent; }
.badge.warn { color: var(--warning); background: rgba(245,158,11,0.12); border-color: transparent; }
.badge.crit { color: var(--critical); background: rgba(244,63,94,0.12); border-color: transparent; }

.sev-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
.sev-info { background: var(--info); }
.sev-warning { background: var(--warning); }
.sev-critical { background: var(--critical); box-shadow: 0 0 7px var(--critical); }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; line-height: 1;
  border: 1px solid var(--hairline); background: var(--surface-2); color: var(--text);
  transition: all 0.15s var(--ease); white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--hairline-2); background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); border-color: transparent; font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 0 20px -6px var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { color: var(--crashed); border-color: rgba(244,63,94,0.3); background: rgba(244,63,94,0.08); }
.btn-danger:hover { background: rgba(244,63,94,0.16); border-color: rgba(244,63,94,0.5); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; border-radius: 7px; gap: 5px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }
.btn-group { display: inline-flex; gap: 6px; }

/* segmented control */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 10px; }
.segmented button {
  padding: 5px 11px; border-radius: 7px; border: 0; background: none; cursor: pointer;
  color: var(--text-dim); font-size: 12px; font-weight: 600; transition: all 0.12s var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); }

/* ============================================================================
   FORMS
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.field-hint { font-size: 11.5px; color: var(--text-faint); }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--hairline); color: var(--text);
  font-size: 13.5px; font-family: inherit; transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 80px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; }
.input.mono { font-family: var(--mono); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa6b6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.checkrow { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.checkrow input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }

/* ============================================================================
   TABLES
   ========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--hairline); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-faint); font-weight: 700;
  border-bottom: 1px solid var(--hairline); background: var(--surface-2);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: background 0.12s var(--ease); }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl td.mono, table.tbl td .mono { font-family: var(--mono); font-size: 12px; }
table.tbl td.right, table.tbl th.right { text-align: right; }
table.tbl td.num { font-variant-numeric: tabular-nums; }

/* group header for bots */
.group-block { margin-bottom: 22px; }
.group-head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 0 2px;
}
.group-head h3 { font-size: 14px; }
.group-head .count { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.group-head .spacer { flex: 1; }

/* ============================================================================
   DRAWER (detail panels)
   ========================================================================== */
.scrim {
  position: fixed; inset: 0; background: rgba(2,4,8,0.55);
  backdrop-filter: blur(2px); z-index: 80; animation: fade 0.18s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
  width: min(720px, 96vw);
  background: var(--surface); border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideIn 0.24s var(--ease);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--hairline); flex: none;
}
.drawer-head h2 { font-size: 17px; }
.drawer-head .spacer { flex: 1; }
.drawer-sub { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
.drawer-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--hairline); flex: none; }
.drawer-tabs button {
  padding: 12px 12px; border: 0; background: none; cursor: pointer; color: var(--text-dim);
  font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.drawer-tabs button:hover { color: var(--text); }
.drawer-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }

/* ============================================================================
   MODALS
   ========================================================================== */
.modal-host { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(2,4,8,0.6); backdrop-filter: blur(3px); animation: fade 0.18s var(--ease); }
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: rise 0.2s var(--ease);
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--hairline); flex: none; }
.modal-head h2 { font-size: 17px; }
.modal-head .spacer { flex: 1; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--hairline); flex: none; }

/* ============================================================================
   TOASTS
   ========================================================================== */
.toast-host {
  position: fixed; bottom: 22px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 92vw);
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--hairline); border-left: 3px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 13px 15px;
  animation: toastIn 0.24s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(0.97); } to { opacity: 1; transform: none; } }
.toast.leaving { animation: toastOut 0.22s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.toast.info { border-left-color: var(--info); }
.toast.success { border-left-color: var(--running); }
.toast.warning, .toast.warn { border-left-color: var(--warning); }
.toast.error, .toast.critical { border-left-color: var(--critical); }
.toast .ti { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.info .ti { color: var(--info); }
.toast.success .ti { color: var(--running); }
.toast.warning .ti, .toast.warn .ti { color: var(--warning); }
.toast.error .ti, .toast.critical .ti { color: var(--critical); }
.toast .tbody { flex: 1; min-width: 0; }
.toast .ttitle { font-weight: 650; font-size: 13.5px; }
.toast .tmsg { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; word-break: break-word; }
.toast .tclose { background: none; border: 0; color: var(--text-faint); cursor: pointer; padding: 0; font-size: 15px; }
.toast .tclose:hover { color: var(--text); }

/* ============================================================================
   COMMAND PALETTE
   ========================================================================== */
.palette-host { position: fixed; inset: 0; z-index: 150; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette-scrim { position: absolute; inset: 0; background: rgba(2,4,8,0.55); backdrop-filter: blur(3px); }
.palette {
  position: relative; width: 100%; max-width: 580px; max-height: 64vh; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hairline-2); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: rise 0.16s var(--ease);
}
.palette-input {
  width: 100%; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--hairline);
  background: none; color: var(--text); font-size: 16px; outline: none;
}
.palette-list { overflow-y: auto; padding: 8px; }
.palette-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 10px; cursor: pointer;
}
.palette-item .pi-icon { width: 20px; height: 20px; display: grid; place-items: center; color: var(--text-dim); flex: none; }
.palette-item .pi-icon svg { width: 18px; height: 18px; }
.palette-item .pi-title { flex: 1; font-size: 14px; }
.palette-item .pi-kind { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.palette-item.active, .palette-item:hover { background: var(--accent-soft); }
.palette-item.active .pi-icon { color: var(--accent); }
.palette-empty { padding: 28px; text-align: center; color: var(--text-faint); font-size: 13px; }
.palette-foot { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--hairline); font-size: 11px; color: var(--text-faint); }
.palette-foot kbd { font-family: var(--mono); padding: 1px 5px; background: var(--surface-3); border-radius: 4px; border: 1px solid var(--hairline); }

/* ============================================================================
   LOG VIEWER / TERMINAL
   ========================================================================== */
.logv { display: flex; flex-direction: column; height: 100%; min-height: 320px; }
.logv-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--hairline); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2);
}
.logv-search {
  flex: 1; min-width: 140px; padding: 7px 11px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  font-size: 12.5px; font-family: var(--mono);
}
.logv-search:focus { border-color: var(--accent); outline: none; }
.logv-body {
  flex: 1; overflow: auto; min-height: 240px;
  background: var(--bg-deep); border: 1px solid var(--hairline); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55; padding: 10px 12px;
}
.logv-body.nowrap .log-line { white-space: pre; }
.logv-body .log-line { white-space: pre-wrap; word-break: break-word; display: flex; gap: 10px; }
.logv-body .log-line:hover { background: rgba(255,255,255,0.03); }
.logv-body .log-ts { color: var(--text-faint); flex: none; user-select: none; }
.logv-body .log-txt { flex: 1; min-width: 0; }
.logv-body .log-line.stderr .log-txt { color: #ffb4b4; }
.logv-body .hl { background: var(--backoff); color: #1a1205; border-radius: 2px; }
.logv-empty { color: var(--text-faint); padding: 18px; text-align: center; }
.logv-count { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); }

/* ANSI palette (escaped text + spans) */
.a-30,.a-90 { color: #5f6b7c; } .a-31 { color: #ff6b81; } .a-32 { color: #34d399; }
.a-33 { color: #f5c451; } .a-34 { color: #5aa9ff; } .a-35 { color: #c792ff; }
.a-36 { color: #2ee6c8; } .a-37 { color: #d6dde7; } .a-91 { color: #ff8a98; }
.a-92 { color: #6ee7b7; } .a-93 { color: #fde68a; } .a-94 { color: #93c5fd; }
.a-95 { color: #ddb0ff; } .a-96 { color: #7df0df; } .a-97 { color: #ffffff; }
.a-b { font-weight: 700; } .a-dim { opacity: 0.7; } .a-i { font-style: italic; } .a-u { text-decoration: underline; }

.term-host { background: var(--bg-deep); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 8px; height: 100%; }
.term-host .xterm { height: 100%; }

/* ============================================================================
   SKELETONS / EMPTY / ERROR
   ========================================================================== */
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-card { height: 140px; border-radius: var(--radius); }

.empty, .errorbox {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 56px 24px; text-align: center;
  border: 1px dashed var(--hairline); border-radius: var(--radius); color: var(--text-dim);
}
.empty .e-icon, .errorbox .e-icon { width: 44px; height: 44px; color: var(--text-faint); opacity: 0.7; }
.empty h3, .errorbox h3 { font-size: 15px; color: var(--text); }
.empty p, .errorbox p { font-size: 13px; margin: 0; max-width: 360px; }
.errorbox { border-color: rgba(244,63,94,0.3); color: var(--crashed); }
.errorbox .e-icon { color: var(--crashed); opacity: 1; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hairline-2); border-top-color: var(--accent); animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* feed / activity rows */
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--hairline); align-items: flex-start; }
.feed-row:last-child { border-bottom: 0; }
.feed-row .fr-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--accent); }
.feed-row.fail .fr-dot { background: var(--crashed); }
.feed-row.offline .fr-dot, .feed-row.forbidden .fr-dot { background: var(--backoff); }
.feed-row .fr-main { flex: 1; min-width: 0; }
.feed-row .fr-action { font-weight: 600; font-size: 13px; }
.feed-row .fr-meta { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.feed-row .fr-meta b { color: var(--text); font-weight: 600; }
.feed-row .fr-time { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); flex: none; white-space: nowrap; }

/* chart wrapper */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; display: block; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; }
.chart-legend .lg { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.chart-legend .lg i { width: 11px; height: 3px; border-radius: 2px; display: inline-block; }

/* misc */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.divider { height: 1px; background: var(--hairline); margin: 18px 0; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============================================================================
   TERMINAL VIEW
   ========================================================================== */
.term-card {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--topbar-h) - 130px); min-height: 420px;
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); overflow: hidden;
}
.term-toolbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-bottom: 1px solid var(--hairline); flex: none; flex-wrap: wrap;
}
.term-toolbar .select { width: auto; min-width: 150px; }
.term-tabs {
  display: flex; gap: 4px; padding: 8px 10px 0; flex: none;
  border-bottom: 1px solid var(--hairline); overflow-x: auto;
}
.term-tab {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px;
  font-size: 12.5px; color: var(--text-dim); cursor: pointer;
  border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; white-space: nowrap; user-select: none;
}
.term-tab:hover { color: var(--text); background: var(--surface-2); }
.term-tab.active {
  color: var(--text); background: var(--bg-deep);
  border-color: var(--hairline); margin-bottom: -1px;
}
.term-tab .tt-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--running); box-shadow: 0 0 6px var(--running); flex: none; }
.term-tab .tt-dot.dead { background: var(--stopped); box-shadow: none; }
.term-tab .tt-name { font-family: var(--mono); }
.term-tab .tt-close { background: none; border: 0; color: var(--text-faint); cursor: pointer; padding: 0 2px; font-size: 13px; line-height: 1; }
.term-tab .tt-close:hover { color: var(--crashed); }
.term-stack { position: relative; flex: 1; min-height: 0; background: var(--bg-deep); }
.term-stack .empty { position: absolute; inset: 0; }
.term-pane { position: absolute; inset: 0; padding: 8px; display: none; }
.term-pane.active { display: block; }
.term-pane .xterm { height: 100%; }

/* ============================================================================
   SETTINGS VIEW
   ========================================================================== */
.set-row {
  display: flex; gap: 18px; padding: 14px 0; align-items: flex-start;
  border-top: 1px solid var(--hairline); flex-wrap: wrap;
}
.set-row:first-of-type { border-top: 0; }
.set-label { flex: 1; min-width: 200px; }
.set-control { flex: none; }
.code-block {
  display: flex; align-items: center; gap: 10px; margin: 6px 0 4px;
  padding: 10px 12px; background: var(--bg-deep); border: 1px solid var(--hairline);
  border-radius: 8px; overflow-x: auto;
}
.code-block code { flex: 1; font-size: 12.5px; white-space: pre; color: var(--text); }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "topbar" "main";
  }
  .topbar-burger { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 260px;
    transform: translateX(-100%); transition: transform 0.24s var(--ease);
    z-index: 120; border-right: 1px solid var(--hairline);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(2,4,8,0.5); z-index: 110; }
  .main { padding: 18px 16px 80px; }
  .palette-btn .ptxt, .health-summary .seg-label { display: none; }
  .health-banner .hb-stats { width: 100%; margin-left: 0; justify-content: space-between; }
  .drawer { width: 100vw; }
  .user-chip .urole { display: none; }
}
@media (max-width: 560px) {
  .grid.cols-auto { grid-template-columns: 1fr; }
  .view-head h1 { font-size: 19px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .health-summary { display: none; }
  .toast-host { left: 12px; right: 12px; bottom: 12px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================================================================
   v3 — ENV EDITOR (masked secrets), LOGS view, DEPLOY log
   ========================================================================== */
.env-editor { display: flex; flex-direction: column; gap: 8px; }
.env-rows { display: flex; flex-direction: column; gap: 6px; }
.env-row { display: grid; grid-template-columns: minmax(120px, 0.9fr) minmax(140px, 1.4fr) auto; gap: 8px; align-items: center; }
.env-row .env-key { font-weight: 600; }
.env-empty { padding: 10px 2px; font-size: 13px; }
@media (max-width: 520px) { .env-row { grid-template-columns: 1fr 1fr auto; } }

/* Logs search view */
.logs-controls { margin-top: 16px; }
.logs-controls-grid { display: flex; flex-wrap: wrap; gap: 0 14px; align-items: flex-end; }
.logs-controls-grid .field { flex: 1 1 150px; min-width: 130px; }
.logs-results { margin-top: 16px; }
.logs-list { display: flex; flex-direction: column; }
.logs-row {
  display: flex; flex-direction: column; gap: 2px; padding: 8px 16px;
  border-bottom: 1px solid var(--hairline); cursor: pointer;
}
.logs-row:last-child { border-bottom: 0; }
.logs-row:hover { background: var(--surface-2); }
.logs-row.stderr .log-txt { color: #ffb4b4; }
.logs-row-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 11.5px; }
.logs-row-bot { font-weight: 700; color: var(--accent); }
.logs-row-bot:hover { text-decoration: underline; }
.logs-row-machine { font-family: var(--mono); }
.logs-row-ts { margin-left: auto; font-family: var(--mono); }
.logs-row-line { font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; }
.logs-row-line .hl { background: var(--backoff); color: #1a1205; border-radius: 2px; }

/* Deploy live-log drawer body */
.deploy-log {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--bg-deep); height: 100%; min-height: 360px; overflow-y: auto; padding: 14px 16px;
}
.deploy-log .log-line { white-space: pre-wrap; word-break: break-word; }
.deploy-log .log-line.stderr .log-txt { color: #ffb4b4; }

/* ============================================================================
 * v4 — Status page, incidents timeline, onboarding, backups
 * ========================================================================== */

/* --- per-machine status cards --- */
.status-card { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.status-card .sc-head { display: flex; align-items: center; gap: 12px; }
.status-card .sc-name { font-weight: 600; }
.status-card .sc-meta { font-size: 12px; color: var(--text-faint); }
.status-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--stopped, #5f6b7c);
}
.status-dot.online { background: var(--running); box-shadow: 0 0 10px var(--running); animation: pulse 2.4s infinite; }
.status-dot.offline { background: var(--crashed); }
.sc-uptime { display: flex; flex-direction: column; gap: 6px; }
.sc-uptime-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.uptime-bar {
  height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden;
}
.uptime-bar i { display: block; height: 100%; background: var(--running); border-radius: 6px; transition: width 0.4s ease; }
.uptime-bar i.good { background: var(--running); }
.uptime-bar i.warn { background: var(--warning); }
.uptime-bar i.bad  { background: var(--crashed); }

/* --- incident timeline --- */
.incident-group-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-faint); margin: 4px 0 10px;
}
.incident-group-title .igt-dot { width: 9px; height: 9px; border-radius: 50%; }
.incident-group-title .igt-dot.open { background: var(--crashed); box-shadow: 0 0 8px var(--crashed); }
.incident-group-title .igt-dot.resolved { background: var(--running); }
.incident-list { display: flex; flex-direction: column; gap: 10px; }
.inc-card {
  display: flex; align-items: stretch; gap: 0; overflow: hidden; padding: 0;
}
.inc-card.resolved { opacity: 0.72; }
.inc-card .inc-bar { width: 4px; flex: none; background: var(--warning); }
.inc-card .inc-bar.sev-minor { background: var(--warning); }
.inc-card .inc-bar.sev-major { background: var(--warning); }
.inc-card .inc-bar.sev-critical { background: var(--crashed); }
.inc-card.open { border-color: var(--hairline-2); }
.inc-main { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.inc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inc-title { font-weight: 600; }
.inc-detail { font-size: 13px; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; }
.inc-meta { font-size: 12px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 2px 4px; }
.inc-meta b { color: var(--text-dim); font-weight: 600; }
.inc-right { display: flex; align-items: center; padding: 0 12px; }

/* --- onboarding empty-state (overview, 0 machines) --- */
.onboarding { margin-top: 16px; }
.onboarding .gs-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.onboarding .gs-step { display: flex; align-items: flex-start; gap: 12px; }
.onboarding .gs-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent);
}
.onboarding .gs-title { font-weight: 600; font-size: 14px; }
.onboarding .gs-msg { font-size: 13px; color: var(--text-faint); }
