/* ============================================================================
   MIFTEH OS — Dashboard Design System
   Theme: Deep Navy + Gold (brand). Premium "mission control" console.
   Note: CSS variable names below (--surface, --border, --text, --dim, --muted,
   --green, --red, --yellow, --accent, --accent2, --accent-bg, --blue) are also
   referenced inline from js/app.js — keep them defined.
   ========================================================================== */

:root {
  /* Surfaces — deep navy stack */
  --bg:           #08152C;
  --bg-2:         #0B1D3A;   /* brand navy */
  --surface:      #0F2547;   /* raised card */
  --surface-2:    #143061;   /* hover / elevated */
  --surface-3:    #193A72;
  --border:       #1E3A63;
  --border-strong:#2B4D80;

  /* Text — cream + muted blues */
  --text:         #F2E9D8;   /* cream (primary) */
  --text-strong:  #FFFFFF;
  --muted:        #9FB3C8;
  --dim:          #6E86A6;

  /* Brand accent — gold */
  --accent:       #C88A32;   /* gold */
  --accent2:      #E3B25A;   /* light gold */
  --accent-deep:  #A76D1E;   /* gold hover/pressed */
  --accent-bg:    rgba(200,138,50,.14);
  --accent-glow:  rgba(200,138,50,.30);

  /* Status */
  --green:  #3FB57A;
  --green-bg: rgba(63,181,122,.14);
  --red:    #E0564B;
  --red-bg: rgba(224,86,75,.14);
  --yellow: #E8B54A;
  --yellow-bg: rgba(232,181,74,.14);
  --blue:   #5B9BFF;
  --blue-bg: rgba(91,155,255,.14);
  --violet: #B98BFF;

  /* Geometry */
  --radius:    14px;
  --radius-sm: 9px;
  --radius-xs: 6px;
  --gap:       18px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.30);
  --shadow:    0 8px 24px -8px rgba(0,0,0,.45);
  --shadow-lg: 0 24px 60px -18px rgba(0,0,0,.65);
  --ring:      0 0 0 3px var(--accent-glow);

  --sidebar-w: 280px;
  --font:  'Inter', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* , *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(200,138,50,.10), transparent 60%),
    radial-gradient(1000px 800px at -10% 110%, rgba(31,72,140,.22), transparent 55%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}

::selection { background: var(--accent-glow); color: #fff; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-2) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--surface-3); background-clip: padding-box; }

/* ── Layout shell ─────────────────────────────────────────────────────── */
.os-root { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(11,29,58,.92), rgba(8,21,44,.96));
  border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh;
  backdrop-filter: blur(8px);
}

.sidebar-header { padding: 22px 20px 16px; border-bottom: 1px solid var(--border); }
.brand {
  display: flex; align-items: center;
  font-size: 19px; font-weight: 800; letter-spacing: .04em; color: var(--text-strong);
}
.brand-accent { color: var(--accent2); }
.brand-icon { filter: drop-shadow(0 0 6px var(--accent-glow)); }
.brand-sub { font-size: 10.5px; color: var(--dim); margin-top: 4px; letter-spacing: .14em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim); padding: 18px 12px 8px;
}
.nav-btn {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm);
  color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
  position: relative; transition: background .15s, color .15s, transform .05s;
}
.nav-btn:hover { background: var(--surface); color: var(--text); }
.nav-btn:active { transform: translateY(1px); }
.nav-btn.active { background: var(--accent-bg); color: var(--text-strong); font-weight: 600; }
.nav-btn.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; filter: saturate(1.1); }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 20px;
  background: var(--surface-2); color: var(--muted); font-family: var(--mono);
}
.nav-badge.dim { background: transparent; color: var(--dim); }
.nav-badge.pulse { background: var(--accent); color: #1a1206; animation: badgePulse 2s infinite; }
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); } 50% { box-shadow: 0 0 0 5px transparent; } }

.sidebar-footer { padding: 14px 18px; border-top: 1px solid var(--border); }
.conn-row { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.conn-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.conn-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); animation: livePulse 2s infinite; }
.conn-dot.offline { background: var(--dim); }
.conn-label { color: var(--muted); font-weight: 500; }
.build-info { font-size: 10.5px; color: var(--dim); margin-top: 6px; font-family: var(--mono); word-break: break-all; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Topbar ───────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 28px;
  background: linear-gradient(180deg, rgba(11,29,58,.86), rgba(11,29,58,.62));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { min-width: 0; }
.page-title { font-size: 21px; font-weight: 800; color: var(--text-strong); letter-spacing: -.01em; }
.page-meta { font-size: 12px; color: var(--dim); margin-top: 2px; display: block; }
.topbar-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.budget-pill {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  padding: 6px 12px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.budget-pill.ok   { color: var(--green);  border-color: var(--green); }
.budget-pill.warn { color: var(--yellow); border-color: var(--yellow); }
.budget-pill.over  { color: var(--red);    border-color: var(--red); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
  transition: all .18s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--accent2); border-color: var(--border-strong); transform: rotate(90deg); }
.icon-btn:active { transform: rotate(180deg) scale(.94); }

.clock { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
.live-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--green);
  background: var(--green-bg); padding: 5px 10px; border-radius: 20px; border: 1px solid transparent;
}
.live-chip.offline { color: var(--dim); background: var(--surface); }

/* ── Content ──────────────────────────────────────────────────────────── */
.content { flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 26px 30px 80px; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section { margin-top: 30px; }
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--text);
  text-transform: uppercase; margin-bottom: 14px;
}
.section-title::before { content: ""; width: 4px; height: 15px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.section-count {
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent2);
  background: var(--accent-bg); padding: 1px 8px; border-radius: 20px; text-transform: none;
}

