/* ============================================================================== */
/* RTWDMS AI Assistant - Professional AI Chat Workspace Stylesheet              */
/* Uttar Pradesh Irrigation and Water Resources Department                        */
/* ============================================================================== */

:root {
  /* Surface & Background Colors */
  --bg-main: #FFFFFF;
  --bg-subtle: #F6F9FC;
  --bg-sidebar: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-chat-user: #EFF6FF;
  --bg-chat-bot: #FFFFFF;

  /* Border Tokens */
  --border-color: #E2E8F0;
  --border-subtle: #F1F5F9;
  --border-focus: #0284C7;

  /* Typography Colors */
  --text-main: #111827;
  --text-heading: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;

  /* Government-Appropriate Primary Blues */
  --primary: #0284C7;
  --primary-hover: #0369A1;
  --primary-active: #075985;
  --primary-light: #E0F2FE;
  --primary-tint: #F0F9FF;
  --accent: #2563EB;

  /* Status Colors */
  --success: #15803D;
  --success-bg: #DCFCE7;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --code-bg: #F8FAFC;

  /* Depth & Elevation */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);

  /* Border Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Layout Geometry */
  --sidebar-width: 270px;
  --header-height: 54px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-subtle);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: row;
  position: relative;
}

/* ============================================================================== */
/* 1. COLLAPSIBLE ENTERPRISE SIDEBAR (ChatGPT / Claude Style)                     */
/* ============================================================================== */
.chat-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 50;
  flex-shrink: 0;
  transition: width 0.24s cubic-bezier(0.16, 1, 0.3, 1), transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.02);
  user-select: none;
}

body.sidebar-collapsed .chat-sidebar {
  margin-left: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  min-width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 64px);
  overflow: hidden;
  padding: 14px 12px 6px 12px;
  gap: 12px;
}

/* Sidebar Brand Header */
.sidebar-brand-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 6px 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.logo-badge {
  width: 36px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.brand-dept {
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  line-height: 1.2;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover {
  background: #E2E8F0;
  color: var(--text-heading);
}

/* New Chat Primary Action Button */
.sidebar-action-wrap {
  width: 100%;
}

.btn-new-chat {
  width: 100%;
  min-width: 100%;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-heading);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  white-space: nowrap;
}

.btn-new-chat svg {
  color: var(--primary);
  margin-right: 8px;
}

.btn-new-chat .btn-text {
  flex: 1;
  text-align: left;
}

.btn-new-chat .shortcut-kbd {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  background: var(--border-subtle);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--text-muted);
}

.btn-new-chat:hover {
  background: var(--primary-tint);
  border-color: #BAE6FD;
  color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.12);
}

/* Sidebar Search Bar */
.sidebar-search-wrap {
  width: 100%;
}

.search-input-box {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 34px;
  gap: 8px;
  transition: all 0.15s ease;
}

.search-input-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.search-input-box svg {
  color: var(--text-subtle);
  flex-shrink: 0;
}

.search-input-box input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 12.5px;
  color: var(--text-main);
  width: 100%;
}

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

.clear-search-btn {
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
}

/* History Section & Scroll List */
.sidebar-history-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: 4px;
}

.history-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  margin-bottom: 4px;
}

.section-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.history-clear-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: none;
  color: var(--text-main);
}

.history-item-row:hover {
  background: #EFF6FF;
  border-color: #DBEAFE;
}

.history-item-row.active {
  background: #E0F2FE;
  border-color: #BAE6FD;
  color: #0369A1;
  font-weight: 600;
}

.history-item-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  padding-right: 6px;
}

.history-item-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.history-item-date {
  font-size: 11px;
  color: var(--text-subtle);
  line-height: 1.2;
}

