/* ==========================================================
 * 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-card);
  flex-shrink: 0;
  background: rgba(10, 10, 13, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.header-left-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none !important;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

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

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

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

.online-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(16, 185, 129, 0.08);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.22);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.online-dot-pulse {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
  flex-shrink: 0;
}

.online-dot-pulse::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  animation: pulseRing 2.2s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes pulseRing {
  0% { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

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

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

/* ----------------------------------------------------------
 * DASHBOARD CONTENT SCROLL AREA
 * ---------------------------------------------------------- */
.dashboard-content {
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ----------------------------------------------------------
 * PROACTIVE BANNER
 * ---------------------------------------------------------- */
.proactive-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(24, 24, 28, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-card);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.08);
}

.status-dot-amber {
  width: 7px;
  height: 7px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
  flex-shrink: 0;
}

/* ----------------------------------------------------------
 * METRIC STRIP - 5 MODERN AESTHETIC TILES
 * ---------------------------------------------------------- */
.metrics-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  flex-shrink: 0;
  width: 100%;
}

@media (max-width: 768px) {
  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

.metric-card {
  background: linear-gradient(180deg, rgba(22, 22, 27, 0.75) 0%, rgba(14, 14, 18, 0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.22s ease,
              box-shadow 0.22s ease,
              background 0.22s ease;
  min-width: 0;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.metric-card:nth-child(1) { animation-delay: 0.04s; }
.metric-card:nth-child(2) { animation-delay: 0.08s; }
.metric-card:nth-child(3) { animation-delay: 0.12s; }
.metric-card:nth-child(4) { animation-delay: 0.16s; }
.metric-card:nth-child(5) { animation-delay: 0.20s; }

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
  opacity: 0.8;
}

.metric-card:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(30, 30, 36, 0.85) 0%, rgba(18, 18, 22, 0.85) 100%);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.06);
}

.metric-card:active {
  transform: scale(0.98);
}

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

.metric-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-box i {
  width: 15px;
  height: 15px;
}

.metric-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-transform: uppercase;
}

.metric-value {
  font-size: 19px;
  font-weight: 700;
  color: #f4f4f5;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

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

.metric-sub {
  font-size: 10.5px;
  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 - MODERN SEGMENTED CONTROLS
 * ---------------------------------------------------------- */
.deck-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 440px;
  background: linear-gradient(180deg, rgba(20, 20, 25, 0.75) 0%, rgba(13, 13, 17, 0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.deck-tabs-header {
  background: rgba(10, 10, 14, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 12px;
}

.deck-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.deck-tabs::-webkit-scrollbar {
  display: none;
}

.deck-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 13px;
  color: #71717a;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
}

.deck-tab:hover {
  color: #d4d4d8;
  background: rgba(255, 255, 255, 0.04);
}

.deck-tab.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tab-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  color: #a1a1aa;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 12px;
  min-width: 18px;
  transition: all 0.2s ease;
}

.deck-tab.active .tab-count-badge {
  background: #10b981;
  color: #041f14;
}

.deck-content {
  padding: 16px;
  overflow-y: auto;
  max-height: 330px;
}

.deck-content.active {
  animation: tabContentIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ----------------------------------------------------------
 * HABIT QUICK BUTTONS
 * ---------------------------------------------------------- */
.btn-habit-quick {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.btn-habit-quick:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-habit-quick:active {
  transform: scale(0.98);
}

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

/* ----------------------------------------------------------
 * INLINE COMMAND CARD
 * ---------------------------------------------------------- */
.inline-command-card {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(22, 22, 27, 0.75) 0%, rgba(14, 14, 18, 0.75) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-card);
  padding: 16px 18px;
}

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

.chip-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  padding: 5px 12px;
  font-family: inherit;
  font-size: 10.5px;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.chip-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f4f4f5;
  transform: translateY(-1px);
}

.chip-item:active {
  transform: scale(0.97);
}

.inline-result-box {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(9, 9, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-height: 240px;
  overflow-y: auto;
  animation: fadeInUp 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ----------------------------------------------------------
 * STERILE DIRECT AI CHAT & FULLSCREEN VIEW
 * ---------------------------------------------------------- */
body.chat-view-mode .top-header,
body.chat-view-mode .mobile-bottom-nav,
body.chat-view-mode #mobileBottomNav {
  display: none !important;
}

body.chat-view-mode .sidebar .nav-group,
body.chat-view-mode .sidebar .sidebar-bottom-info,
.sidebar .nav-group.chat-hidden,
.sidebar .sidebar-bottom-info.chat-hidden {
  display: none !important;
}

body.chat-view-mode .sidebar {
  width: 260px;
  background: #09090c;
  border-right: 1px solid #1f1f24;
}

body.chat-view-mode .main-viewport {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  width: calc(100vw - 260px) !important;
  padding: 0 !important;
}

@media (max-width: 768px) {
  body.chat-view-mode .sidebar {
    display: none !important;
  }
  body.chat-view-mode .main-viewport {
    width: 100vw !important;
  }
}

/* SIDEBAR CHAT CONTROLS (TANDA PANAH KELUAR) */
.sidebar-chat-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px;
}

.sidebar-exit-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #f4f4f5;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-exit-btn:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #52525b;
  transform: translateX(-2px);
}

.sidebar-chat-card {
  background: #111115;
  border: 1px solid #202026;
  border-radius: 10px;
  padding: 12px 14px;
}

.btn-sidebar-chat-action {
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 8px;
  color: #e4e4e7;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-chat-action:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #3f3f46;
}

/* SIDEBAR CHAT SESSIONS LIST */
.sidebar-chat-sessions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  margin-top: 4px;
}

.sidebar-sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 2px;
}

