/* ==========================================================
 * ORION AI - Command Center Design System
 * Palette: Green accent + white/grey scale
 * Fonts: IBM Plex Mono (data/code), Plus Jakarta Sans (prose)
 * ENERGY 1 / RHYTHM 1 / MOTION 1
 * ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ----------------------------------------------------------
 * DESIGN TOKENS (MONOCHROME PURE BLACK & WHITE MINIMALIST)
 * ---------------------------------------------------------- */
:root {
  /* Backgrounds: deep obsidian & charcoal black scale */
  --bg-base:       #000000;   /* pure black canvas */
  --bg-sidebar:    #09090b;   /* compact matte black sidebar */
  --bg-surface:    #121215;   /* clean elevated matte card surface */
  --bg-raised:     #18181b;   /* form input / panel raised */
  --bg-hover:      #222226;   /* hover state */

  /* Borders */
  --border-faint:  #18181b;
  --border-card:   #27272a;   /* crisp subtle border */
  --border-focus:  #52525b;   /* soft muted focus ring */

  /* Text: soft off-white to grey scale (no harsh blinding glare) */
  --text-primary:  #e4e4e7;   /* soft off-white zinc-200 headings */
  --text-body:     #d4d4d8;   /* clear light grey text */
  --text-dim:      #a1a1aa;   /* neutral grey labels */
  --text-muted:    #71717a;   /* muted captions */

  /* All accent colors remapped to soft monochrome */
  --green:         #d4d4d8;   /* soft zinc off-white */
  --green-dim:     rgba(212, 212, 216, 0.08);
  --green-mid:     rgba(212, 212, 216, 0.16);

  --gold:          #d4d4d8;
  --gold-dim:      rgba(212, 212, 216, 0.08);
  --cyan:          #d4d4d8;
  --cyan-dim:      rgba(212, 212, 216, 0.08);
  --rose:          #a1a1aa;
  --rose-dim:      rgba(212, 212, 216, 0.08);
  --blue:          #d4d4d8;
  --amber:         #d4d4d8;

  /* Backward-compat aliases */
  --accent-gold:   #d4d4d8;
  --accent-green:  #d4d4d8;
  --accent-cyan:   #d4d4d8;
  --accent-rose:   #a1a1aa;
  --accent-blue:   #d4d4d8;
  --bg-main:       #000000;
  --header-h:      56px;
  --sidebar-w:     190px;     /* compact slim sidebar */
  --radius-sm:     5px;
  --radius-md:     6px;
  --radius-lg:     8px;
  --radius-card:   8px;

  /* Easing */
  --ease-out:      cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ----------------------------------------------------------
 * BASE
 * ---------------------------------------------------------- */
html, body {
  height: 100%;
  width: 100%;
}

body {
  background: var(--bg-base);
  color: var(--text-body);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Thin custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1d3f39; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #2a5750; }

/* ----------------------------------------------------------
 * MASTER LAYOUT
 * ---------------------------------------------------------- */
.dashboard-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* ----------------------------------------------------------
 * SIDEBAR
 * ---------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Brand block */
.brand-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-card);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  filter: invert(1) brightness(1.1);
  border: 1px solid #3f3f46;
  background: #000;
  flex-shrink: 0;
}

.brand-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #e4e4e7;
  text-transform: uppercase;
  line-height: 1.2;
}

.brand-sub {
  font-size: 8px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Nav group */
.nav-group {
  padding: 8px 6px 0;
}

.nav-group-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0 6px;
  margin-bottom: 4px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item i {
  color: var(--text-muted);
  transition: color 0.12s ease;
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: #e4e4e7;
}

.nav-item:hover i {
  color: #e4e4e7;
}

.nav-item.active {
  background: #18181b;
  color: #f4f4f5;
  border-color: #27272a;
  border-left-color: #a1a1aa;
  font-weight: 600;
}

.nav-item.active i {
  color: #f4f4f5;
}

/* Sidebar bottom telemetry */
.sidebar-bottom-info {
  margin-top: auto;
  padding: 8px;
  margin: auto 6px 8px;
  background: #121215;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-badge-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8.5px;
  font-weight: 700;
  color: #d4d4d8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-status-desc {
  font-size: 8.5px;
  color: var(--text-dim);
  line-height: 1.35;
}

.sidebar-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  color: var(--text-dim);
  padding-top: 4px;
  border-top: 1px solid var(--border-card);
}

/* ----------------------------------------------------------
 * ONLINE DOT - only marks real live connection state
 * ---------------------------------------------------------- */
.online-dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
 * MAIN VIEWPORT
 * ---------------------------------------------------------- */
.main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bg-base);
  min-width: 0;
}

/* ----------------------------------------------------------
 * TOP HEADER
 * ---------------------------------------------------------- */