.card {
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.7));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* ── KPI grid ─────────────────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--gap); }
.kpi {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.55));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); opacity: .9; }
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi.accent::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.kpi.green::before  { background: var(--green); }
.kpi.yellow::before { background: var(--yellow); }
.kpi.blue::before   { background: var(--blue); }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.kpi-value { font-size: 32px; font-weight: 800; color: var(--text-strong); margin: 6px 0 2px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.accent .kpi-value { color: var(--accent2); }
.kpi.green .kpi-value  { color: var(--green); }
.kpi.yellow .kpi-value { color: var(--yellow); }
.kpi.blue .kpi-value   { color: var(--blue); }
.kpi-sub { font-size: 11.5px; color: var(--muted); }

/* ── Activity feed ────────────────────────────────────────────────────── */
.activity-feed { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-sm); }
.activity-item { display: flex; align-items: center; gap: 13px; padding: 11px 12px; border-radius: var(--radius-sm); transition: background .14s; }
.activity-item:hover { background: var(--surface-2); }
.activity-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.activity-icon.success { background: var(--green-bg); color: var(--green); }
.activity-icon.mock    { background: var(--accent-bg); color: var(--accent2); }
.activity-icon.fail    { background: var(--red-bg); color: var(--red); }
.activity-body { flex: 1; min-width: 0; }
.activity-agent { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-detail { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-meta { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.activity-time { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.activity-cost { font-size: 11px; color: var(--accent2); font-family: var(--mono); font-weight: 600; }
.activity-provider { font-size: 10px; color: var(--dim); text-transform: capitalize; }
.activity-provider.anthropic { color: var(--violet); }
.activity-provider.openai { color: var(--green); }
.activity-provider.mock { color: var(--dim); }

.project-tag {
  display: inline-block; font-size: 10.5px; font-weight: 600; font-family: var(--mono);
  padding: 1px 7px; border-radius: 5px; margin-right: 6px;
  background: var(--accent-bg); color: var(--accent2); vertical-align: middle;
}

/* ── Agents ───────────────────────────────────────────────────────────── */
.agent-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.filter-chip {
  font-size: 12px; font-weight: 500; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  text-transform: capitalize; transition: all .15s;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); }
.filter-chip.active { background: var(--accent); border-color: var(--accent); color: #1a1206; font-weight: 700; box-shadow: 0 4px 14px -4px var(--accent-glow); }

.agents-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: var(--gap); }
.agent-card {
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.6));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 9px; box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.agent-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.agent-card-header { display: flex; align-items: center; gap: 12px; }
.agent-avatar {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: radial-gradient(circle at 30% 25%, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border-strong);
}
.agent-name { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-division { font-size: 11px; font-weight: 600; text-transform: capitalize; margin-top: 1px; }
.agent-role { font-size: 12px; color: var(--muted); line-height: 1.5; }
.agent-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.agent-last-run { font-size: 11px; color: var(--dim); font-family: var(--mono); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.run-btn, .loop-btn, .mission-run {
  font-size: 12px; font-weight: 700; padding: 7px 14px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid var(--accent); color: var(--accent2);
  transition: all .15s; white-space: nowrap;
}
.run-btn:hover, .loop-btn:hover, .mission-run:hover { background: var(--accent); color: #1a1206; box-shadow: 0 4px 14px -4px var(--accent-glow); }
.run-btn:disabled, .loop-btn:disabled, .mission-run:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  font-size: 13px; font-weight: 700; padding: 10px 18px; border-radius: 9px; cursor: pointer; border: none;
  background: linear-gradient(180deg, var(--accent2), var(--accent)); color: #1a1206;
  box-shadow: 0 6px 18px -6px var(--accent-glow); transition: filter .15s, transform .05s;
}
.btn-primary:hover { filter: brightness(1.07); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost {
  font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: 9px; cursor: pointer;
  background: transparent; border: 1px solid var(--border-strong); color: var(--muted); transition: all .15s;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ── Tables (activity log, cost) ──────────────────────────────────────── */
.log-filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.log-search, .log-select, .field-input, .field-select, .field-textarea, .auto-hour-select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 9px; padding: 9px 13px; font-size: 13px; font-family: var(--font); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.log-search { flex: 1; min-width: 200px; }
.log-search:focus, .log-select:focus, .field-input:focus, .field-select:focus, .field-textarea:focus {
  border-color: var(--accent); box-shadow: var(--ring);
}
.log-search::placeholder, .field-input::placeholder, .field-textarea::placeholder { color: var(--dim); }

.log-table, .cost-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}
.log-table thead th {
  text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--dim); padding: 12px 16px; background: rgba(8,21,44,.5); border-bottom: 1px solid var(--border);
}
.log-table tbody td, .cost-table td { padding: 11px 16px; font-size: 12.5px; border-bottom: 1px solid var(--border); color: var(--text); }
.log-table tbody tr:last-child td, .cost-table tr:last-child td { border-bottom: none; }
.log-table tbody tr { transition: background .12s; }
.log-table tbody tr:hover { background: var(--surface-2); }
.cost-table td:last-child { text-align: right; font-family: var(--mono); color: var(--accent2); font-weight: 600; }

.status-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .04em; }
.status-badge.ok   { background: var(--green-bg); color: var(--green); }
.status-badge.fail { background: var(--red-bg); color: var(--red); }
.status-badge.mock { background: var(--accent-bg); color: var(--accent2); }

/* ── Missions ─────────────────────────────────────────────────────────── */
.mission-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--gap); }
.mission-card {
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.6));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.mission-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.mission-card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.mission-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.mission-project { font-size: 10.5px; font-weight: 600; font-family: var(--mono); color: var(--accent2); background: var(--accent-bg); padding: 2px 9px; border-radius: 20px; }
.mission-goal { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-bottom: 12px; }
.mission-agents { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.mission-agent-tag { font-size: 10.5px; font-weight: 500; padding: 3px 9px; border-radius: 6px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.mission-auto-row { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.auto-toggle-label { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text); }
.auto-toggle { position: absolute; opacity: 0; width: 0; height: 0; }   /* hide native checkbox; track is the visual */
.auto-toggle-track { width: 40px; height: 22px; border-radius: 20px; background: var(--surface-3); position: relative; transition: background .18s; flex-shrink: 0; }
.auto-toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: var(--shadow-sm); }
.auto-toggle:checked + .auto-toggle-track { background: var(--accent); }
.auto-toggle:checked + .auto-toggle-track::after { transform: translateX(18px); }
.auto-label-text { font-size: 12px; font-weight: 600; color: var(--text); }
.auto-meta { font-size: 11px; color: var(--dim); margin-left: auto; font-family: var(--mono); }
.mission-run { margin-left: auto; }

/* ── Providers / system ───────────────────────────────────────────────── */
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.provider-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.provider-header { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.provider-icon { font-size: 22px; }
.provider-name { font-size: 14px; font-weight: 700; color: var(--text); }
.provider-status { margin-left: auto; }
.health-bar { height: 7px; border-radius: 20px; background: var(--surface-3); overflow: hidden; margin-bottom: 13px; }
.health-bar-fill { height: 100%; border-radius: 20px; transition: width .5s ease; }
.health-bar-fill.green { background: linear-gradient(90deg, var(--green), #6fe0a6); }
.health-bar-fill.red { background: var(--red); }
.provider-stat { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.provider-stat-label { color: var(--dim); }
.provider-stat-value { color: var(--text); font-family: var(--mono); font-weight: 600; }

/* ── Scheduler loops ──────────────────────────────────────────────────── */
.loop-list { display: flex; flex-direction: column; gap: 9px; }
.loop-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); transition: border-color .15s, transform .1s;
}
.loop-item:hover { border-color: var(--border-strong); }
.loop-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.loop-status.active { background: var(--green); box-shadow: 0 0 8px var(--green); animation: livePulse 2s infinite; }
.loop-status.idle { background: var(--dim); }
.loop-body { flex: 1; min-width: 0; }
.loop-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.loop-meta { font-size: 11.5px; color: var(--dim); margin-top: 3px; }
.loop-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.loop-badge { font-size: 11px; font-family: var(--mono); color: var(--muted); }

/* ── Budget gauge ─────────────────────────────────────────────────────── */
.budget-gauge { height: 12px; border-radius: 20px; background: var(--surface-3); overflow: hidden; }
.budget-gauge-fill { height: 100%; border-radius: 20px; transition: width .6s ease; box-shadow: 0 0 12px rgba(0,0,0,.2) inset; }

/* ── Projects ─────────────────────────────────────────────────────────── */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--gap); }
.project-item {
  display: flex; gap: 13px; padding: 18px;
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.6));
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.project-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.project-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; background: var(--green); box-shadow: 0 0 8px var(--green); }
.project-dot.inactive { background: var(--dim); box-shadow: none; }
.project-body { flex: 1; min-width: 0; }
.project-name { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.project-domain { font-size: 12px; color: var(--accent2); font-family: var(--mono); margin-top: 2px; }
.project-type { display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 5px; margin-top: 8px; }
.project-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 9px; }
.project-staging { font-size: 11px; color: var(--yellow); margin-top: 8px; }