.sidebar-sessions-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  color: #71717a;
  letter-spacing: 0.06em;
}

.sidebar-sessions-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #a1a1aa;
  padding: 1px 6px;
  border-radius: 10px;
}

.sidebar-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  max-height: 260px;
  padding-right: 2px;
}

.sidebar-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  background: #101014;
  border: 1px solid #1c1c22;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-session-item:hover {
  background: #18181f;
  border-color: #272730;
  color: #ffffff;
}

.sidebar-session-item.active {
  background: #18181f;
  border-color: #52525b;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.04);
}

.sidebar-session-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.sidebar-session-title {
  font-size: 11.5px;
  font-weight: 500;
  color: #d4d4d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-session-item.active .sidebar-session-title {
  color: #ffffff;
  font-weight: 600;
}

.sidebar-session-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #71717a;
}

.sidebar-session-del {
  opacity: 0;
  background: transparent;
  border: none;
  color: #71717a;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 6px;
}

.sidebar-session-item:hover .sidebar-session-del {
  opacity: 1;
}

.sidebar-session-del:hover {
  color: #f43f5e;
  background: rgba(244, 63, 94, 0.1);
}

/* MODAL SESSIONS LIST (POPUP / MOBILE) */
.modal-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #121216;
  border: 1px solid #222228;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-session-item:hover {
  background: #1a1a22;
  border-color: #383844;
}

.modal-session-item.active {
  background: #18181f;
  border-color: #52525b;
}

.sidebar-chat-meta {
  padding-top: 6px;
}

.sidebar-model-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #141418;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #a1a1aa;
}

/* CHAT FULLSCREEN VIEW CANVAS */
.chat-fullscreen-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  width: 100%;
  background: #070709;
  overflow: hidden;
  position: relative;
}

.chat-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: #0d0d10;
  border-bottom: 1px solid #1c1c20;
  flex-shrink: 0;
  min-height: 52px;
  z-index: 20;
}

.chat-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-chat-exit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 5px 10px;
  color: #d4d4d8;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chat-exit:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #3f3f46;
  transform: translateX(-2px);
}

.chat-title-info {
  display: flex;
  flex-direction: column;
}

.chat-node-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
}

.chat-avatar-mini {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #27272a;
  flex-shrink: 0;
}

.chat-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.chat-node-desc {
  font-size: 9.5px;
  color: #71717a;
  font-family: 'IBM Plex Mono', monospace;
}

.chat-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-model-locked-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #141418;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 4px 9px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 0.04em;
  user-select: none;
}

.chat-model-selector-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #141418;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 4px 8px;
}

.chat-model-select {
  background: transparent;
  color: #d4d4d8;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  border: none;
  outline: none;
  cursor: pointer;
}