.top-header {
  height: var(--header-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-faint);
  flex-shrink: 0;
  background: var(--bg-sidebar);
}

.header-title-block h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.header-title-block p {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  letter-spacing: 0;
}

.header-meta-block {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
}

.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ----------------------------------------------------------
 * DASHBOARD CONTENT SCROLL AREA
 * ---------------------------------------------------------- */
.dashboard-content {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ----------------------------------------------------------
 * PROACTIVE BANNER
 * ---------------------------------------------------------- */
.proactive-banner {
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.status-dot-amber {
  width: 7px;
  height: 7px;
  background: var(--amber);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----------------------------------------------------------
 * METRIC STRIP - 4 cards, each with distinct role
 * Purpose: show primary KPIs at a glance. Not identical:
 *   - Classroom: wider value emphasis
 *   - Calendar: time-based, compact
 *   - Gmail: count badge prominent
 *   - Brain: secondary (smaller) to reflect stored state
 * ---------------------------------------------------------- */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  flex-shrink: 0;
}

@media (max-width: 1400px) {
  .metrics-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .metrics-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .metrics-strip { grid-template-columns: 1fr; }
}

.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.metric-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-card);
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  background: var(--bg-base);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid var(--border-faint);
  text-transform: uppercase;
}

.metric-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Brain vault card is intentionally less prominent (supporting data) */
.metric-card[data-agent="brain"] .metric-value {
  font-size: 13px;
}

.metric-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------------
 * GRID LAYOUTS
 * ---------------------------------------------------------- */
.grid-2-col {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
  min-height: 0;
}

@media (max-width: 1100px) {
  .grid-2-col { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
 * PANEL CARDS
 * ---------------------------------------------------------- */
.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-faint);
  padding-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.panel-badge {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  color: var(--text-dim);
  font-size: 10px;
  font-family: inherit;
  padding: 2px 7px;
  border-radius: 3px;
  white-space: nowrap;
}

/* ----------------------------------------------------------
 * STAT ROWS
 * ---------------------------------------------------------- */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  gap: 8px;
}

.stat-val   { font-weight: 600; color: var(--text-body); }
.stat-highlight { color: var(--green); font-weight: 700; }
.stat-green { color: var(--green); font-weight: 700; }
.stat-cyan  { color: var(--green); }

/* Phone node stat group - visual separator between info sections */
.phone-stat-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ----------------------------------------------------------
 * PROGRESS BARS
 * ---------------------------------------------------------- */
.bar-container {
  height: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: 2px;
  overflow: hidden;
  display: flex;
}

.bar-segment   { height: 100%; }
.bar-gold      { background: var(--gold); }
.bar-green     { background: var(--green); }
.bar-cyan      { background: var(--cyan); }
.bar-dim       { background: var(--border-faint); }

/* ----------------------------------------------------------
 * DATA TABLES
 * ---------------------------------------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-faint);
  font-size: 9px;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--border-faint);
  color: var(--text-dim);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td {
  background: rgba(255,255,255,0.015);
  color: var(--text-body);
}

/* ----------------------------------------------------------
 * DECK MULTI-TAB
 * ---------------------------------------------------------- */
.deck-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 420px;
}

.deck-tabs-header {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-faint);
  padding: 0 6px;
}

.deck-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
}

.deck-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 11px 12px;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.deck-tab:hover { color: var(--text-body); }

.deck-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--green);
}

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.07);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 18px;
}

.deck-tab.active .tab-count-badge {
  background: var(--green);
  color: #071510;
}

.deck-content {
  padding: 14px;
  overflow-y: auto;
  max-height: 320px;
}

/* ----------------------------------------------------------
 * HABIT QUICK BUTTONS
 * ---------------------------------------------------------- */
.btn-habit-quick {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
  width: 100%;
}

.btn-habit-quick:hover {
  background: var(--bg-raised);
  border-color: var(--cyan);
}

/* ----------------------------------------------------------
 * THOUGHTS STREAM
 * ---------------------------------------------------------- */
.thoughts-stream-container {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 2px 0;
  max-height: 160px;
}

/* ----------------------------------------------------------
 * INLINE COMMAND CARD
 * ---------------------------------------------------------- */
.inline-command-card {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-color: var(--border-card);
}

.command-chips-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-item {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: 3px;
  padding: 4px 10px;
  font-family: inherit;
  font-size: 10px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, color 0.1s ease;
}

.chip-item:hover {
  background: var(--bg-raised);
  border-color: var(--gold);
  color: var(--text-primary);
}

.inline-result-box {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg-base);
  border: 1px solid var(--border-card);
  max-height: 240px;
  overflow-y: auto;
}

/* ----------------------------------------------------------
 * TERMINAL VIEW
 * ---------------------------------------------------------- */
.terminal-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  padding: 20px 28px;
  gap: 14px;
}