.history-item-actions {
  display: none;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.history-item-row:hover .history-item-actions,
.history-item-row.active .history-item-actions {
  display: flex;
}

.history-action-btn {
  background: transparent;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.history-action-btn:hover {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.history-action-btn.delete-btn:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.history-empty-state {
  text-align: center;
  padding: 30px 10px;
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.5;
}

/* Sidebar Bottom Footer Row */
.sidebar-bottom {
  border-top: 1px solid var(--border-color);
  padding: 10px 12px;
  background: #FFFFFF;
}

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

.sidebar-lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  height: 32px;
}

.sidebar-lang-switcher .lang-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.2;
  transition: all 0.15s ease;
}

.sidebar-lang-switcher .lang-btn.active {
  background: #FFFFFF;
  color: var(--primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  font-weight: 700;
}

.sidebar-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sidebar-nav-btn:hover {
  background: var(--primary-tint);
  color: var(--primary);
  border-color: #BAE6FD;
}

.sidebar-nav-btn.voice-active {
  color: var(--primary);
  background: #F0F9FF;
  border-color: #BAE6FD;
}

.sidebar-nav-btn.speaking-pulse {
  animation: speakerPulse 1.2s infinite ease-in-out;
  border-color: #0284C7 !important;
  color: #0284C7 !important;
  background: #E0F2FE !important;
}

@keyframes speakerPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.45); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(2, 132, 199, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(2, 132, 199, 0); }
}

.sidebar-logout-btn:hover {
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
  border-color: #FECACA !important;
}

/* ============================================================================== */
/* 2. COMPACT HEADER & WORKSPACE VIEWPORT                                         */
/* ============================================================================== */
.app-main {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  background: var(--bg-main);
  position: relative;
  overflow: hidden;
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

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

.header-toggle-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.header-toggle-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-heading);
  border-color: var(--border-color);
}

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

.mobile-brand-icon {
  display: none;
}

.brand-titles h1 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.brand-titles h1 .tag {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid #BAE6FD;
  padding: 1px 7px;
  border-radius: var(--radius-full);
}

.brand-titles p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16A34A;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.2);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

.header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

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

/* ============================================================================== */
/* 3. ASSISTANT WELCOME LANDING SCREEN                                            */
/* ============================================================================== */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px calc(max(20px, (100% - 840px) / 2)) 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  width: 100%;
}

.welcome-card {
  margin: auto 0;
  padding: 30px 10px 10px 10px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 30px;
}

.welcome-icon {
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(2, 132, 199, 0.2));
}

.welcome-hero h2 {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.welcome-hero p {
  font-size: 14.5px;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.6;
  margin: 0 auto;
}

/* 6 Suggested Question Cards Grid */
.suggested-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
  text-align: left;
}

.suggested-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.suggested-card:hover {
  transform: translateY(-2px);
  border-color: #0284C7;
  background: #FFFFFF;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.1);
}