/* ── Project Access Grid ──────────────────────────────────────────────── */
.access-banner { display:flex; align-items:center; gap:8px; padding:10px 16px; border-radius:var(--radius); font-size:12.5px; margin-bottom:14px; }
.access-banner.ok { background:rgba(63,181,122,.1); border:1px solid rgba(63,181,122,.25); color:var(--green); }
.access-banner.error { background:rgba(239,83,80,.08); border:1px solid rgba(239,83,80,.2); color:var(--red); }
.access-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.access-dot.ok { background:var(--green); box-shadow:0 0 6px var(--green); }
.access-dot.error { background:var(--red); }
.access-warn { color:var(--yellow); margin-left:6px; font-weight:600; }

.project-access-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:var(--gap); }
.project-access-card {
  background:linear-gradient(180deg,var(--surface),rgba(15,37,71,.55));
  border:1px solid var(--border); border-radius:var(--radius);
  padding:0; overflow:hidden;
  transition:transform .18s,box-shadow .18s,border-color .18s;
}
.project-access-card:hover { transform:translateY(-3px); box-shadow:var(--shadow); border-color:var(--border-strong); }
.pac-header { padding:16px 18px 12px; }
.pac-name { font-size:15px; font-weight:700; color:var(--text-strong); margin-bottom:3px; }
.pac-domain { font-size:11.5px; font-family:var(--mono); color:var(--muted); margin-bottom:4px; }
.pac-type { display:inline-block; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); background:var(--surface-2); padding:2px 8px; border-radius:5px; }

.pac-status-row { display:grid; grid-template-columns:1fr 1fr 1fr 1fr; gap:0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.pac-status-item { padding:10px 14px; display:flex; flex-direction:column; gap:4px; }
.pac-status-item:not(:last-child) { border-right:1px solid var(--border); }
.pac-status-lbl { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.04em; color:var(--dim); }

.status-badge { font-size:11px; font-weight:600; white-space:nowrap; }
.status-badge.ok { color:var(--green); }
.status-badge.warn { color:var(--yellow); }
.status-badge.error { color:var(--red); }
.status-badge.dim { color:var(--dim); }

.pac-meta { font-size:11px; color:var(--muted); padding:7px 18px; border-bottom:1px solid var(--border); font-family:var(--mono); }
.pac-ops { display:flex; flex-wrap:wrap; gap:5px; padding:10px 18px; }
.op-chip { font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:4px; background:var(--surface-2); color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.op-chip.dim { opacity:.5; }
.pac-actions { display:flex; gap:8px; padding:10px 18px 14px; }

/* ── Empty / loading states ───────────────────────────────────────────── */
.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 46px; margin-bottom: 14px; opacity: .85; filter: grayscale(.1); }
.empty-state h3 { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--dim); line-height: 1.6; }