.terminal-chat-box {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.terminal-header {
  padding: 12px 16px;
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

.terminal-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.terminal-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 860px;
}

.terminal-msg.user { align-self: flex-end; }

.terminal-msg-meta {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.terminal-msg-body {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.55;
}

.terminal-msg.ai .terminal-msg-body {
  background: var(--bg-raised);
  border: 1px solid var(--border-faint);
  color: var(--text-body);
}

.terminal-msg.user .terminal-msg-body {
  background: #14362f;
  border: 1px solid #1f4d43;
  color: #fff;
}

.terminal-input-bar {
  padding: 12px 14px;
  background: var(--bg-base);
  border-top: 1px solid var(--border-faint);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.terminal-input {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  transition: border-color 0.12s ease;
}

.terminal-input:focus { border-color: var(--border-focus); }

/* ----------------------------------------------------------
 * BUTTONS
 * ---------------------------------------------------------- */
.btn-terminal {
  background: var(--bg-raised);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.btn-terminal:hover {
  background: var(--bg-hover);
  color: #fff;
}

.btn-terminal-primary {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
  font-weight: 600 !important;
}

.btn-terminal-primary:hover {
  background: #3f3f46 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

/* Size helpers */
.btn-xs  { padding: 3px 8px  !important; font-size: 10px !important; }
.btn-xxs { padding: 2px 6px  !important; font-size: 9px  !important; }
.btn-full { width: 100%; display: block; }

/* ----------------------------------------------------------
 * LIVE / BADGE ELEMENTS
 * ---------------------------------------------------------- */
.live-node-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--bg-base);
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid var(--border-faint);
}

/* ----------------------------------------------------------
 * ICON SIZE HELPERS
 * ---------------------------------------------------------- */
.icon-xxs { width: 12px; height: 12px; }
.icon-xs  { width: 15px; height: 15px; }
.icon-sm  { width: 18px; height: 18px; }
.icon-md  { width: 22px; height: 22px; }

/* ----------------------------------------------------------
 * TEXT HELPERS
 * ---------------------------------------------------------- */
.text-xxs  { font-size: 9px; }
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 12px; }

.text-heading { color: var(--text-primary) !important; }
.text-main    { color: var(--text-body)    !important; }
.text-muted   { color: var(--text-dim)     !important; }
.text-white   { color: #e4e4e7             !important; }

/* All accent text helpers resolve to green or grey */
.text-gold    { color: var(--green)   !important; }
.text-green   { color: var(--green)   !important; }
.text-cyan    { color: var(--green)   !important; }
.text-teal    { color: var(--green)   !important; }
.text-amber   { color: var(--green)   !important; }
.text-rose    { color: var(--text-dim) !important; }
.text-blue    { color: var(--green)   !important; }

.font-bold  { font-weight: 700; }
.font-mono  { font-family: 'IBM Plex Mono', monospace; }

/* ----------------------------------------------------------
 * LAYOUT HELPERS
 * ---------------------------------------------------------- */
.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.flex-1          { flex: 1; min-width: 0; min-height: 0; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.p-2  { padding: 8px; }
.p-3  { padding: 12px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.text-center { text-align: center; }
.rounded { border-radius: var(--radius-md); }
.overflow-hidden { overflow: hidden; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; }
.grid-cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ----------------------------------------------------------
 * BG / DARK HELPERS
 * ---------------------------------------------------------- */
.bg-dark   { background: var(--bg-base); }
.border    { border: 1px solid var(--border-faint); }
.border-subtle { border: 1px solid var(--border-faint); }

/* ----------------------------------------------------------
 * VISIBILITY
 * ---------------------------------------------------------- */
.hidden { display: none !important; }

/* ----------------------------------------------------------
 * PROACTIVE BANNER
 * ---------------------------------------------------------- */
.proactive-banner {
  background: rgba(229,169,60,0.07);
  border: 1px solid rgba(229,169,60,0.3);
  border-radius: var(--radius-md);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ----------------------------------------------------------
 * MODAL
 * ---------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,7,6,0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}

.modal-top {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  flex-shrink: 0;
}

.modal-content-area {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.modal-bottom {
  padding: 12px 18px;
  border-top: 1px solid var(--border-faint);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-base);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
 * FORM ELEMENTS
 * ---------------------------------------------------------- */
.form-label-mono {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 5px;
}

.form-input-mono {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.12s ease;
}

.form-input-mono:focus { border-color: var(--border-focus); }

select.form-input-mono { cursor: pointer; }

textarea.form-input-mono { resize: vertical; min-height: 70px; }

/* ----------------------------------------------------------
 * TOAST
 * ---------------------------------------------------------- */
.toast-bar {
  position: fixed;
  bottom: 20px;
  right: 24px;
  background: var(--bg-raised);
  border: 1px solid var(--gold);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 200;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  max-width: 320px;
}

.toast-bar.hidden { display: none; }

/* ----------------------------------------------------------
 * FIND MY VIEW - Google-inspired floating card on map
 * ---------------------------------------------------------- */
.findmy-view-container {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #0a1016;
}

.findmy-map {
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #0a1016;
}

.findmy-map.findmy-map-dark .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(85%) contrast(90%);
}

/* Floating device card */
.findmy-device-card {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 356px;
  max-width: calc(100vw - 40px);
  z-index: 1000;
  background: rgba(18, 24, 30, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 20px 18px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.6);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: cardIn 0.28s var(--ease-out);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.findmy-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.findmy-device-title {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.03em;
  margin: 0;
}

.findmy-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.findmy-icon-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.05);
  color: #94a3b8;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.findmy-icon-btn:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.findmy-icon-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.findmy-icon-btn.spinning i {
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.findmy-address {
  font-size: 12px;
  line-height: 1.55;
  color: #8fa8b2;
  font-weight: 400;
}

.findmy-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
}

.findmy-last-seen { color: #64748b; }

.findmy-battery-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(52,211,153,0.12);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 11px;
}

.findmy-live-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.04em;
  margin-left: auto;
}

/* Action buttons */
.findmy-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.findmy-action-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  text-align: left;
  font-family: inherit;
  outline: none;
}

.findmy-action-card:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.findmy-action-card:active { transform: translateY(0); }

.findmy-action-card:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.findmy-action-card.active-alarm {
  background: rgba(245,158,11,0.18);
  border-color: rgba(245,158,11,0.45);
  animation: alarmPulse 1.4s ease-in-out infinite;
}

@keyframes alarmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.3); }
  50%       { box-shadow: 0 0 0 7px rgba(245,158,11,0); }
}

