/* ==========================================================================
   BLACKOUT TRACKER PRO - STUDIO EDITORIAL DESIGN SYSTEM
   High-Precision Scanlation Management • Darkroom & Editorial Drafting Theme
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS & SYSTEM VARIABLES
   -------------------------------------------------------------------------- */
:root {
  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, Menlo, monospace;

  /* Studio Obsidian Darkroom Palette (Default) */
  --bg-app: #090c12;
  --bg-sidebar: #0d1118;
  --bg-topbar: rgba(13, 17, 24, 0.88);
  --bg-canvas: #090c12;
  --bg-card: #121722;
  --bg-card-hover: #171d2b;
  --bg-card-subtle: #0f131d;
  --bg-input: #0a0d14;
  --bg-modal: #121622;
  --bg-modal-overlay: rgba(5, 7, 12, 0.78);

  /* Hairline Borders with Subtle Light-Catching Edge */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.22);
  --border-focus: #3b82f6;
  --border-active: rgba(59, 130, 246, 0.45);

  /* High-Legibility Text Hierarchy */
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8896aa;
  --text-dim: #546478;

  /* Studio Ink Accents (Digital Manga Ink) */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-active: #1d4ed8;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --primary-bg: rgba(59, 130, 246, 0.12);
  --primary-border: rgba(59, 130, 246, 0.3);

  /* Scanlation Specialty Badges (Distinctive Semantic Roles) */
  --role-combo: #818cf8;
  --role-combo-bg: rgba(129, 140, 248, 0.12);
  --role-combo-border: rgba(129, 140, 248, 0.28);

  --role-type: #38bdf8;
  --role-type-bg: rgba(56, 189, 248, 0.12);
  --role-type-border: rgba(56, 189, 248, 0.28);

  --role-clrd: #fb923c;
  --role-clrd-bg: rgba(251, 146, 60, 0.12);
  --role-clrd-border: rgba(251, 146, 60, 0.28);

  /* Production Status Indicators */
  --status-done: #10b981;
  --status-done-bg: rgba(16, 185, 129, 0.14);
  --status-done-border: rgba(16, 185, 129, 0.3);

  --status-wip: #f59e0b;
  --status-wip-bg: rgba(245, 158, 11, 0.14);
  --status-wip-border: rgba(245, 158, 11, 0.3);

  --status-pending: #f43f5e;
  --status-pending-bg: rgba(244, 63, 94, 0.14);
  --status-pending-border: rgba(244, 63, 94, 0.3);

  --status-late: #ef4444;
  --status-late-bg: rgba(239, 68, 68, 0.18);
  --status-late-border: rgba(239, 68, 68, 0.45);

  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;

  /* Shadows & Architectural Depth */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 32px -4px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 8px 24px -4px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(59, 130, 246, 0.3);

  /* Dimensions & Radius */
  --sidebar-width: 285px;
  --topbar-height: 60px;
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 9999px;

  /* Intentional Transitions */
  --transition-fast: 0.14s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. EDITORIAL LIGHT THEME (Drafting Stationery)
   -------------------------------------------------------------------------- */
[data-theme="light"] {
  --bg-app: #f4f6f9;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-canvas: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-subtle: #f1f4f8;
  --bg-input: #ffffff;
  --bg-modal: #ffffff;
  --bg-modal-overlay: rgba(15, 23, 42, 0.5);

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-strong: #94a3b8;
  --border-focus: #2563eb;
  --border-active: rgba(37, 99, 235, 0.45);

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

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-active: #1e40af;
  --primary-glow: rgba(37, 99, 235, 0.18);
  --primary-bg: rgba(37, 99, 235, 0.08);
  --primary-border: rgba(37, 99, 235, 0.25);

  --role-combo: #4f46e5;
  --role-combo-bg: rgba(79, 70, 229, 0.08);
  --role-combo-border: rgba(79, 70, 229, 0.25);

  --role-type: #0284c7;
  --role-type-bg: rgba(2, 132, 199, 0.08);
  --role-type-border: rgba(2, 132, 199, 0.25);

  --role-clrd: #ea580c;
  --role-clrd-bg: rgba(234, 88, 12, 0.08);
  --role-clrd-border: rgba(234, 88, 12, 0.25);

  --status-done: #059669;
  --status-done-bg: rgba(5, 150, 105, 0.09);
  --status-done-border: rgba(5, 150, 105, 0.25);

  --status-wip: #d97706;
  --status-wip-bg: rgba(217, 119, 6, 0.09);
  --status-wip-border: rgba(217, 119, 6, 0.25);

  --status-pending: #e11d48;
  --status-pending-bg: rgba(225, 29, 72, 0.09);
  --status-pending-border: rgba(225, 29, 72, 0.25);

  --status-late: #dc2626;
  --status-late-bg: rgba(220, 38, 38, 0.12);
  --status-late-border: rgba(220, 38, 38, 0.35);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 8px 20px -2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(37, 99, 235, 0.2);
}