.loading-state { text-align: center; padding: 90px 20px; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* ── Modals ───────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4,10,22,.62); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .18s ease;
}
.modal {
  width: 440px; max-width: 100%; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15px; font-weight: 700; color: var(--text-strong); }
.modal-close { background: none; border: none; color: var(--dim); font-size: 16px; cursor: pointer; width: 28px; height: 28px; border-radius: 7px; transition: all .15s; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border); }
.field-label { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); margin-bottom: 7px; }
.field-input, .field-select, .field-textarea, .auto-hour-select { width: 100%; }
.field-textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.modal-status { margin-top: 14px; padding: 11px 14px; border-radius: 9px; font-size: 12.5px; }
.modal-status.success { background: var(--green-bg); color: var(--green); }
.modal-status.error   { background: var(--red-bg); color: var(--red); }
.modal-status.info    { background: var(--blue-bg); color: var(--blue); }
.modal-status.running { background: var(--accent-bg); color: var(--accent2); }

/* ── Utilities (used inline by app.js) ────────────────────────────────── */
.flex { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.mt-4 { margin-top: 10px; }
.mono { font-family: var(--mono); }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fw-600 { font-weight: 600; }
.text-dim { color: var(--dim); }
.text-muted { color: var(--muted); }
.accent { color: var(--accent2); }
.green { color: var(--green); }
.red { color: var(--red); }
.yellow { color: var(--yellow); }
.blue { color: var(--blue); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 76px; }
  .nav-label, .brand-sub, .nav-section-label, .nav-badge, .conn-label, .build-info { display: none; }
  .brand { justify-content: center; }
  .nav-btn { justify-content: center; }
  .sidebar-header, .sidebar-footer { text-align: center; }
}
@media (max-width: 680px) {
  .topbar { padding: 14px 16px; }
  .content { padding: 18px 16px 50px; }
  .clock, .page-meta { display: none; }
  .kpi-grid, .agents-grid, .mission-grid, .provider-grid, .project-list { grid-template-columns: 1fr; }
  .log-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ============================================================================
   LIVE OPERATIONS CENTER — premium shell + Mission Control overview
   ========================================================================== */

/* ── Sidebar refinements ──────────────────────────────────────────────── */
.brand-text { font-size: 18px; }
.nav-icon { font-size: 16px; opacity: .9; }
.nav-btn.active .nav-icon { color: var(--accent2); opacity: 1; }

/* System health widget (sidebar bottom) */
.sys-widget { margin: 10px 12px 14px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: linear-gradient(180deg, var(--surface), rgba(8,21,44,.6)); }
.sys-widget-top { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sys-widget-top .conn-label { flex: 1; color: var(--text); font-weight: 600; }
.sys-env { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent2); background: var(--accent-bg); padding: 2px 7px; border-radius: 20px; }
.sys-spark { width: 100%; height: 26px; margin: 9px 0 7px; display: block; }
.sys-widget-meta { display: flex; flex-direction: column; gap: 3px; font-size: 10px; color: var(--dim); font-family: var(--mono); }

/* ── Topbar: search + quick action + notifications ────────────────────── */
.topbar { gap: 18px; }
.topbar-search { flex: 1; max-width: 480px; position: relative; display: flex; align-items: center; }
.topbar-search input {
  width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: 11px; padding: 10px 40px 10px 38px; font-size: 13px; font-family: var(--font); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.topbar-search input::placeholder { color: var(--dim); }
.topbar-search input:focus { border-color: var(--accent); box-shadow: var(--ring); background: var(--surface-2); }
.search-icon { position: absolute; left: 13px; color: var(--dim); font-size: 15px; pointer-events: none; }
.search-kbd { position: absolute; right: 11px; font-size: 10px; font-family: var(--mono); color: var(--dim); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; pointer-events: none; }
.qa-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12.5px; font-weight: 700; padding: 9px 15px; border-radius: 10px; border: none;
  background: linear-gradient(180deg, var(--accent2), var(--accent)); color: #1a1206;
  box-shadow: 0 6px 18px -6px var(--accent-glow); transition: filter .15s, transform .05s; white-space: nowrap;
}
.qa-btn span { font-size: 15px; line-height: 1; }
.qa-btn:hover { filter: brightness(1.08); }
.qa-btn:active { transform: translateY(1px); }
.notif-btn { position: relative; font-size: 15px; }
.notif-dot { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg-2); animation: livePulse 2s infinite; }

