/* ==========================================================================
   CALVIO EXECUTIVE DESIGN SYSTEM — MOROCCO LIGHT COMMUNITY
   Inspired by Calvio SaaS Dashboard (Dark / Light Executive Mode)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --calvio-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --calvio-mono: 'JetBrains Mono', monospace;

  /* Calvio Dark Palette (Default) */
  --bg-app: #080c15;
  --bg-surface: #0e1422;
  --bg-surface-elevated: #131c31;
  --bg-card: #101828;
  --bg-card-hover: #162238;
  --bg-card-subtle: rgba(22, 34, 56, 0.6);
  --bg-pill: rgba(255, 255, 255, 0.05);
  --bg-pill-hover: rgba(255, 255, 255, 0.09);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-card: rgba(255, 255, 255, 0.09);
  --border-focus: #3b82f6;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-glow: rgba(37, 99, 235, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-green-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;

  --radius-pill: 9999px;
  --radius-card: 18px;
  --radius-inner: 12px;
  --radius-btn: 10px;

  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-elevated: 0 12px 36px -4px rgba(0, 0, 0, 0.6);
  --shadow-blue-glow: 0 0 20px rgba(37, 99, 235, 0.35);

  --transition-fast: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Calvio Light Theme */
html.light-theme, body.light-theme {
  --bg-app: #f4f6fb;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-subtle: #f1f5f9;
  --bg-pill: #e2e8f0;
  --bg-pill-hover: #cbd5e1;

  --border-subtle: #e2e8f0;
  --border-card: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-elevated: 0 10px 30px rgba(0, 0, 0, 0.07);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
body {
  font-family: var(--calvio-font) !important;
  background-color: var(--bg-app) !important;
  color: var(--text-main) !important;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================================================
   CALVIO TOP NAVBAR
   ========================================================================== */
.calvio-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  background: rgba(14, 20, 34, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1.5rem;
}

body.light-theme .calvio-navbar {
  background: rgba(255, 255, 255, 0.92);
}

/* Brand */
.calvio-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.calvio-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px var(--accent-blue-glow);
  overflow: hidden;
  padding: 2px;
}

.calvio-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.calvio-brand-copy {
  display: flex;
  flex-direction: column;
}

.calvio-brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.calvio-brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Center Floating Segmented Pill Bar */
.calvio-pill-nav {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 3px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.light-theme .calvio-pill-nav {
  background: #e2e8f0;
}

.calvio-main-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--calvio-font);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.calvio-main-pill svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.calvio-main-pill:hover {
  color: var(--text-main);
  background: var(--bg-pill-hover);
}

.calvio-main-pill.active {
  background: var(--accent-blue) !important;
  color: #ffffff !important;
  box-shadow: var(--shadow-blue-glow);
}

.calvio-pill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
}

.calvio-pill-badge.badge-warn {
  background: #f59e0b;
  color: #000;
}

.calvio-pill-badge.badge-danger {
  background: #ef4444;
  color: #fff;
}

/* Top Right Section */
.calvio-top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Calvio Search Box */
.calvio-search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.4rem 0.85rem;
  transition: var(--transition-fast);
}

.calvio-search-box:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.calvio-search-box svg {
  width: 15px;
  height: 15px;
  color: var(--text-dim);
}

.calvio-search-box input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--calvio-font);
  font-size: 0.82rem;
  width: 160px;
}

.calvio-search-box input::placeholder {
  color: var(--text-dim);
}

.calvio-search-box kbd {
  font-family: var(--calvio-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Icon Buttons */
.calvio-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calvio-icon-btn:hover {
  color: var(--text-main);
  background: var(--bg-pill-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.calvio-icon-btn svg {
  width: 17px;
  height: 17px;
}

/* Primary Action Pill */
.calvio-btn-primary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-blue);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.48rem 1.15rem;
  font-family: var(--calvio-font);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-blue-glow);
  transition: var(--transition-fast);
}

.calvio-btn-primary:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

/* User Profile Pill */
.calvio-user-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px 6px 3px 4px;
}

.calvio-user-pill img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #334155;
}

.calvio-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  padding-right: 4px;
}

.calvio-username {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
}

.calvio-userrole {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent-cyan);
}

.calvio-logout-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.calvio-logout-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.calvio-logout-btn svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   CALVIO SUB-NAV & LIVE TICKER BAR
   ========================================================================== */
.calvio-subnav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 2rem;
  background: rgba(14, 20, 34, 0.6);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  overflow-x: auto;
}

body.light-theme .calvio-subnav-bar {
  background: rgba(241, 245, 249, 0.9);
}