.btn-chat-action {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 5px 9px;
  color: #a1a1aa;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-chat-action:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #3f3f46;
}

/* CHAT MESSAGES SCROLL CONTAINER */
.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  scroll-behavior: smooth;
}

/* WELCOME HERO & SUGGESTIONS */
.chat-welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 580px;
  margin: auto;
  padding: 30px 16px;
  gap: 12px;
}

.chat-welcome-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid #27272a;
  overflow: hidden;
  background: #111115;
}

.chat-welcome-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-welcome-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0;
}

.chat-welcome-sub {
  font-size: 12.5px;
  color: #a1a1aa;
  line-height: 1.5;
  margin: 0;
}

.chat-welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 540px) {
  .chat-welcome-suggestions {
    grid-template-columns: 1fr;
  }
}

.chat-welcome-chip {
  background: #111115;
  border: 1px solid #222228;
  border-radius: 10px;
  padding: 12px 14px;
  color: #d4d4d8;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.chat-welcome-chip:hover {
  background: #18181f;
  border-color: #3f3f46;
  color: #ffffff;
  transform: translateY(-1px);
}

/* CHAT MESSAGE ROWS & BUBBLES */
.chat-msg-row {
  display: flex;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  gap: 10px;
  animation: fadeIn 0.15s ease;
}

.chat-msg-row.user {
  justify-content: flex-end;
}

.chat-msg-row.ai {
  justify-content: flex-start;
}

.chat-avatar-ai {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid #27272a;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-avatar-ai img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-bubble-user {
  background: #1a1a20;
  border: 1px solid #2d2d38;
  border-radius: 14px 14px 4px 14px;
  padding: 10px 14px;
  color: #f4f4f5;
  max-width: 80%;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.chat-bubble-ai {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0 4px 4px 4px;
  color: #ececf1;
  max-width: 88%;
  flex: 1;
  font-size: 13.5px;
  line-height: 1.6;
  word-break: break-word;
}

.chat-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  border-bottom: none;
  padding-bottom: 0;
}

.chat-sender-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

.chat-msg-time {
  font-size: 9px;
  color: #71717a;
  font-family: 'IBM Plex Mono', monospace;
}

.chat-bubble-text {
  font-size: 13px;
  line-height: 1.55;
}

.chat-bubble-text p {
  margin: 0 0 8px 0;
}

.chat-bubble-text p:last-child {
  margin-bottom: 0;
}

.chat-bubble-text pre {
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  margin: 8px 0;
}

.chat-bubble-text code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  background: #18181b;
  padding: 2px 5px;
  border-radius: 4px;
  color: #e4e4e7;
}

.chat-bubble-text pre code {
  background: transparent;
  padding: 0;
}

/* Markdown Tables in Chat */
.chat-bubble-text table,
.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 12px;
  background: #0d0d12;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #27272a;
}

.chat-bubble-text th,
.markdown-body th {
  background: #17171e;
  color: #ffffff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid #27272a;
}

.chat-bubble-text td,
.markdown-body td {
  padding: 8px 12px;
  border-bottom: 1px solid #1c1c24;
  color: #d4d4d8;
}

.chat-bubble-text tr:last-child td,
.markdown-body tr:last-child td {
  border-bottom: none;
}

.chat-bubble-text tr:hover td,
.markdown-body tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.chat-bubble-text ul,
.markdown-body ul,
.chat-bubble-text ol,
.markdown-body ol {
  margin: 6px 0 10px 20px;
  padding: 0;
}

.chat-bubble-text li,
.markdown-body li {
  margin-bottom: 4px;
}

.chat-thinking-shine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  user-select: none;
}

.thinking-shine-sparkle {
  color: #10b981;
  font-size: 13px;
  line-height: 1;
  animation: sparkleGlow 1.8s infinite ease-in-out;
}

