/* ==========================================================================
   CLARITYAI EXECUTIVE INTELLIGENCE SUITE — STYLE SYSTEM (CHAT-FIRST DASHBOARD)
   Corporate Premium Aesthetics. Dark / Light Dual Themes.
   ========================================================================== */

/* Design Tokens & Theme Palettes */
:root {
  --transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  /* Claude-style Typography Stack */
  --font-sans: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Lora', ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', 'DM Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  
  /* Primary Executive Colors */
  --accent: #F29F67;      /* Peach Accent */
  --accent-hover: #E08B52;
  --accent-glow: rgba(242, 159, 103, 0.12);
  --blue: #3B8FF3;        /* Support Blue */
  --success: #34B1AA;     /* Support Teal */
  --gold: #E0B50F;        /* Support Gold */
  --error: #E55039;
  --error-bg: rgba(229, 80, 57, 0.08);
}

/* DARK THEME (Default) */
.theme-dark {
  --bg-primary: #14141F;
  --bg-secondary: #1E1E2C;
  --bg-tertiary: #272738;
  --bg-hover: #2E2E42;
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(242, 159, 103, 0.4);
  --text-primary: #FAF9F6;
  --text-secondary: #A0A0B0;
  --text-muted: #6A6A80;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  --glass-bg: rgba(30, 30, 44, 0.7);
  --scrollbar: rgba(255, 255, 255, 0.08);
  --user-bubble: #F29F67;
  --user-bubble-text: #1E1E2C;
}

/* LIGHT THEME */
.theme-light {
  --bg-primary: #F4F5F8;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #ECEEF2;
  --bg-hover: #DFE2E8;
  --border: rgba(30, 30, 44, 0.08);
  --border-focus: rgba(242, 159, 103, 0.5);
  --text-primary: #1E1E2C;
  --text-secondary: #5C5C70;
  --text-muted: #9E9EAF;
  --card-shadow: 0 4px 20px rgba(30, 30, 44, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.85);
  --scrollbar: rgba(0, 0, 0, 0.08);
  --user-bubble: #1E1E2C;
  --user-bubble-text: #FFFFFF;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition), color var(--transition);
}

/* App Shell Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* Top Navigation Bar */
.topnav {
  height: 68px;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  transition: background-color var(--transition), border-color var(--transition);
  flex-shrink: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(242, 159, 103, 0.25);
  transition: background-color var(--transition);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-text h1 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 1px solid var(--border);
  padding-left: 8px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 99px; /* Premium Pill style button */
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: all var(--transition);
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn.icon-only {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--success);
  background: rgba(52, 177, 170, 0.08);
  border: 1px solid rgba(52, 177, 170, 0.15);
  padding: 5px 12px;
  border-radius: 99px;
}

.status-dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ── CENTERED CHAT CONTAINER ── */
.chat-container {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 68px);
  position: relative;
  padding: 0 20px;
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  scroll-behavior: smooth;
}

.chat-feed::-webkit-scrollbar { width: 5px; }
.chat-feed::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 99px; }

/* System Welcome Greeting */
.system-welcome-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--card-shadow);
  margin-bottom: 10px;
}

.welcome-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(242,159,103,0.2);
  margin-bottom: 14px;
  text-transform: uppercase;
}

.system-welcome-card h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.system-welcome-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Greeting Prompts List */
.suggest-section h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

.suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.suggest-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.suggest-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
  background: var(--bg-hover);
}

.suggest-card-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.suggest-card-icon.purple { background: rgba(242, 159, 103, 0.1); color: var(--accent); }
.suggest-card-icon.cyan { background: rgba(59, 143, 243, 0.1); color: var(--blue); }
.suggest-card-icon.amber { background: rgba(224, 181, 15, 0.1); color: var(--gold); }

.suggest-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0 !important;
}

.suggest-card p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0 !important;
}