.calvio-subnav-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.calvio-subnav-pills .tab-btn {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-pill) !important;
  padding: 0.38rem 0.95rem !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  color: var(--text-muted) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  transition: var(--transition-fast) !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

.calvio-subnav-pills .tab-btn:hover {
  color: var(--text-main) !important;
  background: var(--bg-pill) !important;
}

.calvio-subnav-pills .tab-btn.active {
  background: var(--bg-surface-elevated) !important;
  color: var(--text-main) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.light-theme .calvio-subnav-pills .tab-btn.active {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.calvio-sub-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.calvio-sub-badge.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.calvio-sub-badge.badge-warn {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.calvio-sub-badge.badge-ok {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Live Ticker Pills (Calvio Frame 01 Top Right) */
.calvio-subnav-ticker {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.calvio-ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.75rem;
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ticker-dot.green { background: #22c55e; box-shadow: 0 0 6px #22c55e; }
.ticker-dot.blue { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.ticker-dot.emerald { background: #10b981; box-shadow: 0 0 6px #10b981; }

/* ==========================================================================
   CALVIO HERO GREETING SECTION
   ========================================================================== */
.calvio-hero-section {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2rem 2.25rem 1.25rem 2.25rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.calvio-hero-content {
  display: flex;
  flex-direction: column;
}

.calvio-greeting-title {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.035em;
  line-height: 1.15;
  margin: 0;
}

.calvio-greeting-subtitle {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0.4rem 0 1rem 0;
}

/* Calvio Insight Banner (Chips) */
.calvio-insight-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.insight-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-main);
  font-weight: 600;
}

.insight-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.insight-dot.green { background: #22c55e; }
.insight-dot.blue { background: #38bdf8; }
.insight-dot.purple { background: #a855f7; }
.insight-dot.amber { background: #f59e0b; }

.insight-link {
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.3rem;
  transition: color 0.15s ease;
}
.insight-link:hover {
  color: var(--accent-blue);
}

.calvio-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.calvio-secondary-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 10px;
  padding: 0.55rem 1.1rem;
  font-family: var(--calvio-font);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.calvio-secondary-btn:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
}

.calvio-secondary-btn svg {
  width: 15px;
  height: 15px;
}

.calvio-primary-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1.25rem;
  font-family: var(--calvio-font);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-blue-glow);
  transition: var(--transition-fast);
}

.calvio-primary-action-btn:hover {
  background: var(--accent-blue-hover);
  transform: translateY(-1px);
}

.calvio-primary-action-btn svg {
  width: 15px;
  height: 15px;
}

/* ==========================================================================
   CALVIO OVERVIEW DASHBOARD GRID (Frame 01 Architecture)
   ========================================================================== */
.calvio-dashboard-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.25rem;
  padding: 0 2.25rem 2.25rem 2.25rem;
}

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

/* Calvio Cards */
.calvio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.calvio-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

body.light-theme .calvio-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

/* Featured Left Waterfall Card */
.calvio-featured-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.calvio-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.calvio-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 0;
}

.calvio-card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.calvio-metric-hero {
  margin: 1rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.calvio-hero-num {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-main);
  line-height: 1;
}

.calvio-hero-delta {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

/* Calvio Waterfall / Bar Chart Simulation */
.calvio-waterfall-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  align-items: flex-end;
  height: 170px;
  padding: 1.5rem 0 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.25rem;
}

.waterfall-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 0.5rem;
}

.waterfall-bar {
  width: 100%;
  max-width: 44px;
  border-radius: 6px;
  transition: height 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.waterfall-bar.bar-blue { background: linear-gradient(180deg, #38bdf8, #2563eb); }
.waterfall-bar.bar-green { background: linear-gradient(180deg, #34d399, #059669); }
.waterfall-bar.bar-emerald { background: linear-gradient(180deg, #2dd4bf, #0d9488); }
.waterfall-bar.bar-amber { background: linear-gradient(180deg, #fbbf24, #d97706); }
.waterfall-bar.bar-rose { background: linear-gradient(180deg, #fb7185, #e11d48); }
.waterfall-bar.bar-cyan { background: linear-gradient(180deg, #60a5fa, #1d4ed8); }

.waterfall-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

.waterfall-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Waterfall Bottom Metrics Footer */
.calvio-waterfall-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.wf-stat {
  display: flex;
  flex-direction: column;
}

.wf-stat-lbl {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
}

.wf-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.2rem;
}

/* 2x2 Compact Metric Tiles on Right */
.calvio-right-tiles {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.calvio-tiles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.calvio-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  transition: var(--transition-fast);
}

.calvio-tile:hover {
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
}

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

.tile-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tile-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-pill);
  color: var(--accent-blue);
}

.tile-body {
  margin-top: 0.5rem;
}

.tile-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  line-height: 1;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.tile-delta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
}

.tile-sparkline {
  width: 60px;
  height: 22px;
}

/* Trend Line Chart Card */
.calvio-chart-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
}

.chart-sparkline-svg {
  width: 100%;
  height: 80px;
  margin-top: 0.75rem;
}

/* ==========================================================================
   TABLES & LISTS OVERHAUL (Accounts / Frame 04 Style)
   ========================================================================== */
.calvio-table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.calvio-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.calvio-table-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calvio-filter-chip {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-pill);
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
}

.calvio-filter-chip:hover {
  background: var(--bg-pill-hover);
  color: var(--text-main);
}

.calvio-filter-chip.active {
  background: var(--accent-blue);
  color: #ffffff;
}

/* Health badges */
.calvio-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}
.calvio-health-badge.health-high { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.calvio-health-badge.health-mid { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.calvio-health-badge.health-low { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* ==========================================================================
   IOS-STYLE ANIMATED TOGGLE SWITCHES (Automations / Frame 13 Style)
   ========================================================================== */
.calvio-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.calvio-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.calvio-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 34px;
}

.calvio-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

input:checked + .calvio-slider {
  background-color: var(--accent-blue);
}

input:checked + .calvio-slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   FLOATING PILL TOAST (Calvio Frame 07 Style)
   ========================================================================== */
#toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.6rem 1.25rem;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: calvioToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.light-theme .toast {
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  border-color: #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

@keyframes calvioToastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==========================================================================
   SLIDE-OUT INSPECTOR DRAWER (Mossy Oak Style in Frame 04)
   ========================================================================== */
.calvio-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-card);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.75rem;
}

.calvio-drawer.open {
  right: 0;
}

.calvio-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.calvio-drawer-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
}
.calvio-drawer-close:hover { color: var(--text-main); }

/* Circular Gauge Ring */
.calvio-gauge-wrap {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.gauge-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid var(--accent-blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--text-main);
  box-shadow: 0 0 16px var(--accent-blue-glow);
}

.gauge-lbl {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   CALVIO FULL-WIDTH CANVAS & WORKSPACE OVERRIDES
   ========================================================================== */
.sidebar {
  display: none !important;
}

.workspace {
  margin-left: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  padding: 0 !important;
}

.topbar {
  display: none !important;
}

.container {
  max-width: 1480px !important;
  margin: 0 auto !important;
  padding: 0 2rem 3rem 2rem !important;
}

.ambient-scene {
  opacity: 0.25 !important;
}

body.light-theme .ambient-scene {
  display: none !important;
}

/* Calvio Card Aesthetics */
.card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card) !important;
  padding: 1.5rem !important;
  margin-bottom: 1.5rem !important;
  color: var(--text-main) !important;
}

body.light-theme .card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

.card-head {
  border-bottom: 1px solid var(--border-subtle) !important;
  padding-bottom: 1rem !important;
  margin-bottom: 1.25rem !important;
}

.item-title h2, .card-head h2 {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--text-main) !important;
}

/* Stat Cards in Tab Panels */
.stat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-card) !important;
  border-radius: var(--radius-inner) !important;
  box-shadow: var(--shadow-card) !important;
}

body.light-theme .stat-card {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

/* ==========================================================================
   CALVIO FORM CONTROLS & INPUTS
   ========================================================================== */
.input, input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-input) !important;
  color: var(--text-main) !important;
  border-radius: var(--radius-inner) !important;
  padding: 0.65rem 1rem !important;
  font-family: inherit !important;
  font-size: 0.88rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

body.light-theme .input,
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="search"],
body.light-theme input[type="number"],
body.light-theme select,
body.light-theme textarea {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.input:focus, input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--calvio-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25) !important;
}

/* ==========================================================================
   CALVIO BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
  border-radius: var(--radius-inner) !important;
  padding: 0.65rem 1.15rem !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none !important;
  border: 1px solid transparent !important;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35) !important;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.5) !important;
  transform: translateY(-1px) !important;
}

.btn-secondary {
  background: var(--bg-hover) !important;
  border-color: var(--border-subtle) !important;
  color: var(--text-main) !important;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: var(--border-pill) !important;
}

body.light-theme .btn-secondary {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}
body.light-theme .btn-secondary:hover {
  background: #e2e8f0 !important;
  border-color: #94a3b8 !important;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.35) !important;
}
.btn-danger:hover {
  background: linear-gradient(135deg, #f87171, #ef4444) !important;
  transform: translateY(-1px) !important;
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.35) !important;
}
.btn-success:hover {
  background: linear-gradient(135deg, #34d399, #10b981) !important;
  transform: translateY(-1px) !important;
}

/* ==========================================================================
   CALVIO TABLES & DATA LISTS
   ========================================================================== */
.table, table {
  width: 100% !important;
  border-collapse: collapse !important;
  font-size: 0.86rem !important;
}

.table th, table th {
  background: transparent !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.05em !important;
  padding: 0.75rem 1rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  text-align: left !important;
}

.table td, table td {
  padding: 0.85rem 1rem !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: var(--text-main) !important;
}

.table tr:hover td, table tr:hover td {
  background: var(--bg-hover) !important;
}

body.light-theme .table tr:hover td,
body.light-theme table tr:hover td {
  background: #f8fafc !important;
}

/* Calvio Status Pills & Badges */
.badge, .status-pill, .pill {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding: 0.22rem 0.65rem !important;
  border-radius: 9999px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
}
body.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .calvio-navbar {
    padding: 0.6rem 1rem !important;
    gap: 0.75rem !important;
  }
  .calvio-search-box {
    display: none !important;
  }
  .calvio-subnav-bar {
    padding: 0.5rem 1rem !important;
  }
  .calvio-hero-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  .calvio-dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Calvio Login Experience */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.12) 0%, transparent 60%), #080c15;
}

.login-card {
  max-width: 460px !important;
  background: rgba(16, 24, 40, 0.75) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
  padding: 2.75rem 2.25rem !important;
}

.login-card .brand-badge {
  background: rgba(37, 99, 235, 0.12) !important;
  border: 1px solid rgba(37, 99, 235, 0.3) !important;
  color: #60a5fa !important;
  border-radius: 9999px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  padding: 0.35rem 0.85rem !important;
  display: inline-block !important;
  margin-bottom: 1rem !important;
}

.login-card h1 {
  font-size: 1.6rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: #ffffff !important;
  margin-bottom: 0.5rem !important;
}

.login-card .muted {
  font-size: 0.86rem !important;
  color: #94a3b8 !important;
  line-height: 1.55 !important;
  margin-bottom: 1.75rem !important;
}

.btn-discord {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-radius: 12px !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  padding: 0.85rem 1.5rem !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.btn-discord:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55) !important;
}