/* ── Panels (generic ops card) ────────────────────────────────────────── */
.panel { background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.62)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 13px; font-weight: 700; letter-spacing: .03em; color: var(--text); display: flex; align-items: center; gap: 9px; }
.panel-title::before { content: ""; width: 4px; height: 14px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.panel-link { font-size: 11.5px; font-weight: 600; color: var(--accent2); cursor: pointer; text-decoration: none; }
.panel-link:hover { color: var(--accent); }
.panel-body { padding: 16px 18px; }

/* ── Live KPI cards ───────────────────────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.kpi-live {
  position: relative; overflow: hidden; padding: 18px 20px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.5));
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.kpi-live::after { content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 70%); opacity: .5; pointer-events: none; }
.kpi-live:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.kpi-live-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-live-label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.kpi-delta { font-size: 11px; font-weight: 700; font-family: var(--mono); padding: 2px 7px; border-radius: 20px; }
.kpi-delta.up { color: var(--green); background: var(--green-bg); }
.kpi-delta.down { color: var(--red); background: var(--red-bg); }
.kpi-live-value { font-size: 34px; font-weight: 800; color: var(--text-strong); letter-spacing: -.02em; margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-live-sub { font-size: 11.5px; color: var(--muted); }
.kpi-live-foot { margin-top: 12px; height: 40px; display: flex; align-items: flex-end; }
.kpi-spark, .kpi-bars { width: 100%; height: 40px; display: block; }
.kpi-ring-wrap { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.kpi-ring { width: 56px; height: 56px; flex-shrink: 0; }

/* spark stroke */
.spark-line { fill: none; stroke: var(--accent2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark-area { fill: url(#sparkGrad); opacity: .5; }
.spark-line.green { stroke: var(--green); }
.bar-rect { fill: var(--accent); opacity: .85; }
.bar-rect.alt { fill: var(--blue); }

/* ── Hero row: ops map + live feed ────────────────────────────────────── */
.hero-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.ops-map-wrap { position: relative; overflow: hidden; min-height: 360px; }
.ops-map { width: 100%; height: 100%; min-height: 320px; display: block; }
.ops-map-legend { position: absolute; left: 18px; bottom: 16px; display: flex; gap: 14px; font-size: 11px; color: var(--muted); }
.ops-map-legend b { color: var(--text); font-weight: 600; }
.map-node { animation: nodePulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.map-node:nth-child(2n) { animation-delay: .6s; }
.map-node:nth-child(3n) { animation-delay: 1.1s; }
@keyframes nodePulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.map-ping { transform-box: fill-box; transform-origin: center; animation: ping 2.6s ease-out infinite; }
.map-ping:nth-child(3n) { animation-delay: 1.3s; }
@keyframes ping { 0% { opacity: .7; transform: scale(.4); } 80%,100% { opacity: 0; transform: scale(3.2); } }
.map-arc { fill: none; stroke: var(--accent2); stroke-width: 1.2; opacity: .35; stroke-dasharray: 4 6; animation: dashFlow 3s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -40; } }

.live-feed { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.lf-item { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background .14s; }
.lf-item:last-child { border-bottom: none; }
.lf-item:hover { background: var(--surface-2); }
.lf-item.fresh { animation: freshIn .5s ease; }
@keyframes freshIn { from { background: var(--accent-bg); } to { background: transparent; } }
.lf-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.lf-dot.running { background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: livePulse 1.6s infinite; }
.lf-dot.done { background: var(--green); box-shadow: 0 0 6px var(--green); }
.lf-dot.fail { background: var(--red); }
.lf-dot.scheduled { background: var(--blue); }
.lf-body { flex: 1; min-width: 0; }
.lf-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.lf-sub { font-size: 11px; color: var(--dim); margin-top: 2px; }
.lf-time { font-size: 10.5px; color: var(--dim); font-family: var(--mono); flex-shrink: 0; }

/* ── Two-column ops rows ──────────────────────────────────────────────── */
.ops-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.ops-perf { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gap); margin-top: var(--gap); }

/* ── Top agents board ─────────────────────────────────────────────────── */
.board { display: flex; flex-direction: column; }
.board-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); transition: background .14s; }
.board-row:last-child { border-bottom: none; }
.board-row:hover { background: var(--surface-2); }
.board-rank { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--dim); width: 18px; }
.board-avatar { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; background: radial-gradient(circle at 30% 25%, var(--surface-3), var(--surface-2)); border: 1px solid var(--border-strong); flex-shrink: 0; }
.board-info { flex: 1; min-width: 0; }
.board-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-sub { font-size: 10.5px; color: var(--dim); margin-top: 1px; }
.board-pct { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent2); }
.board-bar { width: 54px; height: 5px; border-radius: 20px; background: var(--surface-3); overflow: hidden; margin-left: 2px; }
.board-bar > i { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.board-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.board-status.active { background: var(--green); box-shadow: 0 0 6px var(--green); animation: livePulse 2s infinite; }
.board-status.busy { background: var(--accent); box-shadow: 0 0 6px var(--accent); }
.board-status.idle { background: var(--dim); }

/* ── Recent missions table ────────────────────────────────────────────── */
.mtable { width: 100%; border-collapse: collapse; }
.mtable td { padding: 11px 18px; font-size: 12.5px; border-bottom: 1px solid var(--border); color: var(--text); }
.mtable tr:last-child td { border-bottom: none; }
.mtable tr { transition: background .12s; }
.mtable tbody tr:hover { background: var(--surface-2); }
.mtable .m-name { font-weight: 600; }
.mtable .m-agent { color: var(--muted); font-size: 11.5px; }
.mtable .m-sched { color: var(--dim); font-family: var(--mono); font-size: 11px; }

/* ── Performance chart ────────────────────────────────────────────────── */
.range-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 9px; }
.range-tab { font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); border: none; background: transparent; transition: all .14s; }
.range-tab:hover { color: var(--text); }
.range-tab.active { background: var(--accent); color: #1a1206; }
.perf-chart { width: 100%; height: 230px; display: block; }
.perf-legend { display: flex; gap: 16px; padding: 0 18px 14px; font-size: 11px; color: var(--muted); }
.perf-legend span { display: flex; align-items: center; gap: 6px; }
.perf-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.chart-area { opacity: .18; }
.chart-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-grid { stroke: var(--border); stroke-width: 1; opacity: .5; }
.chart-axis { fill: var(--dim); font-size: 9px; font-family: var(--mono); }

/* ── Quick actions ────────────────────────────────────────────────────── */
.qa-grid { display: flex; flex-direction: column; gap: 10px; }
.qa-card { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); border: 1px solid var(--border); transition: all .16s; }
.qa-card:hover { transform: translateX(3px); border-color: var(--accent); background: var(--surface-2); }
.qa-ic { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; background: var(--accent-bg); color: var(--accent2); }
.qa-tt { font-size: 13px; font-weight: 700; color: var(--text); }
.qa-sub { font-size: 11px; color: var(--dim); margin-top: 1px; }
.qa-card .qa-arrow { margin-left: auto; color: var(--dim); transition: transform .16s, color .16s; }
.qa-card:hover .qa-arrow { transform: translateX(3px); color: var(--accent2); }