/* --------------------------------------------------------------------------
   3. BASE RESETS & SCROLLBAR
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.9125rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.22);
}
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}
[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* --------------------------------------------------------------------------
   4. APP LAYOUT SHELL (SIDEBAR + MAIN CANVAS)
   -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR */
.app-sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 40;
  transition: transform var(--transition-smooth);
}

/* Sidebar Brand */
.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-emblem {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--primary-glow);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.pro-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-xs);
}

/* Sidebar Quick Action */
.sidebar-cta-wrap {
  padding: 0.85rem 1.15rem 0.45rem;
}
.btn-block {
  width: 100%;
}

/* Nav Scroll Area */
.sidebar-nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.6rem 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.nav-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.btn-mini-add {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}
.btn-mini-add:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-bg);
}

/* Month Tabs List in Sidebar */
.month-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.month-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  transition: var(--transition-fast);
  text-align: left;
  width: 100%;
}
.month-tab-btn > span:first-child {
  white-space: nowrap;
  flex-shrink: 0;
}
.month-tab-btn:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}
.month-tab-btn.active {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 700;
}

.month-badge {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.month-tab-btn.active .month-badge {
  background: var(--primary);
  color: #ffffff;
  border-color: transparent;
}

/* Sidebar Menu */
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.48rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
  text-align: left;
}
.nav-item:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
}
.nav-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-border);
  font-weight: 700;
}
.nav-icon {
  font-size: 0.95rem;
}

/* Sidebar Tools */
.sidebar-tools {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.46rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
  text-align: left;
}
.sidebar-tool-btn:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-subtle);
}

.status-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-done);
  margin-left: auto;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem 1.15rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.color-palette-section {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle);
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--swatch-color);
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.22);
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--bg-sidebar), 0 0 0 3.5px var(--text-main);
  transform: scale(1.15);
}

.custom-color-btn {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}
.custom-color-btn:hover {
  border-color: var(--primary);
}
.custom-color-btn input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.custom-color-icon {
  font-size: 0.75rem;
  pointer-events: none;
}

.theme-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.theme-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}
.theme-switch-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}
.theme-switch-btn:hover {
  border-color: var(--primary);
}

.sidebar-version-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
}
.dot-separator {
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   5. TOP COMMAND BAR
   -------------------------------------------------------------------------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-canvas);
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1.15rem;
  flex-shrink: 0;
  z-index: 30;
}

.btn-sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 1rem;
}

.topbar-context {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.context-pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.context-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Global Search Box */
.topbar-search-box {
  position: relative;
  width: 310px;
  display: flex;
  align-items: center;
}

.topbar-search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 4.5rem 0.45rem 2.1rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition-fast);
}
.topbar-search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  background: var(--bg-card);
}

.search-ico {
  position: absolute;
  left: 0.65rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  pointer-events: none;
}

.shortcut-key {
  position: absolute;
  right: 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: 0.1rem 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  pointer-events: none;
}

/* Top Actions */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.sync-beacon {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.beacon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--status-done);
  box-shadow: 0 0 6px var(--status-done);
}

.beacon-label {
  color: var(--text-secondary);
}

.beacon-google {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 0.08rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--primary-border);
  cursor: pointer;
  transition: var(--transition-fast);
}
.beacon-google:hover {
  background: rgba(59, 130, 246, 0.22);
}