/* ==========================================================================
   CALVIO LIVE INTERACTION & HOVER ANIMATIONS
   ========================================================================== */

/* Waterfall Bar Chart Hover & Glow */
.waterfall-col {
  cursor: pointer !important;
  position: relative !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.waterfall-col:hover {
  transform: translateY(-8px) !important;
}

.waterfall-bar {
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, filter 0.25s ease !important;
  position: relative;
}

.waterfall-col:hover .bar-blue {
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.75), 0 0 45px rgba(37, 99, 235, 0.5) !important;
  filter: brightness(1.25) !important;
}
.waterfall-col:hover .bar-amber {
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.75) !important;
  filter: brightness(1.25) !important;
}
.waterfall-col:hover .bar-rose {
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.75) !important;
  filter: brightness(1.25) !important;
}
.waterfall-col:hover .bar-green {
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.75) !important;
  filter: brightness(1.25) !important;
}
.waterfall-col:hover .bar-cyan {
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.75) !important;
  filter: brightness(1.25) !important;
}

.waterfall-col:hover .waterfall-val {
  color: #ffffff !important;
  transform: scale(1.18) !important;
  transition: transform 0.2s ease, color 0.2s ease !important;
}
.waterfall-col:hover .waterfall-label {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  transition: color 0.2s ease !important;
}