.findmy-action-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.findmy-action-icon.bg-green { background: #15803d; }
.findmy-action-icon.bg-blue  { background: #1c7a52; }
.findmy-action-icon.bg-teal  { background: #15803d; }

.findmy-action-title {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.findmy-action-sub {
  font-size: 10px;
  color: #64748b;
  display: block;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.findmy-action-info {
  flex: 1;
  min-width: 0;
}

/* Location History card */
.findmy-history-container {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 14px;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.findmy-history-container:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.1);
}

.findmy-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 13px;
  cursor: pointer;
  user-select: none;
}

.findmy-history-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}

.findmy-history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.findmy-history-right {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  margin-left: 8px;
}

.findmy-history-pill {
  font-size: 10px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(52,211,153,0.25);
  padding: 3px 9px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.findmy-history-pill.active-route {
  background: var(--green-mid);
  border-color: var(--green);
  color: var(--green);
}

.findmy-history-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.findmy-history-container.open .findmy-history-chevron {
  transform: rotate(90deg);
}

/* Expandable timeline drawer */
.findmy-history-timeline {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 13px;
  background: rgba(0,0,0,0.25);
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.findmy-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.findmy-timeline-clear {
  background: none;
  border: none;
  color: #4b6577;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.12s ease;
}

.findmy-timeline-clear:hover { color: #f87171; }

.findmy-history-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}

.findmy-history-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.findmy-history-item:last-child { border-bottom: none; }

.findmy-history-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-top: 5px;
  flex-shrink: 0;
}

.findmy-history-dot.stop-dot { background: #8a9e97; }

.findmy-history-time {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #64748b;
  width: 44px;
  flex-shrink: 0;
  margin-top: 1px;
}

.findmy-history-place {
  color: #cbd5e1;
  flex: 1;
  word-break: break-word;
  line-height: 1.4;
}

/* Top-right map controls */
.findmy-map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.findmy-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(18,24,30,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #cbd5e1;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.findmy-ctrl-btn:hover {
  background: rgba(30,41,59,0.98);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
}

.findmy-ctrl-btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.findmy-ctrl-btn.pulse-glow {
  border-color: var(--blue);
  color: var(--blue);
}

.findmy-zoom-group {
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.findmy-zoom-group .findmy-ctrl-btn {
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.findmy-zoom-group .findmy-ctrl-btn:first-child {
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

/* Leaflet marker */
.findmy-marker-pin {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.findmy-marker-core {
  width: 24px;
  height: 24px;
  background: #15803d;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
}

.findmy-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(52,211,153,0.2);
  animation: radarPulse 2.4s ease-out infinite;
  pointer-events: none;
  z-index: 1;
}

@keyframes radarPulse {
  0%   { transform: translate(-50%,-50%) scale(0.4); opacity: 0.85; }
  100% { transform: translate(-50%,-50%) scale(1.7); opacity: 0; }
}

/* Mobile Find My */
@media (max-width: 768px) {
  .findmy-device-card {
    top: auto;
    bottom: 14px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    border-radius: 18px;
    padding: 16px 14px;
    max-height: 56vh;
    overflow-y: auto;
  }

  .findmy-map-controls {
    top: 14px;
    right: 14px;
  }
}

/* ----------------------------------------------------------
 * SPARKLINE
 * ---------------------------------------------------------- */
.sparkline-box {
  height: 48px;
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
}

/* ----------------------------------------------------------
 * MINI BAR (inline)
 * ---------------------------------------------------------- */
.mini-bar {
  display: inline-block;
  height: 5px;
  background: var(--gold);
  border-radius: 1px;
  vertical-align: middle;
}

/* ----------------------------------------------------------
 * KEYBOARD FOCUS - all interactive elements
 * ---------------------------------------------------------- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* flash-live: momentary highlight when live GPS data arrives (marks real state) */
.findmy-live-tag.flash-live {
  color: var(--blue);
}

/* disabled state for buttons */
button:disabled,
.btn-terminal:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------
 * TOKEN USAGE & MULTI-ROUTER MONITORING STYLES
 * ---------------------------------------------------------- */
.text-purple {
  color: #c084fc !important;
}

/* 9ROUTER-STYLE TOPOLOGY MASTER PANEL */
.topo-master-panel {
  background: #080d17 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding: 16px !important;
  overflow: hidden;
}

.topo-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.topo-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  letter-spacing: 0.05em;
}

.topo-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  min-height: 480px;
}

@media (max-width: 1080px) {
  .topo-dashboard-layout {
    grid-template-columns: 1fr;
  }
}

.topo-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 480px;
  min-height: 480px;
  background: 
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, rgba(5, 8, 14, 0.95) 75%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    #05080e;
  background-size: 100% 100%, 32px 32px, 32px 32px, auto;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-card);
  overflow: hidden;
  user-select: none;
}

.topo-connections-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  overflow: visible;
}

/* SVG Connection Links */
.topo-link-base {
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 2px;
  fill: none;
  stroke-dasharray: 4 4;
  transition: stroke 0.3s ease;
}

.topo-link-active {
  fill: none;
  stroke: #10b981;
  stroke-width: 4.5px;
  stroke-linecap: round;
  stroke-dasharray: 12 8;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

@keyframes flowGreenEnergy {
  from {
    stroke-dashoffset: 40;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.topo-link-active.is-active {
  opacity: 1 !important;
  visibility: visible !important;
  stroke: #10b981 !important;
  stroke-width: 4.5px !important;
  stroke-linecap: round !important;
  stroke-dasharray: 12 8 !important;
  animation: flowGreenEnergy 0.6s linear infinite !important;
  filter: drop-shadow(0 0 8px #10b981) drop-shadow(0 0 16px rgba(16, 185, 129, 0.95)) !important;
}

/* Energy Particle traveling along path */
.topo-energy-particle {
  fill: #34d399;
  filter: drop-shadow(0 0 8px #10b981) drop-shadow(0 0 16px rgba(16, 185, 129, 0.95));
}

/* SVG Interactive Nodes */
.topo-svg-node {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), filter 0.2s ease;
  pointer-events: all;
  user-select: none;
}

.topo-svg-node:hover {
  filter: brightness(1.2);
}

.topo-svg-node .node-box {
  transition: stroke 0.3s ease, fill 0.3s ease, filter 0.3s ease;
}

.topo-svg-node.is-active .node-box {
  stroke: #10b981 !important;
  stroke-width: 2.5px !important;
  fill: #06281e !important;
  filter: drop-shadow(0 0 12px rgba(16, 185, 129, 0.8)) !important;
}

.topo-svg-node.is-active .node-title {
  fill: #34d399 !important;
  font-weight: 800;
}

.topo-svg-node.is-active .node-sub {
  fill: #10b981 !important;
}

/* Central Router Node */
.topo-hub-node {
  cursor: pointer;
}

.topo-hub-node .hub-box {
  transition: stroke 0.25s ease, filter 0.25s ease;
}

.topo-hub-node.is-active .hub-box {
  stroke: #10b981 !important;
  filter: drop-shadow(0 0 16px rgba(16, 185, 129, 0.85)) drop-shadow(0 0 30px rgba(16, 185, 129, 0.4)) !important;
}

.topo-node-center .hub-badge {
  background: #f59e0b;
  color: #000;
  font-weight: 900;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topo-node-center .hub-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.topo-node-center.is-active {
  border-color: #10b981;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.6), 0 0 60px rgba(16, 185, 129, 0.3);
  animation: hubHeartbeat 1.2s ease-in-out infinite;
}

@keyframes hubHeartbeat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.04); }
}

/* Provider Radial Nodes */
.topo-node-provider {
  background: rgba(13, 20, 34, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.topo-node-provider:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(20, 30, 50, 0.95);
}

.topo-node-provider.is-active {
  border-color: #10b981 !important;
  background: rgba(6, 44, 28, 0.95) !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.55), 0 0 40px rgba(16, 185, 129, 0.25) !important;
}

.topo-node-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topo-node-info {
  display: flex;
  flex-direction: column;
}

.topo-node-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.topo-node-meta {
  font-size: 9px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-dim);
  white-space: nowrap;
}

.topo-node.is-active .topo-node-meta {
  color: #34d399;
  font-weight: 600;
}

/* Controls */
.topo-controls {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.topo-ctrl-btn {
  width: 28px;
  height: 28px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.topo-ctrl-btn:hover {
  background: var(--bg-hover);
  border-color: var(--green);
  color: var(--green);
}

.topo-active-route-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(6, 44, 28, 0.95);
  border: 1px solid #10b981;
  color: #34d399;
  padding: 5px 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  z-index: 10;
  animation: fadeIn 0.2s ease;
}

/* Side Panel Recent Requests */
.topo-recent-requests-panel {
  background: #090e18;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 480px;
  overflow: hidden;
}

.topo-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
}

.topo-recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex: 1;
  padding-right: 2px;
}

.topo-recent-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 11px;
  background: rgba(13, 20, 36, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.topo-recent-item:hover {
  background: rgba(22, 33, 56, 0.85);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(3px);
}

.topo-recent-item.active-pulse {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25);
}

.topo-recent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topo-prov-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 4px;
  border: 1px solid;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.topo-model-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 145px;
}

.topo-recent-when {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #64748b;
  flex-shrink: 0;
}

.topo-recent-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topo-token-chips {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tok-chip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tok-chip.in {
  color: #94a3b8;
}

.tok-chip.in .tok-arrow {
  color: #38bdf8;
  font-weight: 700;
}

.tok-chip.out {
  color: #94a3b8;
}

.tok-chip.out .tok-arrow {
  color: #34d399;
  font-weight: 700;
}

.topo-live-dot-tag {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topo-micro-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}

.topo-routed-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #475569;
  text-transform: uppercase;
}

.tokens-kpi-strip {
  grid-template-columns: repeat(4, 1fr) !important;
  margin-bottom: 14px;
}

@media (max-width: 1100px) {
  .tokens-kpi-strip { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 600px) {
  .tokens-kpi-strip { grid-template-columns: 1fr !important; }
}

.tokens-kpi-card {
  cursor: default;
}

.tokens-control-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.tokens-filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-card);
}