.btn-hero-save {
  background: var(--status-done);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-hero-save:hover {
  background: #059669;
}

/* --------------------------------------------------------------------------
   6. SCROLLABLE WORKSPACE & EDITORIAL METRIC DECK
   -------------------------------------------------------------------------- */
.workspace-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Smart Alert Card */
.smart-alert-card {
  background: var(--status-wip-bg);
  border: 1px solid var(--status-wip-border);
  border-left: 4px solid var(--status-wip);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.alert-icon-box {
  font-size: 1.1rem;
}
.alert-body {
  flex: 1;
  font-size: 0.84rem;
  color: var(--text-main);
}

/* KPI Deck Layout (12-Column Grid with Clear Visual Hierarchy) */
.kpi-deck {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

/* Generic KPI Widget Base */
.kpi-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.kpi-widget:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

/* Hero Cards (Span 6 columns each on top row) */
.kpi-highlight-revenue {
  grid-column: span 6;
  border-left: 3px solid var(--primary);
}
.kpi-highlight-caps {
  grid-column: span 6;
  border-left: 3px solid var(--status-done);
}

/* Secondary Production Breakdown Cards (Span 3 columns each on bottom row) */
.kpi-highlight-clrdtype {
  grid-column: span 3;
  border-left: 3px solid var(--role-combo);
}
.kpi-highlight-type {
  grid-column: span 3;
  border-left: 3px solid var(--role-type);
}
.kpi-highlight-clrd {
  grid-column: span 3;
  border-left: 3px solid var(--role-clrd);
}
.kpi-highlight-extras {
  grid-column: span 3;
  border-left: 3px solid var(--accent-amber);
}

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

.kpi-tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.kpi-icon-badge {
  font-size: 0.95rem;
  opacity: 0.75;
}

.btn-micro-add {
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition-fast);
}
.btn-micro-add:hover {
  background: var(--primary);
  color: #fff;
}

.kpi-number {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  line-height: 1.1;
}

.kpi-sub-row {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.kpi-pill-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  font-size: 0.75rem;
}

.kpi-val-highlight {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.8rem;
}

.kpi-muted-desc {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.kpi-progress-track {
  width: 100%;
  height: 5px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.15rem;
}
.kpi-progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--status-done);
  transition: width 0.35s ease;
}

.kpi-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.status-chip {
  padding: 0.15rem 0.48rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.status-chip:hover {
  filter: brightness(1.15);
}
.chip-done { background: var(--status-done-bg); color: var(--status-done); border-color: var(--status-done-border); }
.chip-wip { background: var(--status-wip-bg); color: var(--status-wip); border-color: var(--status-wip-border); }
.chip-pending { background: var(--status-pending-bg); color: var(--status-pending); border-color: var(--status-pending-border); }
.chip-late {
  background: var(--status-late-bg);
  color: var(--status-late);
  border-color: var(--status-late-border);
}
.chip-late.has-late {
  font-weight: 700;
  border-color: var(--status-late);
}

/* --------------------------------------------------------------------------
   7. CONTROL DOCK & VIEW SWITCHER
   -------------------------------------------------------------------------- */
.filter-control-dock {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.view-buttons {
  display: flex;
  gap: 0.25rem;
  background: var(--bg-input);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
}

.view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.42rem 0.85rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.view-btn:hover {
  color: var(--text-main);
}
.view-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.view-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.select-modern {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.42rem 0.75rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}
.select-modern:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Status Legend Bar */
.status-legend-bar {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 0.45rem 0.95rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.legend-header {
  font-weight: 700;
  color: var(--text-secondary);
}
.legend-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}
.legend-circle {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.legend-circle.red { background-color: var(--status-pending); }
.legend-circle.yellow { background-color: var(--status-wip); }
.legend-circle.green { background-color: var(--status-done); }
.legend-circle.late { background-color: var(--status-late); }
.late-chip { color: var(--status-late); font-weight: 600; }
.legend-tip { margin-left: auto; color: var(--text-dim); font-size: 0.74rem; }

/* Batch Floating Bar */
.batch-floating-bar {
  background: var(--bg-card);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  box-shadow: var(--shadow-md);
  flex-wrap: wrap;
}

.batch-badge {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-main);
  font-family: var(--font-mono);
}
.batch-button-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-batch {
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
}
.btn-rose { background: var(--status-pending-bg); color: var(--status-pending); border: 1px solid var(--status-pending-border); }
.btn-amber { background: var(--status-wip-bg); color: var(--status-wip); border: 1px solid var(--status-wip-border); }
.btn-green { background: var(--status-done-bg); color: var(--status-done); border: 1px solid var(--status-done-border); }
.btn-late { background: var(--status-late-bg); color: var(--status-late); border: 1px solid var(--status-late-border); }
.btn-danger { background: var(--accent-rose); color: #fff; }

/* --------------------------------------------------------------------------
   8. VIEW 1: DATA TABLE
   -------------------------------------------------------------------------- */
.view-panel {
  display: none;
}
.view-panel.active {
  display: block;
}

.table-glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.data-table th {
  background: var(--bg-input);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 700;
  padding: 0.75rem 1rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--transition-fast);
}
.data-table tbody tr:hover {
  background-color: var(--bg-card-hover);
}

/* Custom Checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: var(--transition-fast);
  vertical-align: middle;
}
input[type="checkbox"]:hover {
  border-color: var(--primary);
}
input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}
input[type="checkbox"]:checked::before {
  content: "✓";
  color: white;
  font-size: 10px;
  font-weight: 900;
}

/* Chapter & Mono Pills */
.cap-mono-pill {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.76rem;
  color: var(--primary);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  display: inline-block;
}

.table-row-actions {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-clrd-type {
  background: var(--role-combo-bg);
  color: var(--role-combo);
  border: 1px solid var(--role-combo-border);
}
.badge-type {
  background: var(--role-type-bg);
  color: var(--role-type);
  border: 1px solid var(--role-type-border);
}
.badge-clrd {
  background: var(--role-clrd-bg);
  color: var(--role-clrd);
  border: 1px solid var(--role-clrd-border);
}

.badge-status {
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
}
.badge-status:hover {
  filter: brightness(1.2);
}

.badge-concluido {
  background: var(--status-done-bg);
  color: var(--status-done);
  border: 1px solid var(--status-done-border);
}
.badge-wip {
  background: var(--status-wip-bg);
  color: var(--status-wip);
  border: 1px solid var(--status-wip-border);
}
.badge-nao-comecei {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid var(--status-pending-border);
}
.badge-atrasado {
  background: var(--status-late-bg);
  color: var(--status-late);
  border: 1px solid var(--status-late-border);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   9. VIEW 2: KANBAN STUDIO
   -------------------------------------------------------------------------- */
.kanban-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.15rem;
  align-items: flex-start;
}

.kanban-lane {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: 820px;
  box-shadow: var(--shadow-sm);
}

.lane-nao-comecei { border-top: 3px solid var(--status-pending); }
.lane-wip { border-top: 3px solid var(--status-wip); }
.lane-concluido { border-top: 3px solid var(--status-done); }

.kanban-lane-header {
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lane-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.lane-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.lane-counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.kanban-cards-stack {
  padding: 0.95rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kanban-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.kanban-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.kanban-card-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.kanban-card-cap {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-card);
  padding: 0.12rem 0.4rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.kanban-card-dates {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.kanban-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   10. VIEW 3: CATÁLOGO POR OBRA
   -------------------------------------------------------------------------- */
.obras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.15rem;
}

.obra-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}
.obra-card:hover {
  border-color: var(--border-medium);
}

.obra-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.obra-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border-subtle);
}
.obra-stat-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

/* --------------------------------------------------------------------------
   11. VIEW 4: ANALYTICS & CHARTS
   -------------------------------------------------------------------------- */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.25rem;
}

.chart-glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.panel-header h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.chart-wrapper {
  position: relative;
  height: 280px;
  width: 100%;
}

/* --------------------------------------------------------------------------
   12. VIEW 5: RATES & EXTRAS
   -------------------------------------------------------------------------- */
.rates-layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  box-shadow: var(--shadow-sm);
}

.card-header-styled {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-header-styled h3 {
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.input-prefix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-dim);
  pointer-events: none;
}
.input-prefix-wrapper .form-control {
  padding-left: 2.2rem;
}

.extras-items-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   13. BUTTONS & FORMS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-hover);
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--border-medium);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