/* Floating Tooltip for Waterfall Bars */
.waterfall-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 15px rgba(37, 99, 235, 0.3);
  z-index: 60;
}

.waterfall-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.95) transparent transparent transparent;
}

.waterfall-col:hover .waterfall-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Waterfall Footer Clickable Hover */
.wf-stat {
  cursor: pointer !important;
  padding: 6px 10px !important;
  border-radius: 8px !important;
  transition: background 0.2s ease, transform 0.2s ease !important;
}
.wf-stat:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  transform: translateY(-2px) !important;
}
.wf-stat:hover .wf-stat-lbl {
  color: #38bdf8 !important;
}

/* Calvio 2x2 Metric Tiles & Stat Cards Interactive Animations */
.calvio-tile, .stats-grid .stat-card {
  cursor: pointer !important;
  position: relative !important;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
}

.calvio-tile:hover, .stats-grid .stat-card:hover {
  transform: translateY(-5px) scale(1.015) !important;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.65), 0 0 22px rgba(37, 99, 235, 0.32) !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
}

.calvio-tile:hover .tile-title, .stats-grid .stat-card:hover .stat-label {
  color: #38bdf8 !important;
  transition: color 0.2s ease;
}

.calvio-tile:hover .tile-val, .stats-grid .stat-card:hover .stat-value {
  transform: scale(1.08);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.calvio-tile:hover .tile-sparkline path {
  filter: drop-shadow(0 0 6px currentColor);
  stroke-width: 2.8;
  transition: filter 0.2s ease, stroke-width 0.2s ease;
}

/* Hover "Open ->" indicator tag */
.calvio-tile::after, .stats-grid .stat-card::after {
  content: "Open →";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #38bdf8;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.calvio-tile:hover::after, .stats-grid .stat-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Interactive Growth Curve Tracker Tooltip */
.curve-tracker-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65), 0 0 14px rgba(56, 189, 248, 0.3);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -100%) scale(0.9);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 55;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.curve-tracker-tooltip span:first-child {
  color: #38bdf8;
  font-weight: 700;
}
.curve-tracker-tooltip span:last-child {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Curve Stroke Glowing Wave Animation */
.curve-stroke-anim {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
  animation: curveGlowPulse 4s ease-in-out infinite alternate;
}
@keyframes curveGlowPulse {
  0% { filter: drop-shadow(0 0 2px rgba(56, 189, 248, 0.4)); }
  100% { filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.85)); }
}

