:root {
  --bg-primary: #0a0a0b;
  --bg-secondary: #161618;
  --bg-tertiary: #1f1f22;
  --accent-primary: #3b82f6;
  --accent-secondary: #60a5fa;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: #27272a;
  --success: #10b981;
  --error: #ef4444;
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --glass: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  38 │   display: flex;
  39 │ }
  40 │ 
  41 │ .flex-center { display: flex; align-items: center; justify-content: center; }
  42 │ .flex-between { display: flex; align-items: center; justify-content: space-between; }
  43 │ .gap-10 { gap: 10px; }
  44 │ .mt-auto { margin-top: auto; }
  45 │ .pt-1 { padding-top: 1rem; }
  46 │ .border-top { border-top: 1px solid var(--border-color); }
  47 │ .avatar-sm { width: 32px; height: 32px; }
  48 │ .d-flex { display: flex; }
  49 │ .align-center { align-items: center; }
  50 │ 
  51 │ /* App Layout */
.app-container {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
}

.new-chat-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: all 0.2s;
  margin-bottom: 2rem;
}

.new-chat-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
}

.history-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.history-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
}

.history-item {
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.history-item:hover {
  background: var(--glass);
  color: var(--text-primary);
}

.history-item.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-left: 3px solid var(--accent-primary);
}

/* Main Chat Area */
.chat-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  position: relative;
}

.chat-header {
  height: 64px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  justify-content: space-between;
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--success);
  border-radius: 50%;
}

.chat-messages {
  flex-grow: 1;
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

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

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.avatar.ai {
  background: linear-gradient(135deg, #3b82f622, #60a5fa22);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.message-content {
  max-width: 85%;
  font-size: 1rem;
}

.user .message-content {
  background-color: var(--bg-tertiary);
  padding: 1rem 1.25rem;
  border-radius: 18px 18px 0 18px;
  border: 1px solid var(--border-color);
}

.ai .message-content {
  color: var(--text-primary);
}

/* Data Components */
.data-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 1.5rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255,255,255,0.02);
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Table Style */
.table-container {
  padding: 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  text-align: left;
  padding: 1rem 1.5rem;
  background-color: rgba(255,255,255,0.03);
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}

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

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

 301 │ .badge-success { background: #10b98122; color: #10b981; }
 302 │ .badge-warning { background: #f59e0b22; color: #f59e0b; }
 303 │ .badge-info { background: #0ea5e922; color: #0ea5e9; }
 304 │ 
 305 │ /* Multi-type Chart Style */
 306 │ .chart-grid {
 307 │   display: grid;
 308 │   grid-template-columns: 1fr 1fr;
 309 │   gap: 1.5rem;
 310 │   margin-top: 1.5rem;
 311 │ }
 312 │ 
 313 │ @media (max-width: 768px) {
 314 │   .chart-grid { grid-template-columns: 1fr; }
 315 │ }
 316 │ 
 317 │ .card-body {
 318 │   padding: 1.5rem;
 319 │ }
 320 │ 
 321 │ .stat-row {
 322 │   display: flex;
 323 │   justify-content: space-between;
 324 │   margin-bottom: 0.75rem;
 325 │   font-size: 0.85rem;
 326 │ }
 327 │ 
 328 │ .stat-label { color: var(--text-muted); }
 329 │ .stat-value { font-weight: 600; color: var(--text-primary); }
 330 │ 
 331 │ .progress-bar-bg {
 332 │   height: 6px;
 333 │   background: var(--bg-tertiary);
 334 │   border-radius: 3px;
 335 │   width: 100%;
 336 │   overflow: hidden;
 337 │   margin-bottom: 1.5rem;
 338 │ }
 339 │ 
 340 │ .progress-bar-fill {
 341 │   height: 100%;
 342 │   background: var(--accent-primary);
 343 │   border-radius: 3px;
 344 │ }
 345 │ 
 346 │ .line-chart-container {
 347 │   height: 120px;
 348 │   position: relative;
 349 │   display: flex;
 350 │   align-items: flex-end;
 351 │   gap: 4px;
 352 │   margin-top: 1rem;
 353 │   border-left: 1px solid var(--border-color);
 354 │   border-bottom: 1px solid var(--border-color);
 355 │   padding-left: 5px;
 356 │ }
 357 │ 
 358 │ .line-dot {
 359 │   width: 6px;
 360 │   height: 6px;
 361 │   background: var(--accent-secondary);
 362 │   border-radius: 50%;
 363 │   position: absolute;
 364 │   transform: translate(-50%, 50%);
 365 │   z-index: 2;
 366 │ }
 367 │ 
 368 │ .line-segment {
 369 │   position: absolute;
 370 │   height: 2px;
 371 │   background: var(--accent-secondary);
 372 │   transform-origin: left center;
 373 │   opacity: 0.4;
 374 │ }
 375 │ 
 376 │ /* Chart Style (CSS Only Visualization) */
.chart-container {
  padding: 2rem;
  height: 250px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  justify-content: space-around;
}

.chart-bar-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(to top, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px 4px 0 0;
  transition: height 1s ease-in-out;
  position: relative;
}

.chart-bar:hover {
  filter: brightness(1.2);
}

.chart-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Input Area */
.chat-input-container {
  padding: 1rem 2rem 2.5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.input-wrapper {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.chat-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.send-btn {
  background: var(--accent-primary);
  color: white;
}

.send-btn:hover {
  background: var(--accent-secondary);
  color: white;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.message-paragraph {
  margin-top: 1.5rem;
}

.disclaimer {
  text-align: center;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-bar.projected {
  opacity: 0.5;
}

/* Utility */
.placeholder-icon {
  display: inline-block;
}