.card-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon-box.blue { background: #E0F2FE; color: #0284C7; }
.card-icon-box.cyan { background: #ECFEFF; color: #0891B2; }
.card-icon-box.orange { background: #FFF7ED; color: #EA580C; }
.card-icon-box.red { background: #FEF2F2; color: #DC2626; }
.card-icon-box.purple { background: #F3E8FF; color: #7C3AED; }
.card-icon-box.green { background: #F0FDF4; color: #16A34A; }

.card-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.card-prompt {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================================================================== */
/* 4. CONVERSATION MESSAGES & DATA CARDS                                          */
/* ============================================================================== */
.message-row {
  display: flex;
  width: 100%;
  animation: messageSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.message-row.assistant,
.message-row.bot {
  justify-content: flex-start;
}

.bubble {
  padding: 16px 20px;
  font-size: 14.5px;
  line-height: 1.7;
  word-break: break-word;
  position: relative;
}

/* User Message Bubble */
.message-row.user .bubble {
  background: var(--bg-chat-user);
  color: #0369A1;
  border: 1px solid #BAE6FD;
  border-radius: 18px 18px 4px 18px;
  font-weight: 500;
  max-width: 82%;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.05);
}

/* Assistant Message Bubble */
.message-row.assistant .bubble,
.message-row.bot .bubble {
  background: #FFFFFF;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
}

/* Assistant Header Badge inside bubble */
.assistant-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #F1F5F9;
}

.assistant-identity {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
}

.route-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: #F1F5F9;
  color: #475569;
  border: 1px solid #E2E8F0;
  text-transform: uppercase;
}

.route-badge.database_query,
.route-badge.sql_data {
  background: #EFF6FF;
  color: #1D4ED8;
  border-color: #DBEAFE;
}

.route-badge.timeseries_analytics {
  background: #FAF5FF;
  color: #7E22CE;
  border-color: #F3E8FF;
}

.route-badge.sop_document,
.route-badge.semantic_knowledge {
  background: #F0FDF4;
  color: #15803D;
  border-color: #DCFCE7;
}

.route-badge.web_search,
.route-badge.gemini_grounding {
  background: #FEF3C7;
  color: #B45309;
  border-color: #FDE68A;
}

/* Assistant Markdown Styling */
.message-row.assistant .bubble p {
  margin-bottom: 12px;
  line-height: 1.7;
}

.message-row.assistant .bubble p:last-child {
  margin-bottom: 0;
}

.message-row.assistant .bubble h1,
.message-row.assistant .bubble h2,
.message-row.assistant .bubble h3 {
  color: var(--text-heading);
  font-weight: 700;
  margin: 16px 0 8px 0;
}

.message-row.assistant .bubble h1 { font-size: 19px; }
.message-row.assistant .bubble h2 { font-size: 17px; }
.message-row.assistant .bubble h3 { font-size: 15px; }

.message-row.assistant .bubble ul,
.message-row.assistant .bubble ol {
  margin: 10px 0 14px 20px;
}

.message-row.assistant .bubble li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.message-row.assistant .bubble strong {
  font-weight: 600;
  color: var(--text-heading);
}

.message-row.assistant .bubble code {
  background: #F1F5F9;
  color: #0369A1;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

/* Measurement Summary Stat Badges */
.metrics-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 16px 0;
}

.metric-pill {
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 120px;
}

.metric-pill-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.metric-pill-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* Multi-Column Data Table */
.table-responsive-wrapper {
  width: 100%;
  margin: 16px 0 12px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  background: #FFFFFF;
  overflow: hidden;
}

.table-toolbar {
  padding: 10px 14px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.table-count-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #0369A1;
  background: #E0F2FE;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #BAE6FD;
}

.table-search-input {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12.5px;
  outline: none;
  background: #FFFFFF;
  color: var(--text-main);
  width: 240px;
  max-width: 100%;
}

.table-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.table-scroll-area {
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll-area table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.table-scroll-area thead th {
  position: sticky;
  top: 0;
  background: #F8FAFC;
  color: #0F172A;
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 2px solid #E2E8F0;
  z-index: 2;
}

.table-scroll-area td {
  padding: 9px 16px;
  border-bottom: 1px solid #E2E8F0;
  color: #334155;
}

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

.table-scroll-area tr:nth-child(even) td {
  background: #FAFAFA;
}

.table-scroll-area tr:hover td {
  background: #F0F9FF;
}

/* Reservoir Fill Level Gauge Card */
.level-gauge-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.level-gauge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.level-gauge-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.level-gauge-pct {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.level-progress-bar-bg {
  width: 100%;
  height: 12px;
  background: #E2E8F0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}

.level-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38BDF8, #0284C7);
  border-radius: 6px;
  transition: width 0.5s ease-out;
}

.level-gauge-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Visual Chart Card */
.chart-card-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chart-card-header {
  margin-bottom: 12px;
}

.chart-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.chart-canvas-container {
  height: 240px;
  position: relative;
  width: 100%;
}

/* Expandable Source Records / SQL Drawer */
.sql-drawer {
  margin-top: 14px;
  background: #F8FAFC;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sql-drawer summary {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.sql-drawer summary:hover {
  background: #F1F5F9;
  color: var(--primary);
}

.sql-drawer pre {
  padding: 12px;
  background: #0F172A;
  color: #F8FAFC;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  overflow-x: auto;
  border-top: 1px solid var(--border-color);
}

/* Smart Contextual Follow-Up Suggestions */
.follow-up-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.follow-up-chip {
  background: #FFFFFF;
  border: 1px solid #BAE6FD;
  color: #0369A1;
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.follow-up-chip:hover {
  background: #E0F2FE;
  border-color: #7DD3FC;
  transform: translateY(-1px);
}

/* Message Actions Bar (Copy, Regenerate, Voice, Time) */
.message-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid #F1F5F9;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-icon-btn:hover {
  background: #F1F5F9;
  color: var(--text-heading);
}

.action-icon-btn.copied {
  color: #15803D !important;
  background: #DCFCE7 !important;
}

.msg-timestamp {
  font-size: 11px;
  color: var(--text-subtle);
}

/* Thinking Indicator Bubble */
.thinking-row {
  margin: 6px 0;
  display: flex;
  align-items: center;
}

.thinking-spinner-only {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.thinking-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #E2E8F0;
  border-top-color: #0284C7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.thinking-text {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 500;
}

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

.typing-cursor {
  display: inline-block;
  margin-left: 2px;
  font-weight: 700;
  color: #0284C7;
  animation: cursorBlink 0.7s infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Error Card with Retry Button */
.error-card-wrapper {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.error-card-text {
  font-size: 13.5px;
  color: #991B1B;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-retry-query {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid #FCA5A5;
  color: #B91C1C;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-retry-query:hover {
  background: #FEE2E2;
}

/* ============================================================================== */
/* 5. PERSISTENT CHATGPT-STYLE COMPOSER                                           */
/* ============================================================================== */
.chat-input-bar {
  padding: 10px 20px 18px 20px;
  background: transparent;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  flex-shrink: 0;
  position: relative;
  z-index: 25;
}

.stop-generating-wrapper {
  position: absolute;
  top: -42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
}

.btn-stop-generating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-stop-generating svg {
  color: var(--danger);
}

.btn-stop-generating:hover {
  background: #F8FAFC;
  border-color: #CBD5E1;
}

.input-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px 10px 8px 14px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea#user-query {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  height: 24px;
  color: var(--text-main);
  background: transparent;
  padding: 4px 0;
}

textarea#user-query::placeholder {
  color: var(--text-subtle);
}

.mic-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.mic-btn:hover {
  background: var(--primary-tint);
  color: var(--primary);
}

.mic-btn.listening {
  color: var(--danger) !important;
  background: var(--danger-bg) !important;
  animation: micPulse 1.2s infinite ease-in-out;
}

@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

#send-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary);
  border: none;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

#send-btn:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

#send-btn:disabled {
  background: #E2E8F0;
  color: #94A3B8;
  cursor: not-allowed;
  transform: none;
}

#send-btn.stopping {
  background: var(--danger) !important;
  color: #FFFFFF !important;
  cursor: pointer !important;
}

.composer-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================================================== */
/* 6. MODALS, DIALOGS & TOAST NOTIFICATIONS                                       */
/* ============================================================================== */
.custom-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.15s ease;
}

.custom-modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 440px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.modal-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text-main);
}

.modal-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.modal-warning-text {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
}

.modal-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-heading);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-footer {
  padding: 12px 20px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-heading);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #F1F5F9;
}