.thinking-shine-text {
  font-family: 'IBM Plex Mono', -apple-system, BlinkMacSystemFont, monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: linear-gradient(
    90deg,
    rgba(140, 140, 150, 0.4) 0%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(140, 140, 150, 0.4) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: orionShine 2.2s infinite linear;
}

@keyframes orionShine {
  0% {
    background-position: 150% 0;
  }
  100% {
    background-position: -150% 0;
  }
}

@keyframes sparkleGlow {
  0%, 100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

/* QUICK PROMPTS CHIPS STRIP */
.chat-quick-prompts {
  display: flex;
  gap: 8px;
  padding: 6px 20px 8px;
  overflow-x: auto;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  scrollbar-width: none;
}

.chat-quick-prompts::-webkit-scrollbar {
  display: none;
}

.chat-prompt-chip {
  background: #111115;
  border: 1px solid #222228;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 10.5px;
  color: #a1a1aa;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  transition: all 0.12s ease;
  font-family: 'IBM Plex Mono', monospace;
}

.chat-prompt-chip:hover {
  background: #1c1c22;
  border-color: #3f3f46;
  color: #ffffff;
}

/* BOTTOM CHAT INPUT BAR */
.chat-input-bar {
  padding: 8px 20px 14px;
  background: #0a0a0d;
  border-top: 1px solid #1c1c20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.chat-input-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #131317;
  border: 1px solid #25252b;
  border-radius: 12px;
  padding: 8px 12px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  transition: border-color 0.15s ease;
}

.chat-input-container:focus-within {
  border-color: #3f3f46;
  background: #15151a;
}

.chat-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #f4f4f5;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  max-height: 140px;
  min-height: 24px;
  outline: none;
  padding: 3px 2px;
}

.chat-textarea::placeholder {
  color: #71717a;
  font-size: 12px;
}

.btn-chat-send {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #ffffff;
  color: #09090b;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.btn-chat-send:hover {
  background: #e4e4e7;
  transform: scale(1.04);
}

.btn-chat-send:disabled {
  background: #27272a;
  color: #52525b;
  cursor: not-allowed;
  transform: none;
}

.chat-input-footer {
  text-align: center;
  font-size: 9px;
  color: #52525b;
  font-family: 'IBM Plex Mono', monospace;
}

/* Image Attachment & Preview in Chat */
.btn-chat-attach {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  color: #a1a1aa;
  border: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.btn-chat-attach:hover {
  background: #1e1e24;
  color: #ffffff;
  border-color: #3f3f46;
}

.chat-image-preview-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #121217;
  border: 1px solid #27272a;
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.chat-preview-thumb-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #3f3f46;
  flex-shrink: 0;
}

.chat-preview-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-remove-preview {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.8);
  color: #f43f5e;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  padding: 0;
}

.btn-remove-preview:hover {
  background: #f43f5e;
  color: #ffffff;
}

.chat-preview-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.chat-preview-name {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview-size {
  font-size: 10px;
  color: #71717a;
  font-family: 'IBM Plex Mono', monospace;
}

/* Chat Media / Screenshot Proof Cards */
.chat-media-card {
  margin-top: 10px;
  border-radius: 8px;
  background: #09090b;
  border: 1px solid #27272a;
  overflow: hidden;
  max-width: 540px;
}

.chat-media-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #141418;
  border-bottom: 1px solid #222228;
}

.chat-media-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #10b981;
}

.chat-media-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #a1a1aa;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.chat-media-preview-wrap {
  position: relative;
  cursor: pointer;
  background: #000000;
  display: block;
}