.filter-chip.active {
  background: var(--green-dim);
  border-color: var(--green);
  color: var(--green);
}

.tokens-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tokens-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.tokens-search-wrap .icon-xs {
  position: absolute;
  left: 10px;
  pointer-events: none;
}

.tokens-search-input {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  color: var(--text-primary);
  padding: 6px 12px 6px 30px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  width: 220px;
  transition: border-color 0.15s ease;
}

.tokens-search-input:focus {
  border-color: var(--green);
  outline: none;
}

.tokens-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.token-model-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.token-model-card:hover {
  background: var(--bg-hover);
  border-color: var(--border-card);
}

.token-model-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.token-model-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.token-model-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.4;
}

.token-provider-pill {
  font-size: 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}

.token-stat-main {
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.token-stat-val-out {
  font-size: 18px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  color: #c084fc;
}

.token-stat-sub-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
}

.token-stat-sub-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-faint);
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.token-stat-sub-item span.label {
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.token-stat-sub-item span.val {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  color: var(--text-body);
}

.token-progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.token-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-base);
  border-radius: 3px;
  overflow: hidden;
}

.token-progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ----------------------------------------------------------
 * AUTH GATE / LOGIN SCREEN STYLES
 * ---------------------------------------------------------- */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(6, 14, 11, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(18px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-gate-overlay.authenticated {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(52, 211, 153, 0.15);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-gate-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.auth-logo-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  margin-bottom: 4px;
}

.auth-logo-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--green);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.3);
}

