@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);
  --text-primary: #f0f0f5;
  --text-secondary: #8b8b9e;
  --text-muted: #5a5a6e;
  --accent-primary: #6366f1;
  --accent-secondary: #818cf8;
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.1);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.1);
  --blue: #3b82f6;
  --blue-bg: rgba(59, 130, 246, 0.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245, 158, 11, 0.1);
  --purple: #a855f7;
  --purple-bg: rgba(168, 85, 247, 0.1);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.1);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
}

/* ========== LAYOUT ========== */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  gap: 0;
}

/* ========== SIDEBAR ========== */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 24px;
}

.sidebar-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo h1 {
  font-size: 18px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-logo span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-secondary);
  border-color: rgba(99, 102, 241, 0.2);
}

.nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 16px 8px;
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
  }

  50% {
    opacity: 0.8;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

/* ========== MAIN CONTENT ========== */
.main-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(18, 18, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  min-height: 68px;
  flex-shrink: 0;
}

.header-title {
  font-size: 20px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.header-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.header-btn.primary {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  font-weight: 600;
}

.header-btn.primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* ========== PANELS CONTAINER ========== */
.panels {
  display: grid;
  grid-template-columns: 1fr 420px;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ========== DASHBOARD PANEL ========== */
.dashboard-panel {
  overflow-y: auto;
  padding: 24px 32px;
}

.dashboard-panel::-webkit-scrollbar {
  width: 6px;
}

.dashboard-panel::-webkit-scrollbar-track {
  background: transparent;
}

.dashboard-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

/* ========== DATE TOOLBAR ========== */
.date-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.date-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.preset-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-secondary);
}

.preset-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  font-weight: 600;
}

.date-inputs {
  display: none;
  align-items: center;
  gap: 10px;
}

.date-inputs.visible {
  display: flex;
}

.date-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-field label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.date-field input[type="date"] {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 7px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
  color-scheme: dark;
}

.date-field input[type="date"]:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.extract-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-xs);
  border: none;
  background: var(--accent-gradient);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  margin-left: auto;
}

.extract-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.extract-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.extract-btn .extract-icon {
  font-size: 16px;
}

/* Period Info */
.period-info {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.period-info.hidden {
  display: none;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.metric-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-card .metric-icon {
  font-size: 24px;
  margin-bottom: 12px;
}

.metric-card .metric-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  margin-bottom: 6px;
}

.metric-card .metric-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

/* Skeleton loading */
.metric-card.skeleton .metric-value,
.metric-card.skeleton .metric-label {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255, 255, 255, 0.06) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  color: transparent !important;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Headers */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Campaign Table */
.campaigns-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.campaigns-table table {
  width: 100%;
  border-collapse: collapse;
}

.campaigns-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
}

.campaigns-table td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.campaigns-table tr:last-child td {
  border-bottom: none;
}

.campaigns-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
}

.campaigns-table .campaign-name {
  color: var(--text-primary);
  font-weight: 600;
}

.campaigns-table .roas-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.roas-good {
  color: var(--green);
  background: var(--green-bg);
}

.roas-warn {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.roas-bad {
  color: var(--red);
  background: var(--red-bg);
}

/* ========== CHAT PANEL ========== */
.chat-panel {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-color);
  background: var(--bg-secondary);
  min-height: 0;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-header .agent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chat-header .agent-info h3 {
  font-size: 14px;
  font-weight: 600;
}

.chat-header .agent-info span {
  font-size: 12px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header .agent-info span::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.message {
  display: flex;
  gap: 10px;
  max-width: 95%;
  animation: messageIn 0.3s ease;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 2px;
}

.message.agent .message-avatar {
  background: var(--accent-gradient);
}

.message.user .message-avatar {
  background: rgba(255, 255, 255, 0.1);
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.message.agent .message-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top-left-radius: 4px;
}

.message.user .message-bubble {
  background: var(--accent-primary);
  color: white;
  border-top-right-radius: 4px;
}

.message-bubble p {
  margin-bottom: 8px;
}

.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble strong {
  color: var(--accent-secondary);
  font-weight: 600;
}

.message.user .message-bubble strong {
  color: white;
}

.message-bubble ul,
.message-bubble ol {
  padding-left: 20px;
  margin: 8px 0;
}

.message-bubble li {
  margin: 4px 0;
}

.message-bubble code {
  background: rgba(99, 102, 241, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 12px 0 6px;
  color: var(--text-primary);
}

.message-bubble h1:first-child,
.message-bubble h2:first-child,
.message-bubble h3:first-child {
  margin-top: 0;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Chat Input */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: var(--transition);
  outline: none;
}

.chat-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.send-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-glow);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ========== EMPTY STATES ========== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}

.empty-state .empty-icon {
  font-size: 48px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 16px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.5;
}

/* Quick actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

.quick-action-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.quick-action-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-secondary);
}

/* ========== LOADING ========== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  z-index: 1000;
  transition: opacity 0.5s, visibility 0.5s;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========== CHARTS GRID ========== */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
  position: relative;
}

.chart-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.chart-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-card canvas {
  width: 100% !important;
  height: 180px !important;
}

/* ========== METRIC INDICATORS ========== */
.metric-card .metric-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 12px;
}

.metric-indicator.good {
  color: var(--green);
  background: var(--green-bg);
}

.metric-indicator.warn {
  color: var(--yellow);
  background: var(--yellow-bg);
}

.metric-indicator.bad {
  color: var(--red);
  background: var(--red-bg);
}

.metric-indicator.neutral {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* ========== SORT SELECTOR ========== */
.table-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 6px 12px;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  appearance: auto;
}

.sort-select:hover {
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

.sort-select:focus {
  border-color: var(--accent-primary);
}

/* ========== SHOW ALL BUTTON ========== */
.show-all-wrapper {
  text-align: center;
  margin-bottom: 28px;
}

.show-all-btn {
  padding: 8px 24px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}

.show-all-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--accent-secondary);
}

/* ========== OPTIMIZER PANEL ========== */
.optimizer-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.opt-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.opt-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1;
}

.opt-toolbar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.opt-chat-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.opt-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.opt-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1100px) {
  .panels {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    display: none;
  }

  .chat-panel.mobile-visible {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 50;
  }
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .header {
    padding: 12px 16px;
  }

  .dashboard-panel {
    padding: 16px;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .metric-card {
    padding: 14px;
  }

  .metric-card .metric-value {
    font-size: 20px;
  }

  .date-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .extract-btn {
    margin-left: 0;
    justify-content: center;
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }

  .table-controls {
    width: 100%;
  }

  .sort-select {
    width: 100%;
  }
}