/* ── System status ────────────────────────────────────────────────────── */
.sysstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.ss-row { display: flex; align-items: center; gap: 11px; padding: 13px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ss-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ss-dot.ok { background: var(--green); box-shadow: 0 0 7px var(--green); }
.ss-dot.warn { background: var(--yellow); box-shadow: 0 0 7px var(--yellow); }
.ss-dot.err { background: var(--red); box-shadow: 0 0 7px var(--red); }
.ss-name { font-size: 12.5px; font-weight: 600; color: var(--text); flex: 1; }
.ss-val { font-size: 10.5px; color: var(--dim); font-family: var(--mono); }

/* ── Integrations / Settings pages ────────────────────────────────────── */
.intg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--gap); }
.intg-card { padding: 18px; border-radius: var(--radius); background: linear-gradient(180deg, var(--surface), rgba(15,37,71,.6)); border: 1px solid var(--border); box-shadow: var(--shadow-sm); transition: transform .18s, border-color .18s; }
.intg-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.intg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.intg-logo { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.intg-name { font-size: 14px; font-weight: 700; color: var(--text); }
.intg-state { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 20px; margin-left: auto; }
.intg-state.on { color: var(--green); background: var(--green-bg); }
.intg-state.off { color: var(--dim); background: var(--surface-2); }
.intg-desc { font-size: 12px; color: var(--muted); line-height: 1.55; margin-bottom: 14px; }

.settings-list { display: flex; flex-direction: column; gap: 10px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.set-row .set-key { font-family: var(--mono); font-size: 12px; color: var(--accent2); }
.set-row .set-desc { font-size: 12px; color: var(--muted); flex: 1; }
.set-row .set-val { font-family: var(--mono); font-size: 11px; color: var(--dim); }

/* ── Toggle switch ────────────────────────────────────────────────────── */
.toggle-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle-switch input[type="checkbox"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider { position: relative; width: 42px; height: 24px; border-radius: 20px; background: var(--surface-3); transition: background .2s; flex-shrink: 0; border: 1px solid var(--border); }
.toggle-slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::after { transform: translateX(18px); }

/* ── Alert banner ─────────────────────────────────────────────────────── */
.alert-banner { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; margin-bottom: 16px; }

/* ── AI Chat layout ───────────────────────────────────────────────────── */
.chat-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--gap); height: calc(100vh - 120px); min-height: 500px; }
.chat-sidebar { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; overflow: hidden; }
.chat-conv-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.chat-conv-item { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.chat-conv-item:hover { background: var(--surface-2); }
.chat-conv-item.active { background: var(--surface-2); border-color: var(--border-strong); }
.conv-title { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { font-size: 10.5px; color: var(--dim); margin-top: 2px; }

.chat-main { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chat-header-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 16px; }
.chat-welcome { text-align: center; padding: 48px 24px; color: var(--muted); }
.chat-welcome h3 { color: var(--text); font-size: 18px; margin-bottom: 8px; }
.chat-msg { display: flex; flex-direction: column; gap: 4px; max-width: 80%; }
.chat-msg.user { align-self: flex-end; align-items: flex-end; }
.chat-msg.assistant { align-self: flex-start; align-items: flex-start; }
.chat-bubble { padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.chat-msg.user .chat-bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.assistant .chat-bubble { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg-meta { font-size: 10.5px; color: var(--dim); padding: 0 4px; }
.chat-input-row { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; align-items: flex-end; }
.chat-textarea { flex: 1; resize: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text); font-size: 13.5px; line-height: 1.5; font-family: inherit; transition: border-color .15s; }
.chat-textarea:focus { outline: none; border-color: var(--border-strong); }
.cursor-blink { display: inline-block; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 760px) { .chat-layout { grid-template-columns: 1fr; height: auto; } .chat-sidebar { height: 200px; } }

/* ── Cloudflare / Supabase panels ─────────────────────────────────────── */
.split-panel { display: grid; grid-template-columns: 220px 1fr; gap: var(--gap); }
.split-left { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; overflow-y: auto; max-height: 500px; }
.split-item { padding: 9px 11px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--text); border: 1px solid transparent; transition: background .15s; display: flex; justify-content: space-between; align-items: center; }
.split-item:hover { background: var(--surface-2); }
.split-item.active { background: var(--surface-2); border-color: var(--border-strong); }
.split-right { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow: auto; }
.sql-editor { width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; color: var(--text); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; resize: vertical; min-height: 80px; }
.sql-editor:focus { outline: none; border-color: var(--border-strong); }
.migration-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.migration-name { font-family: var(--mono); font-size: 12px; color: var(--accent2); flex: 1; }
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.text-muted { color: var(--muted); }
.text-warn { color: var(--yellow, #f59e0b); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
@media (max-width: 760px) { .split-panel { grid-template-columns: 1fr; } }

/* ── Mobile bottom nav ────────────────────────────────────────────────── */
.mobile-nav { display: none; }
@media (max-width: 860px) {
  .topbar-search { display: none; }
  .qa-btn span + *, .qa-btn { font-size: 0; padding: 9px 11px; }
  .qa-btn span { font-size: 16px; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .hero-row, .ops-2, .ops-perf { grid-template-columns: 1fr; }
  .sysstat { grid-template-columns: 1fr; }
  .content { padding: 16px 14px 90px; }
  .clock { display: none; }
  .mobile-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(11,29,58,.95); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .mnav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px; font-size: 10px; font-weight: 600; color: var(--dim); text-decoration: none; border-radius: 10px; transition: color .15s; }
  .mnav-btn.active { color: var(--accent2); }
  .mnav-icon { font-size: 18px; }
}
@media (max-width: 430px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

/* ══════════════════════════════════════════════════════════
   MISSION CONTROL — Live Dashboard Extensions
   ══════════════════════════════════════════════════════════ */

/* 5-column KPI row */
.mc-kpi5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .mc-kpi5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px)  { .mc-kpi5 { grid-template-columns: 1fr 1fr; } }

/* Integration status strip */
.mc-intg-strip-wrap {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 10px; flex-wrap: wrap;
}
.mc-intg-strip {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.mc-intg-pill {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); font-size: 11px; font-weight: 600;
  color: var(--muted); cursor: default; transition: all .2s;
}
.mc-intg-pill.on  { border-color: rgba(63,181,122,.35); background: rgba(63,181,122,.08); color: var(--green); }
.mc-intg-pill.err { border-color: rgba(224,86,75,.35);  background: rgba(224,86,75,.08);  color: var(--red); }
.mc-intg-icon { font-size: 12px; }
.mc-intg-name { font-size: 10px; }
.mc-intg-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--dim);
}
.mc-intg-pill.on  .mc-intg-dot { background: var(--green); box-shadow: 0 0 6px var(--green); animation: pulse 2s infinite; }
.mc-intg-pill.err .mc-intg-dot { background: var(--red); }
.mc-last-ts { font-size: 10px; color: var(--dim); white-space: nowrap; }

/* Hero row — 2 equal cols */
.mc-hero2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
@media (max-width: 900px) { .mc-hero2 { grid-template-columns: 1fr; } }

/* Loop list */
.mc-loop-list { display: flex; flex-direction: column; gap: 1px; }
.mc-loop-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.mc-loop-row:last-child { border-bottom: none; }
.mc-loop-row:hover { background: var(--surface-2); }
.mc-loop-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--dim);
}
.mc-loop-dot.running { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: pulse 1.5s infinite; }
.mc-loop-dot.idle    { background: var(--green); }
.mc-loop-info { flex: 1; min-width: 0; }
.mc-loop-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-loop-meta { font-size: 10px; color: var(--dim); margin-top: 1px; }
.mc-loop-status { font-size: 10px; color: var(--muted); flex-shrink: 0; }
.mc-loop-empty { padding: 20px 16px; font-size: 12px; color: var(--dim); text-align: center; }

/* AdSense + CF stat grid */
.mc-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; padding: 4px 0 8px;
}
.mc-stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 8px; gap: 4px;
}
.mc-stat-val { font-size: 18px; font-weight: 700; color: var(--text-strong); letter-spacing: -.5px; }
.mc-stat-lbl { font-size: 10px; color: var(--dim); font-weight: 500; text-transform: uppercase; letter-spacing: .4px; }