.chat-media-img {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.chat-media-preview-wrap:hover .chat-media-img {
  opacity: 0.92;
}

.chat-media-overlay {
  position: absolute;
  bottom: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chat-media-preview-wrap:hover .chat-media-overlay {
  opacity: 1;
}

.btn-zoom-media {
  background: rgba(18, 18, 23, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid #3f3f46;
  color: #ffffff;
  padding: 5px 10px;
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.btn-zoom-media:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

/* User attached image thumbnail */
.chat-user-media-wrap {
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #3f3f46;
  max-width: 320px;
  cursor: pointer;
}

.chat-user-media-wrap img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

/* Lightbox Modal */
.chat-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.chat-lightbox-modal.hidden {
  display: none !important;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  position: relative;
  z-index: 10;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: #111116;
  border: 1px solid #27272a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85);
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #18181f;
  border-bottom: 1px solid #27272a;
  gap: 16px;
}

.lightbox-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.lightbox-image-wrap {
  padding: 12px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #09090b;
}

.lightbox-image-wrap img {
  max-width: 100%;
  max-height: calc(85vh - 70px);
  object-fit: contain;
  border-radius: 6px;
}

/* ----------------------------------------------------------
 * 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, .select-field {
  cursor: pointer;
  background-color: #121316 !important;
  color: #f4f4f5 !important;
  border: 1px solid var(--border-subtle, #27272a);
}

select.form-input-mono option, .select-field option {
  background-color: #18181b !important;
  color: #f4f4f5 !important;
  padding: 6px 8px;
}

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-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(15, 23, 42, 0.7) !important;
  border-color: rgba(244, 63, 94, 0.45) !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;
}

/* ==========================================================
 * USAGE ANALYTICS & SOURCE TELEMETRY STYLES (OBSIDIAN MINIMALIST)
 * ========================================================== */
.analytics-chart-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
}

.analytics-chart-container {
  height: 260px;
  width: 100%;
  position: relative;
  background: #060608;
  border: 1px solid var(--border-faint);
  border-radius: var(--radius-sm);
  padding: 8px 12px 14px 12px;
}

.analytics-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: #141418;
  border: 1px solid var(--border-card);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.8), 0 0 15px rgba(6, 182, 212, 0.12);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  z-index: 40;
  min-width: 160px;
  transform: translate(-50%, -115%);
  transition: opacity 0.1s ease;
}

.chart-metric-switch {
  background: #09090b;
  gap: 2px;
}

.chart-switch-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chart-switch-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.chart-switch-btn.active {
  background: var(--bg-surface);
  border-color: var(--border-card);
  color: var(--cyan);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.analytics-source-item {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-faint);
  background: var(--bg-raised);
  transition: all 0.15s ease;
}

.analytics-source-item:hover {
  border-color: var(--border-focus);
  background: var(--bg-hover);
}

.analytics-progress-bar-bg {
  width: 100%;
  height: 5px;
  background: #09090b;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.analytics-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.ip-telemetry-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ip-badge-local {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.ip-badge-tailscale {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.28);
}

.ip-badge-lan {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.28);
}

.ip-badge-public {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

#btnRefreshAnalytics {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-card) !important;
  color: var(--text-primary) !important;
  font-family: var(--font-mono) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 5px 12px !important;
  border-radius: var(--radius-sm) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
}

#btnRefreshAnalytics:hover {
  background: var(--bg-hover) !important;
  border-color: var(--cyan) !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2) !important;
}

#btnRefreshAnalytics.spinning i,
#btnRefreshAnalytics.spinning svg {
  animation: spin 0.7s linear infinite !important;
}

/* ==========================================================
 * MOBILE NAVIGATION, DRAWER & RESPONSIVE POLISH
 * ========================================================== */

/* Mobile Backdrop */
.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 990;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Bottom Navigation (Hidden on desktop) */
.mobile-bottom-nav {
  display: none !important;
}