.btn-success {
  background: var(--status-done);
  color: #fff;
  border-color: rgba(16, 185, 129, 0.4);
}
.btn-success:hover {
  background: #059669;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.btn-sm {
  padding: 0.32rem 0.65rem;
  font-size: 0.78rem;
}

.form-group-modern {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group-modern label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.86rem;
  outline: none;
  transition: var(--transition-fast);
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
  background: var(--bg-card);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.late-toggle-box {
  background: var(--status-late-bg);
  border: 1px solid var(--status-late-border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.late-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}
.late-toggle-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--status-late);
}

/* --------------------------------------------------------------------------
   14. MODALS SYSTEM
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: var(--bg-modal-overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 1.15rem;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-modal);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(8px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 680px; }

.modal-head {
  padding: 1.15rem 1.45rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
}
.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-card-subtle);
}

.modal-inner {
  padding: 1.35rem 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
}

.modal-foot {
  padding: 1.05rem 1.45rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  background: var(--bg-card-subtle);
}

/* Discord Box */
.discord-code-box {
  background-color: #1e1f22;
  color: #dbdee1;
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  white-space: pre-wrap;
  line-height: 1.45;
  border: 1px solid rgba(255, 255, 255, 0.08);
  user-select: all;
  max-height: 360px;
  overflow-y: auto;
}