.auth-brand-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.08em;
}

.auth-brand-sub {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.auth-sec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-dim);
  border: 1px solid rgba(52, 211, 153, 0.2);
  padding: 3px 8px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-user-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-base);
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-body);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-icon-left {
  position: absolute;
  left: 12px;
  pointer-events: none;
}

.auth-input {
  width: 100%;
  padding: 10px 40px 10px 38px !important;
  font-size: 13px !important;
}

.auth-pass-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.auth-pass-toggle:hover i {
  color: var(--text-primary);
}

.auth-remember-row {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

.auth-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  accent-color: var(--green);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.auth-error-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 11px;
  color: #f87171;
  font-family: 'IBM Plex Mono', monospace;
  animation: authShake 0.3s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-submit-btn {
  width: 100%;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-footer-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}

.auth-footer-notice code {
  background: var(--bg-base);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--green);
  border: 1px solid var(--border-faint);
}

/* ============================================================
   PROVIDERS & CUSTOM ROUTER STYLES (9ROUTER STYLE)
   ============================================================ */
/* ============================================================
   PROVIDERS & CUSTOM ROUTER STYLES (CLEAN MINIMALIST)
   ============================================================ */
.providers-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card, 8px);
}

.providers-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.providers-header-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm, 4px);
  background: var(--bg-raised);
  border: 1px solid var(--border-card);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
}