/* ── DIALOGUE MESSAGES (DASHBOARD RESPONSE CARDS) ── */
.message {
  display: flex;
  flex-direction: column;
  animation: msg-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.message.user {
  max-width: 75%;
  align-self: flex-end;
  align-items: flex-end;
}

.message.agent {
  width: 100%;
  align-self: stretch;
  align-items: flex-start;
}

.msg-sender {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* User Bubble style */
.message.user .msg-body {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-radius: var(--radius-md);
  border-bottom-right-radius: 2px;
  padding: 12px 18px;
  font-size: 0.88rem;
  line-height: 1.5;
  box-shadow: var(--card-shadow);
  word-break: break-word;
}

/* Agent dashboard bubble style */
.message.agent .msg-body {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  padding: 24px;
  color: var(--text-primary);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--card-shadow);
}

/* Dashboard Narrative text — Claude-style typography (Lora serif = closest to Tiempos Text) */
.dashboard-narrative {
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.75;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

.dashboard-narrative p {
  margin-bottom: 14px;
  color: var(--text-primary);
}

.dashboard-narrative p:last-child {
  margin-bottom: 0;
}

.dashboard-narrative ul, .dashboard-narrative ol {
  margin-left: 24px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.dashboard-narrative li {
  margin-bottom: 6px;
  line-height: 1.75;
}

.dashboard-narrative strong {
  font-weight: 600;
  color: var(--text-primary);
}

.dashboard-narrative em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Claude-style headings inside AI responses */
.dashboard-narrative h1,
.dashboard-narrative h2,
.dashboard-narrative h3,
.dashboard-narrative h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  line-height: 1.35;
  margin-top: 20px;
  margin-bottom: 8px;
}

.dashboard-narrative h1 { font-size: 1.35rem; }
.dashboard-narrative h2 { font-size: 1.18rem; }
.dashboard-narrative h3 { font-size: 1.05rem; }
.dashboard-narrative h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-sans); color: var(--text-secondary); font-weight: 700; }

/* Claude-style inline code */
.dashboard-narrative code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  color: var(--accent);
}

/* Claude-style code blocks */
.dashboard-narrative pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  overflow-x: auto;
  margin-bottom: 14px;
  line-height: 1.6;
}

.dashboard-narrative pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--text-primary);
}

/* Horizontal rule */
.dashboard-narrative hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* Claude-style blockquote */
.dashboard-narrative blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Embedded Dashboard KPI Deck */
.embedded-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.embedded-kpi-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.embedded-kpi-card.purple { border-left: 3px solid var(--accent); }
.embedded-kpi-card.blue { border-left: 3px solid var(--blue); }
.embedded-kpi-card.teal { border-left: 3px solid var(--success); }
.embedded-kpi-card.gold { border-left: 3px solid var(--gold); }

.embedded-kpi-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.embedded-kpi-value {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.embedded-kpi-trend {
  font-size: 0.68rem;
  font-weight: 600;
}

.embedded-kpi-trend.positive { color: var(--success); }
.embedded-kpi-trend.neutral { color: var(--text-muted); }

/* Embedded Dashboard Chart Card */
.embedded-chart-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
}

.card-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.card-title-bar h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.chart-legend-dots {
  display: flex;
  gap: 6px;
}

.chart-legend-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.chart-legend-dots .dot.p { background: var(--accent); }
.chart-legend-dots .dot.c { background: var(--blue); }

.chart-canvas-wrapper {
  position: relative;
  width: 100%;
}

.embedded-chart-canvas {
  width: 100%;
  height: 360px;
}

/* Embedded Dashboard Data Table Card */
.embedded-table-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.table-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 99px; /* Pill search shape */
  width: 200px;
  transition: border-color var(--transition);
}

.table-search-box:focus-within {
  border-color: var(--accent);
}

.table-search-box input {
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.78rem;
  color: var(--text-primary);
  width: 100%;
}

.action-btn-primary {
  background: var(--accent);
  color: var(--bg-secondary);
  border: none;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 99px; /* Pill action buttons */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 10px var(--accent-glow);
  transition: all var(--transition);
}

.action-btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 15px rgba(242, 159, 103, 0.25);
}

.action-btn-primary:active {
  transform: translateY(0);
}

.records-table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

#recordsTable, .records-table-container table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  text-align: left;
}