/* Main Viewport smooth scrolling */
.main-viewport {
  flex: 1 1 0%;
  min-width: 0;
  width: calc(100vw - var(--sidebar-w));
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* Layout: allow mobile viewport to flex cleanly */
  .dashboard-layout {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .main-viewport {
    width: 100vw !important;
  }

  /* Off-canvas sidebar */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.8);
    background: #09090c;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* Hamburger Menu Button */
  .mobile-menu-btn {
    display: inline-flex !important;
  }

  /* Mobile Top Header */
  .top-header {
    padding: 10px 14px;
    min-height: 54px;
    height: auto;
  }

  .header-title-block h1 {
    font-size: 11.5px;
  }

  .header-title-block p {
    display: none;
  }

  .header-meta-block {
    gap: 10px;
  }

  #liveClockDisplay,
  #headerPingText {
    display: none;
  }

  /* Dashboard Content on Mobile */
  .dashboard-content {
    padding: 14px 12px 105px !important;
    gap: 14px;
  }

  /* Metric cards on Mobile: 2 clean columns */
  .metrics-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .metric-card {
    padding: 12px 12px !important;
    border-radius: 10px !important;
  }

  .metric-value {
    font-size: 16px !important;
  }

  .metric-sub {
    font-size: 9.5px !important;
  }

  /* Lower Grid: 1 column */
  .grid-2-col {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .deck-card {
    max-height: 380px !important;
  }

  .deck-tabs-header {
    padding: 6px 8px !important;
  }

  .deck-tab {
    padding: 6px 10px !important;
    font-size: 9.5px !important;
  }

  /* Sembunyikan item yang sudah ada di bottom nav dari sidebar drawer mobile agar tidak duplikat */
  .sidebar .nav-item[data-view="dashboard"],
  .sidebar .nav-item[data-view="tokens"],
  .sidebar .nav-item[data-view="terminal"],
  .sidebar .nav-item[data-view="brain"] {
    display: none !important;
  }

  /* ----------------------------------------------------------
   * FLOATING ISLAND BOTTOM NAVIGATION (PILL CAPSULE DOCK)
   * ---------------------------------------------------------- */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px) !important;
    left: 14px !important;
    right: 14px !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    height: 64px !important;
    background: rgba(22, 22, 26, 0.88) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 40px !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
    z-index: 9999 !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 6px 8px !important;
    pointer-events: auto !important;
    user-select: none;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 52px;
    background: transparent;
    border: none;
    border-radius: 30px;
    color: #a1a1aa;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 4px 6px;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
  }

  .mobile-nav-item * {
    pointer-events: none;
  }

  .mobile-nav-item i,
  .mobile-nav-item svg {
    width: 19px;
    height: 19px;
    stroke-width: 2.1px;
    color: #a1a1aa;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
  }

  .mobile-nav-item span {
    font-size: 9.5px;
    line-height: 1;
    transition: color 0.2s ease, font-weight 0.2s ease;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.08);
  }

  /* Active Capsule Pill state */
  .mobile-nav-item.active {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
  }

  .mobile-nav-item.active i,
  .mobile-nav-item.active svg {
    transform: translateY(-1px);
    color: #ffffff !important;
  }

  .mobile-nav-item.active span {
    color: #ffffff !important;
    font-weight: 700;
  }

  .metric-card-token {
    grid-column: span 2 !important;
  }

  .command-input-row {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .command-input-row .btn-primary {
    width: 100% !important;
    justify-content: center !important;
  }

  .terminal-view {
    padding: 12px 12px 105px !important;
  }

  .findmy-view-container {
    padding-bottom: 95px !important;
  }
}

/* ----------------------------------------------------------
 * CLUSTER HA MONITORING & SERVER TELEMETRY STYLES
 * ---------------------------------------------------------- */

/* ----------------------------------------------------------
 * CLUSTER HA MONITORING & SERVER TELEMETRY STYLES (MONOCHROME ANTI-SLOP)
 * ---------------------------------------------------------- */

/* 1. DASHBOARD MINI SUMMARY WIDGET */
.cluster-summary-widget {
  background: #0d0d10;
  border: 1px solid #232328;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cluster-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #1c1c20;
  padding-bottom: 8px;
}

.cluster-widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f4f4f5;
  text-transform: uppercase;
}

.cluster-ha-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.btn-cluster-view-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 6px;
  padding: 4px 10px;
  color: #d4d4d8;
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-cluster-view-all:hover {
  background: #27272a;
  color: #ffffff;
  border-color: #3f3f46;
}

.cluster-nodes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .cluster-nodes-grid {
    grid-template-columns: 1fr;
  }
}

.cluster-node-mini-card {
  background: #111114;
  border: 1px solid #222226;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

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

.node-mini-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.node-badge-role {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
}

.node-badge-role.leader {
  background: #27272a;
  color: #ffffff;
  border: 1px solid #3f3f46;
}

.node-badge-role.worker {
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
}

.node-name {
  font-size: 12px;
  font-weight: 700;
  color: #f4f4f5;
}

.node-host-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  color: #71717a;
}

.node-mini-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: #a1a1aa;
}