.providers-header-text h2 {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.2;
}

.providers-header-text p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 2px 0 0 0;
  font-family: inherit;
}

.providers-actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.providers-search-box {
  position: relative;
  width: 220px;
}

.providers-search-input {
  width: 100%;
  height: 36px;
  background: var(--bg-raised);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm, 4px);
  padding: 0 12px 0 32px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.providers-search-input:focus {
  border-color: var(--border-focus);
}

.providers-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  pointer-events: none;
}

.providers-filter-select {
  height: 36px;
  background: var(--bg-raised);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm, 4px);
  padding: 0 24px 0 12px;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}

.providers-filter-select:focus {
  border-color: var(--border-focus);
}

.btn-add-anthropic-9r {
  height: 36px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn-add-anthropic-9r:hover {
  background: var(--bg-hover);
  border-color: #3f424f;
  color: #e4e4e7;
}

.btn-add-openai-9r {
  height: 36px;
  background: #27272a !important;
  color: #e4e4e7 !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm, 6px);
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #3f3f46 !important;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-add-openai-9r:hover {
  background: #3f3f46 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

.btn-test-all-9r {
  background: var(--bg-raised);
  border: 1px solid var(--border-card);
  color: var(--text-body);
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-test-all-9r:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.providers-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  margin-bottom: 12px;
}

.providers-section-title {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 4-COLUMN TILES GRID */
.providers-grid-4col {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px !important;
  width: 100% !important;
}

@media (max-width: 1350px) {
  .providers-grid-4col {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 950px) {
  .providers-grid-4col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .providers-grid-4col {
    grid-template-columns: 1fr !important;
  }
}

/* COMPACT CLEAN CARD TILE */
.provider-tile-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-card, 8px) !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 64px !important;
  height: 64px !important;
  cursor: pointer !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
  box-sizing: border-box !important;
  position: relative !important;
  box-shadow: none !important;
}

.provider-tile-card:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border-focus) !important;
  transform: none !important;
  box-shadow: none !important;
}

.provider-tile-logo {
  width: 36px !important;
  height: 36px !important;
  border-radius: var(--radius-sm, 4px) !important;
  background: var(--bg-raised) !important;
  border: 1px solid var(--border-faint) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  box-shadow: none !important;
}

.provider-tile-logo svg,
.provider-tile-logo img {
  width: 18px !important;
  height: 18px !important;
}

.provider-tile-info {
  flex: 1 !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

.provider-tile-title {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.provider-tile-status {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  margin-top: 4px !important;
}

.provider-tile-dot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.provider-tile-dot.connected {
  background: var(--green) !important;
  box-shadow: none !important;
}

.provider-tile-dot.disabled {
  background: var(--text-muted) !important;
}

.provider-tile-conn {
  color: var(--green) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
}

.provider-tile-no-conn {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
}

.provider-tile-tag {
  font-size: 10px !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  color: var(--text-dim) !important;
  background: var(--bg-raised) !important;
  border: 1px solid var(--border-card) !important;
  padding: 1px 6px !important;
  border-radius: 3px !important;
  margin-left: 2px !important;
}

.provider-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.provider-card:hover {
  border-color: var(--cyan, #06b6d4);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(6, 182, 212, 0.15);
}

.provider-card.active-system {
  border-left: 3px solid var(--green, #10b981);
}

.provider-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.provider-badge-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ============================================================
   PROVIDER DETAIL VIEW (CLEAN MINIMALIST)
   ============================================================ */
#providerDetailSection {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

#providerDetailSection.hidden {
  display: none !important;
}

#providersOverviewSection {
  display: flex !important;
  flex-direction: column !important;
  gap: 24px !important;
}

#providersOverviewSection.hidden {
  display: none !important;
}

.provider-detail-top-nav {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 2px !important;
}

.provider-detail-banner {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 16px 20px !important;
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-card, 8px) !important;
  margin-bottom: 0 !important;
  flex-wrap: wrap !important;
}

.provider-detail-main {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
}

.detail-provider-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: var(--radius-sm, 4px) !important;
  background: var(--bg-raised) !important;
  border: 1px solid var(--border-faint) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  color: var(--green) !important;
}

.detail-provider-avatar svg {
  width: 24px !important;
  height: 24px !important;
}

.detail-provider-headings {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
}