#recordsTable th, #recordsTable td,
.records-table-container table th,
.records-table-container table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

#recordsTable th, .records-table-container table th {
  background: var(--bg-hover);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.3px;
}

#recordsTable tr:last-child td,
.records-table-container table tr:last-child td {
  border-bottom: none;
}

#recordsTable tbody tr,
.records-table-container table tbody tr {
  transition: background-color var(--transition);
}

#recordsTable tbody tr:hover,
.records-table-container table tbody tr:hover {
  background: var(--bg-hover);
}

.table-empty-row {
  padding: 16px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── INPUT CONSOLE DOCK ── */
.input-dock {
  padding: 16px 0 28px;
  background: var(--bg-primary);
  flex-shrink: 0;
  border-top: 1px solid transparent; /* Replaces border divider with clean margins */
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.input-box {
  flex: 1;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
  box-shadow: var(--card-shadow);
}

.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-box textarea {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  resize: none;
  outline: none;
  line-height: 1.45;
  height: auto;
  max-height: 120px;
}

.input-box textarea::placeholder {
  color: var(--text-muted);
}

.send-btn {
  background: var(--accent);
  border: none;
  color: var(--bg-secondary);
  width: 44px;
  height: 44px;
  border-radius: 50%; /* Rounded circle button styling */
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  box-shadow: 0 4px 10px var(--accent-glow);
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.08) rotate(-15deg);
  box-shadow: 0 6px 15px rgba(242, 159, 103, 0.3);
}

.send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.send-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.input-hint {
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.input-hint kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.6rem;
}

/* ── SLIDE-OUT CATALOG DRAWER ── */
.catalog-drawer {
  position: fixed;
  top: 68px;
  right: -420px; /* Shifted out of view by default */
  width: 400px;
  height: calc(100vh - 68px);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
  z-index: 100;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.catalog-drawer.active {
  right: 0;
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.drawer-header-title h3 {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}

.drawer-close:hover {
  color: var(--accent);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-content::-webkit-scrollbar { width: 5px; }
.drawer-content::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 99px; }

/* Backdrop screen overlay */
.drawer-backdrop {
  position: fixed;
  top: 68px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 68px);
  background: rgba(9, 9, 15, 0.5);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Metadata Schema Card list inside drawer */
.schema-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--card-shadow);
  transition: border-color var(--transition);
}

.schema-card:hover {
  border-color: var(--accent);
}

.schema-card h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.schema-card-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.35;
}

.column-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.column-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  font-size: 0.7rem;
}

.col-name {
  font-family: var(--font-mono);
  font-weight: 550;
  color: var(--text-primary);
}

.col-type {
  font-size: 0.58rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 99px;
  text-transform: uppercase;
}

.col-type.numeric { background: rgba(59, 143, 243, 0.1); color: var(--blue); }
.col-type.string { background: rgba(242, 159, 103, 0.1); color: var(--accent); }
.col-type.datetime { background: rgba(52, 177, 170, 0.1); color: var(--success); }
.col-type.other { background: var(--bg-tertiary); color: var(--text-secondary); }

.loading-catalog-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── ERROR MESSAGE BUBBLE ── */
.error-bubble {
  border: 1px solid var(--error) !important;
  background: var(--error-bg) !important;
  color: var(--error) !important;
}

/* ── CUSTOM SCANNERS / RADAR LOADER ── */
.executive-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  gap: 14px;
  width: 100%;
}

.scanner-ring {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-ring::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  animation: spin-ring 1.4s linear infinite;
}

.pulse-glow {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse-glow-dot 1.2s infinite ease-in-out alternate;
}

@keyframes spin-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-glow-dot {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.15); opacity: 1; }
}

.loader-text {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: loader-text-pulse 1.4s infinite ease-in-out;
}

