/* ==========================================================================
   DIY AI Admin Console Styles
   Dark mode, glassmorphism, rich accents, responsive & dynamic
   ========================================================================== */

:root {
  --bg-base: #070a12;
  --bg-surface: rgba(15, 23, 42, 0.75);
  --bg-surface-elevated: rgba(30, 41, 59, 0.65);
  --bg-glass: rgba(17, 24, 39, 0.55);
  --bg-input: rgba(15, 23, 42, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-highlight: rgba(99, 102, 241, 0.35);
  --border-active: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.35);

  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.3);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.25);
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
  --shadow-active: 0 10px 30px -5px rgba(0, 0, 0, 0.6);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  min-height: 100vh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient Background Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: 0;
  opacity: 0.45;
  animation: ambientFloat 20s infinite alternate ease-in-out;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f46e5 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #0891b2 0%, transparent 70%);
  top: 40%;
  right: -200px;
  animation-duration: 25s;
}

.glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #7c3aed 0%, transparent 70%);
  bottom: -100px;
  left: 20%;
  animation-duration: 18s;
}

@keyframes ambientFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, 40px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Base Utility Classes */
.font-mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-muted { color: var(--text-muted); }

/* Glass Panel Component */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  position: relative;
  z-index: 1;
}

/* App Root Container */
.app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* Screen Transitions */
.screen-view {
  display: none;
  width: 100%;
  flex: 1;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.screen-view.active {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
#login-screen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.logo-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.logo-icon {
  width: 30px;
  height: 30px;
  color: #fff;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Form Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px 12px 42px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-textarea {
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.6;
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.input-action-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-action-btn:hover {
  color: var(--text-primary);
}

.input-action-btn svg {
  width: 18px;
  height: 18px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.7);
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.btn-block { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-icon-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-subtle:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon-subtle svg {
  width: 16px;
  height: 16px;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-footer {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.security-badge svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   DASHBOARD SCREEN
   ========================================================================== */
#dashboard-screen {
  flex-direction: column;
}

/* Navigation Bar */
.navbar {
  margin: 16px 24px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-xl);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.brand-icon-wrapper {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-wrapper svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.brand-name {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  display: block;
}

.brand-tag {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
  margin-top: -2px;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px 4px 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.user-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
}

/* Main Dashboard Body */
.dashboard-main {
  padding: 0 24px 40px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.metric-title {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-footer {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-info {
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-primary {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Navigation Tabs */
.tabs-nav-wrapper {
  margin-bottom: 24px;
}

.tabs-nav {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-button svg {
  width: 17px;
  height: 17px;
}

.tab-button:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

/* Tab Contents */
.tab-content {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-content.active {
  display: block;
}

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

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.panel-description {
  font-size: 13.5px;
  color: var(--text-secondary);
}

/* Filter & Search Bar */
.filter-bar {
  padding: 12px 18px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
}

.search-box svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px 9px 36px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-chip:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.filter-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
  color: #a5b4fc;
}

/* Models Grid */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}

.model-card {
  padding: 20px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.model-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.model-card.is-active {
  border-color: var(--primary);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9), rgba(99, 102, 241, 0.12));
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.2);
}

.model-card.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
}

.model-card-top {
  margin-bottom: 16px;
}

.model-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.model-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.model-owner {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tag-pill.tag-primary {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border-color: rgba(99, 102, 241, 0.3);
}

.tag-pill.tag-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
  border-color: rgba(6, 182, 212, 0.3);
}

.model-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.model-context {
  font-size: 12px;
  color: var(--text-muted);
}

.model-context-val {
  color: var(--text-secondary);
  font-weight: 600;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

/* Settings Grid (API Key) */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 24px;
}

.settings-card {
  padding: 28px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.key-preview-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.key-display {
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.info-callout {
  display: flex;
  gap: 12px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12.5px;
  color: #bae6fd;
  line-height: 1.5;
}

.info-callout svg {
  width: 20px;
  height: 20px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 1px;
}

.key-update-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.link {
  color: var(--primary);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   LIVE PROMPT PLAYGROUND
   ========================================================================== */
.playground-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

@media (max-width: 960px) {
  .playground-layout {
    grid-template-columns: 1fr;
  }
}

.playground-input-card, .playground-output-card {
  padding: 24px;
}

.test-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.test-target-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.test-target-model {
  font-size: 13.5px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.preset-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 4px;
}

.preset-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preset-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  color: #ffffff;
}

/* Output Card */
.output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.output-title {
  font-size: 14px;
  font-weight: 700;
}

.output-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.meta-item svg {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.result-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.result-placeholder svg {
  width: 42px;
  height: 42px;
  color: var(--text-muted);
  opacity: 0.5;
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parsed-header-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.parsed-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.steps-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
}

.tools-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tools-list li {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: #6ee7b7;
}

.raw-json-details {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

.raw-json-summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.raw-json-code {
  margin-top: 12px;
  font-size: 11.5px;
  color: #bae6fd;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 250px;
  overflow-y: auto;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  font-size: 13.5px;
  max-width: 380px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.2s, transform 0.2s;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.toast-success .toast-icon { color: var(--accent-emerald); }

.toast.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
}

.toast.toast-error .toast-icon { color: var(--accent-rose); }

.toast.toast-info {
  border-color: rgba(99, 102, 241, 0.4);
}

.toast.toast-info .toast-icon { color: var(--primary); }

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    margin: 12px;
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-left {
    justify-content: space-between;
  }

  .nav-right {
    justify-content: flex-end;
  }

  .dashboard-main {
    padding: 0 12px 30px;
  }

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

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

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