/* Cloud Modal Styles */
.input-with-action {
  display: flex;
  gap: 0.45rem;
}
.input-with-action input { flex: 1; }

.cloud-status-widget {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cloud-status-title {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}
.cloud-status-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.auto-sync-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
}
.auto-sync-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.cloud-action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.guide-accordion {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.guide-accordion summary {
  cursor: pointer;
  font-weight: 600;
}
.guide-steps {
  margin-top: 0.65rem;
  padding-left: 1.15rem;
  line-height: 1.55;
}

.batch-preview-pill {
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* --------------------------------------------------------------------------
   15. TOAST NOTIFICATIONS & FOOTER
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-modal);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes toastIn {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast.success { border-left: 3px solid var(--status-done); }
.toast.error { border-left: 3px solid var(--status-late); }
.toast.info { border-left: 3px solid var(--primary); }

.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-topbar);
  padding: 0.75rem 1.5rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.footer-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.footer-tag {
  background: var(--bg-card-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

/* --------------------------------------------------------------------------
   16. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .kpi-highlight-revenue,
  .kpi-highlight-caps {
    grid-column: span 12;
  }
  .kpi-highlight-clrdtype,
  .kpi-highlight-type,
  .kpi-highlight-clrd,
  .kpi-highlight-extras {
    grid-column: span 6;
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }
  .btn-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .topbar-search-box {
    width: 220px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0 1rem;
  }
  .workspace-content {
    padding: 1rem;
  }
  .topbar-search-box {
    display: none;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .kpi-highlight-clrdtype,
  .kpi-highlight-type,
  .kpi-highlight-clrd,
  .kpi-highlight-extras {
    grid-column: span 12;
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --------------------------------------------------------------------------
   17. GOOGLE AUTH GATEKEEPER & USER PROFILE
   -------------------------------------------------------------------------- */
.auth-gatekeeper-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(10, 11, 14, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.35s ease;
}

[data-theme="light"] .auth-gatekeeper-overlay {
  background: rgba(245, 246, 250, 0.96);
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.5);
  animation: authFadeUp 0.3s ease-out;
}

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

.auth-card-emblem {
  width: 58px;
  height: 58px;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-base), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  box-shadow: 0 8px 24px -4px var(--accent-base);
}

.auth-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  margin-bottom: 0.85rem;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.6rem;
}

.auth-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.btn-google-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #1f1f1f;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid #dadce0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.btn-google-login:hover:not(:disabled) {
  background: #f8f9fa;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-google-login:active:not(:disabled) {
  transform: translateY(0);
}

.btn-google-login:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.google-icon {
  flex-shrink: 0;
}

.auth-status-msg {
  margin-top: 1rem;
  font-size: 0.82rem;
  min-height: 22px;
  font-weight: 500;
  line-height: 1.4;
}

.auth-card-footer {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Sidebar Profile Block */
.auth-sidebar-profile {
  margin-top: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.auth-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  text-align: left;
}

.auth-user-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-user-email {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-signout {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  opacity: 0.7;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.btn-signout:hover {
  opacity: 1;
  transform: scale(1.1);
}