@keyframes loader-text-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ── EXECUTIVE SPARKLE LOADER ── */
.executive-sparkle-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sparkle-container {
  position: relative;
  width: 48px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sparkle {
  position: absolute;
  color: var(--accent);
  fill: currentColor;
  filter: drop-shadow(0 0 3px var(--accent));
}

.sparkle.large {
  width: 20px;
  height: 20px;
  top: 6px;
  left: 14px;
  animation: sparkle-pulse-large 1.6s infinite ease-in-out;
}

.sparkle.small-1 {
  width: 10px;
  height: 10px;
  top: 2px;
  left: 4px;
  opacity: 0.6;
  animation: sparkle-pulse-small 1.6s infinite ease-in-out 0.4s;
}

.sparkle.small-2 {
  width: 8px;
  height: 8px;
  bottom: 2px;
  right: 6px;
  opacity: 0.5;
  animation: sparkle-pulse-small 1.6s infinite ease-in-out 0.8s;
}

@keyframes sparkle-pulse-large {
  0%, 100% {
    transform: scale(0.85) rotate(0deg);
    opacity: 0.7;
    filter: drop-shadow(0 0 2px var(--accent));
  }
  50% {
    transform: scale(1.15) rotate(15deg);
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--accent));
  }
}

@keyframes sparkle-pulse-small {
  0%, 100% {
    transform: scale(0.85) rotate(0deg);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.2) rotate(-15deg);
    opacity: 0.8;
  }
}

/* ── MAIN WORKSPACE & SIDEBAR SYSTEM ── */
.main-workspace {
  display: flex;
  flex-direction: row;
  height: calc(100vh - 68px);
  width: 100%;
  overflow: hidden;
  position: relative;
}

.chat-sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
  transition: width var(--transition), transform var(--transition), left var(--transition);
  overflow: hidden;
  z-index: 10;
}

.chat-sidebar.collapsed {
  width: 0;
  border-right: none;
}

.chat-area {
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  position: relative;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.new-chat-btn:hover {
  background: var(--accent);
  color: var(--bg-secondary);
  box-shadow: 0 4px 12px rgba(242, 159, 103, 0.2);
  transform: translateY(-1px);
}

.sidebar-sessions-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-sessions-list::-webkit-scrollbar {
  width: 4px;
}

.sidebar-sessions-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar);
  border-radius: 99px;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.session-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.session-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.session-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.session-icon {
  flex-shrink: 0;
  opacity: 0.7;
}

.session-item.active .session-icon {
  color: var(--accent);
  opacity: 1;
}

.session-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.82rem;
}

.session-delete-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: none;
  transition: all var(--transition);
  flex-shrink: 0;
}

.session-item:hover .session-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-delete-btn:hover {
  color: var(--error);
  background: var(--error-bg);
}

.sessions-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 20px 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 68px);
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 9;
  transition: opacity var(--transition);
}

/* ── RESPONSIVE ADAPTATIONS ── */
@media (max-width: 768px) {
  .chat-container { padding: 0 10px; }
  .brand-sub { display: none; }
  .topnav { padding: 0 16px; }
  .catalog-drawer { width: 100%; right: -100%; }
  
  .chat-sidebar {
    position: fixed;
    top: 68px;
    left: -280px;
    height: calc(100vh - 68px);
    z-index: 98;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
  }
  
  .chat-sidebar.active {
    transform: translateX(280px);
  }
  
  .sidebar-backdrop.active {
    display: block;
  }
}

/* Premium Confirmation Modal Overlay */
.confirm-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition);
}

.confirm-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.confirm-modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 380px;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(20px);
  transition: transform var(--transition);
}

.confirm-modal-overlay.active .confirm-modal-card {
  transform: translateY(0);
}

.confirm-modal-icon {
  width: 50px;
  height: 50px;
  background: var(--error-bg);
  color: var(--error);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 10px rgba(229, 80, 57, 0.1);
}

.confirm-modal-card h3 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.confirm-modal-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn-secondary {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
}

.modal-btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.modal-btn-primary {
  background: var(--error);
  border: none;
  color: #FAF9F6;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 8px 20px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition);
  box-shadow: 0 4px 10px rgba(229, 80, 57, 0.25);
}

.modal-btn-primary:hover {
  background: #d63f28;
  box-shadow: 0 4px 12px rgba(229, 80, 57, 0.4);
  transform: translateY(-1px);
}