.btn-primary {
  background: var(--primary);
  border: 1px solid var(--primary-hover);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-danger {
  background: var(--danger);
  border: 1px solid #B91C1C;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-danger:hover {
  background: #B91C1C;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #0F172A;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ============================================================================== */
/* 7. OPERATIONS DASHBOARD VIEW & NODE INSPECTOR                                   */
/* ============================================================================== */
.dashboard-main {
  flex: 1;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  padding: 12px 24px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dashboard-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dash-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-heading);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.dash-btn:hover {
  background: #F1F5F9;
}

.dash-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
}

.workflow-visualizer-container {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
}

.workflow-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 1000px;
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.dash-chart-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
}

.dash-table-wrapper {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dash-table th, .dash-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
}

.dash-table th {
  background: #F8FAFC;
  font-weight: 600;
  color: #334155;
  text-align: left;
}

.node-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
}

.node-modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 520px;
  padding: 24px;
}

/* ============================================================================== */
/* 8. RESPONSIVE MOBILE VIEWPORT (<= 768px & <= 480px)                            */
/* ============================================================================== */
@media (max-width: 768px) {
  /* Sidebar transforms into a slide-over mobile drawer */
  .chat-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 82%;
    max-width: 310px;
    height: 100%;
    z-index: 150;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18);
    transform: translateX(-100%);
    background: #FFFFFF;
  }

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

  body.sidebar-collapsed .chat-sidebar {
    transform: translateX(-100%);
    margin-left: 0;
    width: 82%;
  }

  .drawer-backdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 140;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .drawer-backdrop.active,
  body.sidebar-open .drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-brand-icon {
    display: flex;
  }

  .brand-titles h1 {
    font-size: 14.5px;
  }

  .brand-titles p {
    display: none;
  }

  .header-btn .header-btn-text {
    display: none;
  }

  /* Welcome Screen Cards on Mobile */
  .suggested-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .welcome-hero h2 {
    font-size: 21px;
  }

  .welcome-hero p {
    font-size: 13.5px;
  }

  #chat-messages {
    padding: 16px 14px 16px 14px;
  }

  /* Fixed Input Footer Docked Above Keyboard */
  .chat-input-bar {
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) 12px;
    max-width: 100%;
    background: #FFFFFF;
    border-top: 1px solid var(--border-color);
  }

  textarea#user-query {
    font-size: 16px; /* Prevents auto-zoom on iOS */
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dash-charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .chat-header {
    padding: 0 10px;
    gap: 6px;
  }

  .status-pill {
    padding: 3px 6px;
    font-size: 11px;
  }

  .status-pill .status-text {
    display: none;
  }

  .btn-new-chat-header {
    padding: 5px 8px;
    font-size: 12px;
  }

  .btn-new-chat-header span {
    display: none;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================================== */
/* AUDIO LISTEN / STOP CONTROLS IN CHAT MESSAGES                                  */
/* ============================================================================== */
.action-icon-btn.voice-btn.playing {
  color: #DC2626 !important;
  background: #FEE2E2 !important;
  border-color: #FECACA !important;
  font-weight: 600;
}

.action-icon-btn.voice-btn.playing:hover {
  background: #FECDCD !important;
  color: #B91C1C !important;
}

/* ============================================================================== */
/* RIGHT SIDEBAR: 50 CURATED SUGGESTED QUESTIONS DRAWER                          */
/* ============================================================================== */
.questions-drawer {
  width: 0;
  min-width: 0;
  height: 100vh;
  background: #FFFFFF;
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.28s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 45;
  flex-shrink: 0;
  box-shadow: none;
  user-select: none;
}

body.questions-drawer-open .questions-drawer {
  width: 375px;
  min-width: 375px;
  box-shadow: -2px 0 16px rgba(0, 0, 0, 0.05);
}

.questions-drawer-header {
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-surface);
  flex-shrink: 0;
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.drawer-header-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-header-text h3 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.2;
}