.curve-area-anim {
  animation: areaBreathe 5s ease-in-out infinite alternate;
}
@keyframes areaBreathe {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Value update flash micro-animation */
.num-flash {
  animation: numFlash 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes numFlash {
  0% { color: #38bdf8; transform: scale(1.2); }
  100% { color: inherit; transform: scale(1); }
}

/* ==========================================================================
   CALVIO LIGHT THEME: COMPREHENSIVE TEXT & SECTION CONTRAST FIXES
   ========================================================================== */

/* Universal text color enforcement in Light Mode */
body.light-theme,
body.light-theme .app-shell,
body.light-theme main {
  color: #0f172a !important;
  background-color: #f4f6fb !important;
}

body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .card-title,
body.light-theme .calvio-card-title,
body.light-theme .tile-title,
body.light-theme .tile-val,
body.light-theme .stat-value,
body.light-theme .stat-label,
body.light-theme .calvio-hero-num,
body.light-theme .calvio-greeting-title,
body.light-theme .item-title h2,
body.light-theme .card-head h2,
body.light-theme strong,
body.light-theme b,
body.light-theme label span,
body.light-theme .waterfall-val,
body.light-theme .wf-stat-val,
body.light-theme .calvio-username,
body.light-theme .cmd-name-code,
body.light-theme .cmd-name,
body.light-theme .antiping-user-name,
body.light-theme .telemetry-val {
  color: #0f172a !important;
}

body.light-theme p,
body.light-theme .muted,
body.light-theme .small,
body.light-theme .card-sub,
body.light-theme .calvio-card-sub,
body.light-theme .calvio-greeting-subtitle,
body.light-theme .wf-stat-lbl,
body.light-theme .waterfall-label,
body.light-theme .cmd-desc,
body.light-theme .presence-field span,
body.light-theme .telemetry-label,
body.light-theme .antiping-user-sub,
body.light-theme .meta-lbl {
  color: #64748b !important;
}

/* Light Mode Card Overrides across all sections */
body.light-theme .card,
body.light-theme .calvio-card,
body.light-theme .stat-card,
body.light-theme .calvio-tile,
body.light-theme .calvio-chart-tile,
body.light-theme .panel-grid .card,
body.light-theme .side-stack .card,
body.light-theme .role-cmd-card,
body.light-theme .cmd-toggle-card,
body.light-theme .antiping-user-card,
body.light-theme .list-row,
body.light-theme .profile-box,
body.light-theme .log-container {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

body.light-theme .card-head {
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Light Mode Tables */
body.light-theme .table,
body.light-theme table {
  background: transparent !important;
}
body.light-theme .table th,
body.light-theme table th {
  color: #64748b !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #f8fafc !important;
}
body.light-theme .table td,
body.light-theme table td {
  color: #0f172a !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
body.light-theme .table tr:hover td,
body.light-theme table tr:hover td {
  background: #f8fafc !important;
}

/* Light Mode Input Fields */
body.light-theme input,
body.light-theme select,
body.light-theme textarea,
body.light-theme .input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}
body.light-theme input::placeholder,
body.light-theme .input::placeholder {
  color: #94a3b8 !important;
}
body.light-theme select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Light Mode Buttons */
body.light-theme .btn-ghost {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
body.light-theme .btn-ghost:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}
body.light-theme .btn-secondary {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
body.light-theme .btn-secondary:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Light Mode Badges & Pills - High Contrast */
body.light-theme .pill-approved,
body.light-theme .badge-ok {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
body.light-theme .pill-danger,
body.light-theme .badge-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}
body.light-theme .pill-warn,
body.light-theme .badge-warn {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde047 !important;
}
body.light-theme .pill-accent,
body.light-theme .badge-accent {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
}
body.light-theme .pill-secondary {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

/* Light Mode Banner Overrides */
body.light-theme .banner-info {
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #1e40af !important;
}
body.light-theme .banner-warn {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #991b1b !important;
}

/* Light Mode Staff Management Subtabs */
body.light-theme .sm-subtab-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}
body.light-theme .sm-subtab-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

/* Light Mode Logs Container */
body.light-theme .logs-terminal,
body.light-theme #logs-content,
body.light-theme #server-logs-list {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}

/* Light Mode Code Tags */
body.light-theme code {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #2563eb !important;
}

/* ==========================================================================
   AUTHENTIC DISCORD BOT STATUS ICONS & CONTROLS
   ========================================================================== */

/* Discord Status Pill Selector Buttons */
.discord-status-pill-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.status-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

body.light-theme .status-pill-btn {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

.status-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

body.light-theme .status-pill-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.status-pill-btn.active {
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

body.light-theme .status-pill-btn.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

/* Status Dot Indicators */
.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
}

.status-indicator-dot.dot-online {
  background: #23a55a;
  box-shadow: 0 0 6px rgba(35, 165, 90, 0.6);
}

.status-indicator-dot.dot-idle {
  background: #f0b232;
  box-shadow: 0 0 6px rgba(240, 178, 50, 0.6);
}

.status-indicator-dot.dot-dnd {
  background: #f23f43;
  box-shadow: 0 0 6px rgba(242, 63, 67, 0.6);
}

.status-indicator-dot.dot-invisible {
  background: #80848e;
}

/* Authentic Discord Avatar Status Ring Shapes */
.discord-status-ring {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 4px solid #102237;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Online: Solid Green Circle */
.discord-status-ring.status-online {
  background: #23a55a !important;
}

/* Idle: Amber Circle with Authentic Crescent Cutout */
.discord-status-ring.status-idle {
  background: #f0b232 !important;
  position: absolute;
  overflow: hidden;
}
.discord-status-ring.status-idle::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 14px;
  height: 14px;
  background: #102237;
  border-radius: 50%;
}

/* Do Not Disturb: Red Circle with Authentic Minus Bar */
.discord-status-ring.status-dnd {
  background: #f23f43 !important;
}
.discord-status-ring.status-dnd::before {
  content: "";
  width: 10px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
}

/* Invisible / Offline: Grey Circle with Authentic Center Hole */
.discord-status-ring.status-invisible {
  background: #80848e !important;
}
.discord-status-ring.status-invisible::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #102237;
  border-radius: 50%;
}

/* ==========================================================================
   COMPREHENSIVE CALVIO LIGHT THEME OVERRIDES (100% CONTRAST & READABILITY)
   ========================================================================== */

/* App Shell, Workspace & Background */
html.light-theme,
body.light-theme {
  background-color: #f4f6fb !important;
  color: #0f172a !important;
}

body.light-theme .app-shell,
body.light-theme .workspace,
body.light-theme main,
body.light-theme .container {
  background-color: transparent !important;
  color: #0f172a !important;
}

/* Header & Subnav Bar */
body.light-theme .calvio-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

body.light-theme .calvio-subnav-bar {
  background: rgba(248, 250, 252, 0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .calvio-subnav-pills .tab-btn {
  color: #64748b !important;
}

body.light-theme .calvio-subnav-pills .tab-btn:hover {
  color: #0f172a !important;
  background: #e2e8f0 !important;
}

body.light-theme .calvio-subnav-pills .tab-btn.active {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .calvio-ticker-pill {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

/* Search Box & Top Right Controls */
body.light-theme .calvio-search-box {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .calvio-search-box input {
  color: #0f172a !important;
}
body.light-theme .calvio-search-box input::placeholder {
  color: #94a3b8 !important;
}
body.light-theme .calvio-search-box kbd {
  background: #f1f5f9 !important;
  color: #64748b !important;
  border: 1px solid #cbd5e1 !important;
}
body.light-theme .calvio-icon-btn {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #64748b !important;
}
body.light-theme .calvio-icon-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
body.light-theme .calvio-user-pill {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
}
body.light-theme .calvio-username {
  color: #0f172a !important;
}
body.light-theme .calvio-userrole {
  color: #0284c7 !important;
}

/* Greeting Hero & Filter Chips */
body.light-theme .calvio-greeting-title {
  color: #0f172a !important;
}
body.light-theme .calvio-greeting-subtitle {
  color: #64748b !important;
}
body.light-theme .calvio-hero-chip {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  color: #334155 !important;
}
body.light-theme .calvio-filter-chip {
  background: #e2e8f0 !important;
  color: #334155 !important;
}

/* Universal Cards & Containers in Light Theme */
body.light-theme .card,
body.light-theme .calvio-card,
body.light-theme .stat-card,
body.light-theme .calvio-tile,
body.light-theme .calvio-chart-tile,
body.light-theme .item-card,
body.light-theme .cmd-group-box,
body.light-theme .cmd-toggle-card,
body.light-theme .antiping-user-card,
body.light-theme .sm-roster-card,
body.light-theme .sm-form-card,
body.light-theme .sm-spotlight-card,
body.light-theme .automod-module-card,
body.light-theme .automod-live-rule-card,
body.light-theme .presence-slide-card,
body.light-theme .presence-field,
body.light-theme .profile-box,
body.light-theme .callout,
body.light-theme .modal-content,
body.light-theme .calvio-drawer {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

/* Headings & High Contrast Text */
body.light-theme h1,
body.light-theme h2,
body.light-theme h3,
body.light-theme h4,
body.light-theme h5,
body.light-theme h6,
body.light-theme .card-title,
body.light-theme .calvio-card-title,
body.light-theme .card-head h2,
body.light-theme .item-title,
body.light-theme .item-title h2,
body.light-theme .item-title span,
body.light-theme .cmd-group-title,
body.light-theme .cmd-name-code,
body.light-theme .cmd-name,
body.light-theme .sm-spotlight-name,
body.light-theme .snews-card-chname,
body.light-theme .ann-dc-title,
body.light-theme .ann-section-head h3,
body.light-theme .antiping-user-name,
body.light-theme .waterfall-val,
body.light-theme .calvio-hero-num,
body.light-theme strong,
body.light-theme b {
  color: #0f172a !important;
}

/* Subtitles, Meta & Descriptions */
body.light-theme p,
body.light-theme .muted,
body.light-theme .small,
body.light-theme .card-sub,
body.light-theme .calvio-card-sub,
body.light-theme .item-reason,
body.light-theme .item-meta,
body.light-theme .cmd-desc,
body.light-theme .ann-label,
body.light-theme .ann-desc,
body.light-theme .snews-purpose,
body.light-theme .sm-spotlight-highlight,
body.light-theme .meta-lbl,
body.light-theme .wf-stat-lbl,
body.light-theme .waterfall-label,
body.light-theme .stat-label,
body.light-theme .tile-title,
body.light-theme .presence-field-hint,
body.light-theme .presence-vars-label,
body.light-theme .telemetry-label {
  color: #475569 !important;
}

/* 3D KPI Stat Cards - High-Contrast Vibrant Numbers & Badges */
body.light-theme .stat-danger .stat-value {
  color: #dc2626 !important;
}
body.light-theme .stat-danger .stat-icon {
  background: #fee2e2 !important;
  color: #dc2626 !important;
  border-color: #fca5a5 !important;
}

body.light-theme .stat-warn .stat-value {
  color: #d97706 !important;
}
body.light-theme .stat-warn .stat-icon {
  background: #fef3c7 !important;
  color: #d97706 !important;
  border-color: #fde047 !important;
}

body.light-theme .stat-ok .stat-value {
  color: #16a34a !important;
}
body.light-theme .stat-ok .stat-icon {
  background: #dcfce7 !important;
  color: #16a34a !important;
  border-color: #86efac !important;
}

body.light-theme .stat-info .stat-value,
body.light-theme .stat-accent .stat-value {
  color: #2563eb !important;
}
body.light-theme .stat-info .stat-icon,
body.light-theme .stat-accent .stat-icon {
  background: #e0f2fe !important;
  color: #2563eb !important;
  border-color: #7dd3fc !important;
}

/* Hover indicators on KPI cards */
body.light-theme .calvio-tile:hover,
body.light-theme .stats-grid .stat-card:hover {
  transform: translateY(-5px) scale(1.015) !important;
  border-color: #2563eb !important;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.12), 0 0 16px rgba(37, 99, 235, 0.15) !important;
}
body.light-theme .calvio-tile:hover .tile-title,
body.light-theme .stats-grid .stat-card:hover .stat-label {
  color: #2563eb !important;
}
body.light-theme .calvio-tile::after,
body.light-theme .stats-grid .stat-card::after {
  color: #2563eb !important;
}

/* Role Permissions & Anti-Ping Lists */
body.light-theme .role-item-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03) !important;
}
body.light-theme .role-item-btn:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}
body.light-theme .role-item-btn.active {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15) !important;
}
body.light-theme .role-item-name {
  color: #0f172a !important;
}
body.light-theme .role-item-sub {
  color: #64748b !important;
}

/* Command toggles & Checkboxes */
body.light-theme .cmd-toggle-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}
body.light-theme .cmd-toggle-card.checked {
  background: #f0fdf4 !important;
  border-color: #86efac !important;
}
body.light-theme .cmd-toggle-card input[type="checkbox"] {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}
body.light-theme .cmd-toggle-card input[type="checkbox"]:checked {
  background: #16a34a !important;
  border-color: #16a34a !important;
}

/* Segmented Buttons (Role filters, Staff Management subtabs, Announcements) */
body.light-theme .bot-filter-group,
body.light-theme .sm-subtabs,
body.light-theme .ann-segmented {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}
body.light-theme .bot-filter-btn,
body.light-theme .sm-subtab-btn,
body.light-theme .ann-seg-btn {
  color: #64748b !important;
}
body.light-theme .bot-filter-btn.active,
body.light-theme .sm-subtab-btn.active,
body.light-theme .ann-seg-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25) !important;
}

/* Inputs, Selects, and Textareas */
body.light-theme input,
body.light-theme select,
body.light-theme textarea,
body.light-theme .input {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}
body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus,
body.light-theme .input:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}
body.light-theme select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Tables */
body.light-theme table,
body.light-theme .table {
  background: transparent !important;
}
body.light-theme th {
  background: #f8fafc !important;
  color: #475569 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme td {
  color: #0f172a !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
body.light-theme tr:hover td {
  background: #f8fafc !important;
}

/* Pills & Badges High Contrast */
body.light-theme .pill-approved,
body.light-theme .badge-ok,
body.light-theme .pill-ok {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
body.light-theme .pill-danger,
body.light-theme .badge-danger {
  background: #fee2e2 !important;
  color: #b91c1c !important;
  border: 1px solid #fca5a5 !important;
}
body.light-theme .pill-warn,
body.light-theme .badge-warn,
body.light-theme .pill-active {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde047 !important;
}
body.light-theme .pill-accent,
body.light-theme .badge-accent,
body.light-theme .pill-info {
  background: #e0f2fe !important;
  color: #0369a1 !important;
  border: 1px solid #7dd3fc !important;
}
body.light-theme .pill-secondary,
body.light-theme .pill-dismissed,
body.light-theme .pill-revoked {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}
body.light-theme .pill-gold {
  background: #fef3c7 !important;
  color: #b45309 !important;
  border: 1px solid #fde047 !important;
}
body.light-theme .pill-zerox {
  background: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #7dd3fc !important;
}

/* Presence Variable Chips & Slides */
body.light-theme .presence-vars-bar {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}
body.light-theme .var-chip-btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #1e293b !important;
}
body.light-theme .var-chip-btn:hover {
  background: #f1f5f9 !important;
  border-color: #2563eb !important;
}
body.light-theme .var-chip-val {
  background: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}
body.light-theme .slide-preview-line {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}
body.light-theme .slide-preview-verb {
  color: #2563eb !important;
}

/* AutoMod Shield in Light Theme */
body.light-theme .automod-scope-box {
  background: #f0fdf4 !important;
  border: 1px solid #86efac !important;
  color: #166534 !important;
}
body.light-theme .automod-preset-chip {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}
body.light-theme .automod-pick-pill {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}
body.light-theme .automod-pick-pill.selected {
  background: #dcfce7 !important;
  border-color: #86efac !important;
  color: #15803d !important;
}

/* Support News & Announcements in Light Theme */
body.light-theme .snews-preview-box,
body.light-theme .snews-note-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

/* Authentic Discord Bot Profile Card (Preserve Dark Client Embed) */
.discord-preview-card {
  background: #111214 !important;
  border-color: #2b2d31 !important;
  color: #dbdee1 !important;
}
.discord-preview-card .discord-bot-name {
  color: #f2f3f5 !important;
}
.discord-preview-card .telemetry-tile {
  background: #2b2d31 !important;
  border-color: #383a40 !important;
}
.discord-preview-card .telemetry-val {
  color: #f2f3f5 !important;
}
.discord-preview-card .telemetry-label {
  color: #949ba4 !important;
}
.discord-preview-card .discord-activity-box {
  background: #2b2d31 !important;
  border: 1px solid #383a40 !important;
}
.discord-preview-card .discord-activity-text {
  color: #f2f3f5 !important;
}
.discord-preview-card .discord-activity-type {
  color: #949ba4 !important;
}