.detail-provider-title-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.detail-provider-title-row h2 {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  line-height: 1.2 !important;
}

.detail-provider-badge {
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  background: #242630 !important;
  border: 1px solid #333642 !important;
  color: #e2e8f0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
}

.detail-provider-sub {
  font-size: 11px !important;
  color: var(--text-dim) !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  margin: 0 !important;
}

.provider-detail-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

.provider-detail-actions button,
.models-add-actions button {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.endpoint-box {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 12px 14px !important;
  background: #111216 !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 12px !important;
  flex-wrap: wrap !important;
}

.endpoint-info {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

.endpoint-url {
  color: #38bdf8 !important;
  font-weight: 600 !important;
  word-break: break-all !important;
}

.models-add-bar {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  background: #14151a !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-sm, 6px) !important;
  margin-bottom: 14px !important;
}

@media (min-width: 768px) {
  .models-add-bar {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
}

.models-add-fields {
  display: flex !important;
  gap: 8px !important;
  flex: 1 !important;
  flex-wrap: wrap !important;
}

.models-add-fields input {
  flex: 1 !important;
  min-width: 180px !important;
}

.models-add-actions {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
  flex-wrap: wrap !important;
}

.form-input-mono {
  background: #0f1013 !important;
  border: 1px solid var(--border-card) !important;
  color: var(--text-primary) !important;
  height: 36px !important;
  padding: 0 12px !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  font-size: 12px !important;
  border-radius: var(--radius-sm, 6px) !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: border-color 0.15s ease !important;
}

.form-input-mono:focus {
  border-color: #52525b !important;
}

.provider-keys-container,
.provider-models-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.key-item-row,
.model-item-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 10px 14px !important;
  background: #14151a !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-sm, 6px) !important;
  font-family: var(--font-mono, 'IBM Plex Mono', monospace) !important;
  flex-wrap: wrap !important;
  transition: border-color 0.15s ease, background 0.15s ease !important;
}

.key-item-row:hover,
.model-item-row:hover {
  background: #1a1c23 !important;
  border-color: #383b48 !important;
}

.model-item-row.is-active-core {
  border-color: #52525b !important;
  background: #1e2027 !important;
}

.btn-terminal-danger {
  color: #a1a1aa !important;
  border-color: #27272a !important;
  background: #18181b !important;
}

.btn-terminal-danger:hover {
  background: #27272a !important;
  border-color: #71717a !important;
  color: #f4f4f5 !important;
}

/* ============================================================
   GLOBAL SOFT MONOCHROME (OFF-WHITE & MATTE DARK)
   ============================================================ */
.text-cyan, .text-green, .text-gold, .text-amber, .text-blue,
.text-purple, .text-emerald, .text-emerald-400, .text-emerald-500,
.text-green-400, .text-cyan-400, .text-purple-400, .text-amber-400, .text-amber-500,
.stat-highlight, .stat-green, .stat-cyan, .text-primary,
h1, h2, h3, h4 {
  color: #e4e4e7 !important; /* soft off-white, no harsh blinding glare */
}

.text-rose, .text-rose-400, .text-red, .text-red-400 {
  color: #a1a1aa !important;
}

.online-dot {
  background: #a1a1aa !important;
  box-shadow: none !important;
}

.online-tag {
  background: #18181b !important;
  border: 1px solid #27272a !important;
  color: #d4d4d8 !important;
}

.metric-badge {
  background: #18181b !important;
  border: 1px solid #27272a !important;
  color: #d4d4d8 !important;
}

.deck-tab.active {
  color: #e4e4e7 !important;
  border-bottom-color: #71717a !important;
}

.deck-tab.active .tab-count-badge {
  background: #27272a !important;
  color: #e4e4e7 !important;
  border: 1px solid #3f3f46 !important;
  font-weight: 600 !important;
}

.bar-gold, .bar-green, .bar-cyan {
  background: #a1a1aa !important;
}

.badge-status, .panel-badge {
  background: #18181b !important;
  border: 1px solid #27272a !important;
  color: #d4d4d8 !important;
}

.proactive-banner {
  background: #121215 !important;
  border: 1px solid #27272a !important;
  color: #e4e4e7 !important;
}

.chip-item {
  background: #18181b !important;
  border: 1px solid #27272a !important;
  color: #a1a1aa !important;
}
.chip-item:hover {
  background: #27272a !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
}

.btn-terminal {
  border-radius: 5px !important;
}

.btn-terminal:hover {
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}

.btn-terminal-primary {
  background: #27272a !important;
  color: #e4e4e7 !important;
  border: 1px solid #3f3f46 !important;
  font-weight: 600 !important;
}

.btn-terminal-primary:hover {
  background: #3f3f46 !important;
  border-color: #52525b !important;
  color: #f4f4f5 !important;
}