.drawer-header-text p {
  font-size: 11px;
  color: var(--text-muted);
}

.drawer-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.drawer-close-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-heading);
}

.drawer-search-wrap {
  padding: 10px 14px 6px 14px;
  flex-shrink: 0;
}

.drawer-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.drawer-search-box:focus-within {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.12);
}

.drawer-search-box input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 12px;
  outline: none;
  color: var(--text-main);
  font-family: inherit;
}

.drawer-categories-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 10px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.drawer-categories-bar::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: #FFFFFF;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 600;
}

.questions-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.question-item-card {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.15s ease;
  user-select: text;
}

.question-item-card:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.question-item-content {
  flex: 1;
  min-width: 0;
}

.question-item-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.question-item-text {
  font-size: 12.5px;
  color: var(--text-heading);
  line-height: 1.42;
  word-break: break-word;
}

.question-item-arrow {
  color: var(--text-subtle);
  flex-shrink: 0;
  margin-top: 3px;
  transition: transform 0.15s ease, color 0.15s ease;
}

.question-item-card:hover .question-item-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.questions-drawer-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.drawer-footer-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Header Info Button Active State */
.header-btn.header-info-btn {
  gap: 5px;
}

.header-btn.header-info-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

#questionsDrawerBackdrop {
  display: none;
}

/* Tablet & Mobile Layout for Questions Drawer */
@media (max-width: 1024px) {
  .questions-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 340px;
    min-width: 0;
    transform: translateX(100%);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
  }

  body.questions-drawer-open .questions-drawer {
    width: 340px;
    min-width: 340px;
    transform: translateX(0);
  }

  body.questions-drawer-open #questionsDrawerBackdrop {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 95;
  }
}