/* Empty state for panels */
.mc-panel-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; color: var(--muted); text-align: center;
}

/* Zone chips */
.mc-zone-chip {
  display: inline-block; padding: 3px 8px; border-radius: 10px;
  font-size: 10px; font-weight: 600; border: 1px solid var(--border);
  color: var(--dim); background: var(--surface);
}
.mc-zone-chip.on { color: var(--green); border-color: rgba(63,181,122,.3); background: rgba(63,181,122,.08); }

/* ══════════════════════════════════════════════════════════
   ADVANCED DASHBOARD EXTENSIONS v2
   ══════════════════════════════════════════════════════════ */

/* ── Project color palette ─────────────────────────────────────────────── */
.proj-yallaplays { --proj-c: #3FB57A; --proj-bg: rgba(63,181,122,.13); }
.proj-fionera    { --proj-c: #5B9BFF; --proj-bg: rgba(91,155,255,.13); }
.proj-istanbul   { --proj-c: #E3B25A; --proj-bg: rgba(227,178,90,.13); }
.proj-turkiyegez { --proj-c: #B98BFF; --proj-bg: rgba(185,139,255,.13); }
.proj-mifteh     { --proj-c: #C88A32; --proj-bg: rgba(200,138,50,.13); }

/* ── Enhanced loop matrix (Scheduler page) ─────────────────────────────── */
.loop-matrix { display: flex; flex-direction: column; gap: var(--gap); }

.loop-project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.loop-project-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.loop-proj-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--proj-c, var(--muted));
  box-shadow: 0 0 8px var(--proj-c, transparent);
  flex-shrink: 0;
}
.loop-proj-name { font-size: 12.5px; font-weight: 700; color: var(--text); flex: 1; }
.loop-proj-stats { font-size: 10.5px; color: var(--dim); font-family: var(--mono); }
.loop-proj-count {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; background: var(--proj-bg, var(--surface-3));
  color: var(--proj-c, var(--dim));
}

.loop-row-v2 {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  transition: background .14s;
}
.loop-row-v2:last-child { border-bottom: none; }
.loop-row-v2:hover { background: var(--surface-2); }
.loop-row-v2.disabled { opacity: .5; }

.loop-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--dim);
}
.loop-status-dot.enabled { background: var(--green); box-shadow: 0 0 6px var(--green); }
.loop-status-dot.running { background: var(--accent2); box-shadow: 0 0 8px var(--accent2); animation: livePulse 1.4s infinite; }

.loop-info-v2 { flex: 1; min-width: 0; }
.loop-name-v2 { font-size: 12.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loop-meta-v2 { display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.loop-chip {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
  background: var(--surface-3); color: var(--muted);
  font-family: var(--mono);
}
.loop-chip.type { background: var(--accent-bg); color: var(--accent2); }

.loop-rate-bar { width: 60px; flex-shrink: 0; }
.loop-rate-track { width: 100%; height: 4px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.loop-rate-fill { height: 100%; border-radius: 10px; background: var(--green); }
.loop-rate-label { font-size: 9.5px; color: var(--dim); margin-top: 2px; text-align: center; font-family: var(--mono); }

.loop-next { font-size: 10px; color: var(--dim); font-family: var(--mono); width: 56px; text-align: right; flex-shrink: 0; }

.loop-toggle-btn {
  width: 36px; height: 20px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-3);
  cursor: pointer; position: relative; transition: background .2s, border-color .2s;
  flex-shrink: 0;
}
.loop-toggle-btn::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.loop-toggle-btn.on { background: var(--green); border-color: var(--green); }
.loop-toggle-btn.on::after { transform: translateX(16px); }

.loop-trigger-btn {
  padding: 4px 9px; border-radius: 6px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.loop-trigger-btn:hover { background: var(--accent-bg); color: var(--accent2); border-color: var(--accent); }
.loop-trigger-btn.running { color: var(--accent); border-color: var(--accent); animation: livePulse 1.5s infinite; }

.loop-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 0; flex-wrap: wrap;
}
.loop-toolbar .filter-chip {
  padding: 5px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.loop-toolbar .filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.loop-toolbar .filter-chip.active { background: var(--accent-bg); color: var(--accent2); border-color: var(--accent); }

/* ── Analytics Hub page ────────────────────────────────────────────────── */
.analytics-layout { display: flex; flex-direction: column; gap: var(--gap); }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--gap); }

.proj-analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s;
}
.proj-analytics-card:hover { border-color: var(--border-strong); }

.proj-analytics-header {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.proj-analytics-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--proj-c, var(--accent));
  box-shadow: 0 0 10px var(--proj-c, transparent);
}
.proj-analytics-name { font-size: 14px; font-weight: 700; color: var(--text); flex: 1; }
.proj-analytics-type { font-size: 10px; color: var(--dim); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.proj-analytics-kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); }
.proj-kpi-cell { padding: 12px 10px; text-align: center; border-right: 1px solid var(--border); }
.proj-kpi-cell:last-child { border-right: none; }
.proj-kpi-val { font-size: 18px; font-weight: 700; color: var(--text-strong); line-height: 1; margin-bottom: 4px; }
.proj-kpi-lbl { font-size: 9.5px; color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }

.proj-analytics-body { padding: 12px 16px; }
.proj-output-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.proj-output-row:last-child { margin-bottom: 0; }
.proj-output-label { font-size: 11px; color: var(--muted); width: 90px; flex-shrink: 0; }
.proj-output-track { flex: 1; height: 6px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.proj-output-fill { height: 100%; border-radius: 10px; background: var(--proj-c, var(--accent)); opacity: .8; }
.proj-output-count { font-size: 10px; color: var(--dim); font-family: var(--mono); width: 24px; text-align: right; flex-shrink: 0; }

.analytics-summary-row {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.analytics-sum-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.analytics-sum-val { font-size: 24px; font-weight: 700; color: var(--text-strong); letter-spacing: -.5px; }
.analytics-sum-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
.analytics-sum-delta { font-size: 10.5px; font-weight: 600; margin-top: 2px; }
.analytics-sum-delta.up { color: var(--green); }
.analytics-sum-delta.down { color: var(--red); }

/* ── Operations Timeline page ──────────────────────────────────────────── */
.ops-timeline-wrap { display: flex; flex-direction: column; gap: 0; position: relative; padding-left: 28px; margin-top: 8px; }
.ops-timeline-wrap::before {
  content: ''; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px;
  background: var(--border);
}

.ops-tl-item {
  position: relative; padding: 0 0 18px; display: flex; gap: 14px;
}
.ops-tl-item:last-child { padding-bottom: 0; }

.ops-tl-dot {
  position: absolute; left: -20px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--dim);
  flex-shrink: 0;
}
.ops-tl-dot.ok { background: var(--green); box-shadow: 0 0 6px var(--green); }
.ops-tl-dot.fail { background: var(--red); }
.ops-tl-dot.running { background: var(--accent2); animation: livePulse 1.4s infinite; }

.ops-tl-body { flex: 1; min-width: 0; }
.ops-tl-header { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.ops-tl-time { font-size: 10px; color: var(--dim); font-family: var(--mono); }
.ops-tl-proj-badge {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 8px;
  color: var(--proj-c, var(--muted)); background: var(--proj-bg, var(--surface-2));
}
.ops-tl-type-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
  background: var(--surface-2); color: var(--muted);
}
.ops-tl-title { font-size: 13px; font-weight: 600; color: var(--text); }
.ops-tl-detail { font-size: 11px; color: var(--dim); margin-top: 2px; }
.ops-tl-result {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 8px;
  margin-left: auto;
}
.ops-tl-result.ok { color: var(--green); background: var(--green-bg); }
.ops-tl-result.fail { color: var(--red); background: var(--red-bg); }

.tl-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: var(--gap); }
.tl-filter { padding: 5px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; transition: all .15s; }
.tl-filter:hover { color: var(--text); border-color: var(--border-strong); }
.tl-filter.active { background: var(--accent-bg); color: var(--accent2); border-color: var(--accent); }

/* ── Enhanced Dashboard: project health matrix ─────────────────────────── */
.proj-health-matrix {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
@media (max-width: 900px) { .proj-health-matrix { grid-template-columns: 1fr; } }

.phm-cell {
  background: var(--surface); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.phm-proj { font-size: 11px; font-weight: 700; color: var(--text); padding: 0 0 6px; border-bottom: 1px solid var(--border); margin-bottom: 2px; }
.phm-proj span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.phm-metric { display: flex; justify-content: space-between; font-size: 10.5px; }
.phm-metric-key { color: var(--dim); }
.phm-metric-val { color: var(--text); font-family: var(--mono); font-weight: 600; }
.phm-metric-val.ok { color: var(--green); }
.phm-metric-val.warn { color: var(--yellow); }
.phm-metric-val.err { color: var(--red); }

/* ── Site Hub unified control ─────────────────────────────────────────── */
.hub-tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px;
}
.hub-tab {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--muted); transition: all .15s;
}
.hub-tab:hover { color: var(--text); border-color: var(--border-strong); }
.hub-tab.active {
  background: var(--accent-bg, rgba(200, 138, 50, .12));
  border-color: var(--accent); color: var(--accent2, var(--accent));
}
.hub-site-btn.hub-site-active {
  border-color: var(--accent) !important;
  background: var(--accent-bg, rgba(200, 138, 50, .12)) !important;
  box-shadow: 0 0 0 1px var(--accent);
}