.node-mini-status.online { color: #a1a1aa; }
.node-mini-status.offline { color: #71717a; }

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: none;
  display: inline-block;
}

.node-metrics-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.node-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.metric-label {
  width: 36px;
  font-family: 'IBM Plex Mono', monospace;
  color: #71717a;
  font-size: 10px;
}

.mini-progress-bar {
  flex: 1;
  height: 4px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.mini-progress-fill {
  height: 100%;
  border-radius: 2px;
  background: #ffffff;
  transition: width 0.3s ease;
}

.mini-progress-fill.ram {
  background: #a1a1aa;
}

.metric-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #f4f4f5;
  min-width: 85px;
  text-align: right;
}

.node-meta-chips {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 5px;
  border-top: 1px solid #1c1c20;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  color: #71717a;
}

.meta-chip b {
  color: #d4d4d8;
  font-family: 'IBM Plex Mono', monospace;
}

/* 2. FULL CLUSTER MONITORING VIEW */
.cluster-top-banner {
  background: #0d0d10;
  border: 1px solid #232328;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.cluster-actions-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cluster-ha-badge-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #a1a1aa;
  background: #18181b;
  border: 1px solid #27272a;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 600;
}

.cluster-live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: none;
}

.cluster-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

@media (max-width: 960px) {
  .cluster-details-grid {
    grid-template-columns: 1fr;
  }
}

.server-detail-card {
  background: #0d0d10;
  border: 1px solid #232328;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.server-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1c1c20;
  padding-bottom: 12px;
}

.server-card-identity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.server-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #18181b;
  border: 1px solid #27272a;
  color: #e4e4e7;
}

.server-icon-wrap.pi,
.server-icon-wrap.ubuntu {
  background: #18181b;
  border: 1px solid #27272a;
  color: #e4e4e7;
}

.server-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f4f4f5;
}

.server-card-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #71717a;
  margin-top: 2px;
}

.server-health-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #18181b;
  color: #a1a1aa;
  border: 1px solid #27272a;
}

.server-specs-box {
  background: #111114;
  border: 1px solid #222226;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
}

.spec-label {
  font-family: 'IBM Plex Mono', monospace;
  color: #71717a;
  font-size: 9.5px;
}

.spec-val {
  font-family: 'IBM Plex Mono', monospace;
  color: #d4d4d8;
  font-weight: 500;
}

.server-metrics-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.metric-meter-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.meter-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #a1a1aa;
}

.meter-val-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #f4f4f5;
}

.progress-track {
  width: 100%;
  height: 5px;
  background: #18181b;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.progress-bar-glow {
  height: 100%;
  border-radius: 3px;
  background: #f4f4f5;
  box-shadow: none;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-bar-glow.ram {
  background: #d4d4d8;
  box-shadow: none;
}

.progress-bar-glow.disk {
  background: #a1a1aa;
  box-shadow: none;
}

.meter-sub-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: #71717a;
}

.meter-sub-info b {
  color: #d4d4d8;
  font-family: 'IBM Plex Mono', monospace;
}

.server-footer-meta {
  border-top: 1px solid #1c1c20;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.meta-uptime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: #71717a;
}

.meta-uptime-row b {
  color: #a1a1aa;
  font-family: 'IBM Plex Mono', monospace;
}

.server-services-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.svc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  padding: 3px 7px;
  border-radius: 4px;
  background: #18181b;
  border: 1px solid #27272a;
  color: #a1a1aa;
  font-family: 'IBM Plex Mono', monospace;
}

.svc-tag.active {
  color: #ffffff;
  border-color: #3f3f46;
  background: #27272a;
}

/* 3. CLUSTER TOPOLOGY CARD */
.cluster-topology-card {
  background: #0d0d10;
  border: 1px solid #232328;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cluster-topo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #1c1c20;
  padding-bottom: 10px;
}

.topo-diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 0;
  flex-wrap: wrap;
}

.topo-node-box {
  background: #111114;
  border: 1px solid #232328;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  min-width: 170px;
}

.topo-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #f4f4f5;
}

.topo-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9.5px;
  color: #71717a;
  margin: 3px 0;
}

.topo-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  color: #a1a1aa;
  font-weight: 600;
}

.topo-line-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.topo-line-arrow {
  width: 100px;
  height: 1.5px;
  background: #27272a;
  position: relative;
}

.topo-line-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8.5px;
  color: #71717a;
}

.cluster-rules-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  border-top: 1px solid #1c1c20;
  padding-top: 12px;
}

@media (max-width: 768px) {
  .cluster-rules-summary {
    grid-template-columns: 1fr;
  }
}

.rule-col .rule-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #f4f4f5;
  margin-bottom: 3px;
}

.rule-col p {
  font-size: 10.5px;
  color: #71717a;
  line-height: 1.45;
  margin: 0;
}






