/* ═══════════════════════════════════════════════════════════════
   RepuVerse AI — Component Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Page header ── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-6);
  flex-wrap: wrap; gap: var(--sp-4);
}

.page-header h1 {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.page-header h1 .gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--fs-base);
  margin-top: var(--sp-1);
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.card:hover {
  border-color: rgba(0, 212, 255, .08);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.card-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.card-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* ── KPI metric cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.kpi-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-normal) var(--ease-out),
              border-color var(--dur-normal),
              box-shadow var(--dur-normal);
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 212, 255, .12);
  box-shadow: var(--shadow-card-hover);
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity var(--dur-fast);
}

.kpi-card:hover::before { opacity: 1; }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xl);
}

.kpi-icon.cyan    { background: var(--accent-dim);  color: var(--accent); }
.kpi-icon.purple  { background: var(--accent-2-dim); color: var(--accent-2); }
.kpi-icon.green   { background: var(--success-dim); color: var(--success); }
.kpi-icon.amber   { background: var(--warning-dim); color: var(--warning); }
.kpi-icon.red     { background: var(--danger-dim);  color: var(--danger); }
.kpi-icon.blue    { background: var(--info-dim);    color: var(--info); }

.kpi-value {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  line-height: 1;
}

.kpi-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.kpi-trend {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  display: flex; align-items: center; gap: 4px;
}

.kpi-trend.up   { color: var(--success); }
.kpi-trend.down { color: var(--danger); }

/* ── Badges / pills ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.badge-positive  { background: var(--success-dim); color: var(--success); }
.badge-negative  { background: var(--danger-dim);  color: var(--danger); }
.badge-neutral   { background: rgba(138,148,168,.15); color: var(--text-secondary); }
.badge-warning   { background: var(--warning-dim); color: var(--warning); }
.badge-info      { background: var(--info-dim);    color: var(--info); }
.badge-accent    { background: var(--accent-dim);  color: var(--accent); }
.badge-purple    { background: var(--accent-2-dim);color: var(--accent-2); }

/* Priority badges */
.priority-critical { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(255,23,68,.3); }
.priority-high     { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(255,171,0,.3); }
.priority-medium   { background: var(--info-dim); color: var(--info); border: 1px solid rgba(68,138,255,.3); }
.priority-low      { background: rgba(138,148,168,.1); color: var(--text-secondary); border: 1px solid rgba(138,148,168,.2); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: none; border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: var(--fs-base);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  color: var(--text-inverse);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

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

.btn-secondary:hover { background: var(--bg-card-hover); }

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

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

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
}

.btn-danger:hover { background: rgba(255,23,68,.25); }

.btn-sm { padding: var(--sp-1) var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-md); }

.btn-icon {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: var(--border);
}

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

/* ── Tables ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: var(--border);
}

.data-table td {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-base);
  border-bottom: var(--border);
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.data-table tbody tr:hover {
  background: var(--bg-card);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ── Tabs ── */
.tabs {
  display: flex; gap: var(--sp-1);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 3px;
  margin-bottom: var(--sp-4);
  overflow-x: auto;
}

.tab {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
  white-space: nowrap;
  border: none; background: none;
  font-family: var(--font-family);
}

.tab:hover { color: var(--text-primary); }

.tab.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Progress bars ── */
.progress-bar {
  width: 100%; height: 6px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--dur-slow) var(--ease-out);
}

/* ── Tag pills ── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* ── Avatars ── */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  color: #fff;
  flex-shrink: 0;
}

.avatar-stack {
  display: flex;
}

.avatar-stack .avatar {
  margin-left: -8px;
  border: 2px solid var(--bg-card);
}

.avatar-stack .avatar:first-child { margin-left: 0; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 24px; }

.timeline::before {
  content: '';
  position: absolute; left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--bg-elevated);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--sp-4);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px; top: 6px;
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--accent);
  border: 2px solid var(--bg-card);
}

.timeline-item-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline-item-content {
  font-size: var(--fs-base);
  color: var(--text-secondary);
}

/* ── Chat bubbles ── */
.chat-messages {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-4);
  overflow-y: auto;
  flex: 1;
}

.chat-bubble {
  max-width: 85%;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-lg);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  animation: fadeInUp var(--dur-normal) var(--ease-out) both;
}

.chat-bubble.agent {
  background: var(--bg-elevated);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.chat-bubble.user {
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  color: var(--text-inverse);
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}

.chat-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* ── Chat input ── */
.chat-input-bar {
  display: flex; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-top: var(--border);
  background: var(--bg-surface);
}

.chat-input-bar input {
  flex: 1;
  padding: var(--sp-2) var(--sp-4);
  border: var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-base);
  outline: none;
}

.chat-input-bar input:focus { border-color: var(--accent); }

.chat-input-bar button {
  width: 40px; height: 40px;
  border: none; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #00b8d4);
  color: var(--text-inverse);
  cursor: pointer;
  font-size: var(--fs-md);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow var(--dur-fast);
}

.chat-input-bar button:hover { box-shadow: var(--shadow-glow); }

/* ── Suggested questions ── */
.suggested-questions {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
}

.suggested-q {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-lg);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: var(--fs-sm);
  cursor: pointer;
  border: 1px solid rgba(0,229,255,.15);
  transition: all var(--dur-fast);
  font-family: var(--font-family);
}

.suggested-q:hover {
  background: rgba(0,229,255,.2);
  border-color: var(--accent);
}

/* ── Modal / Overlay ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
}

.modal {
  background: var(--bg-surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  max-width: 540px;
  width: 90%;
}

/* ── Split pane ── */
.split-pane {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: var(--sp-4);
  height: calc(100vh - var(--topbar-height) - var(--sp-12) - 80px);
}

@media (max-width: 900px) {
  .split-pane { grid-template-columns: 1fr; }
}

.split-left {
  overflow-y: auto;
  border-right: var(--border);
  padding-right: var(--sp-4);
}

.split-left::-webkit-scrollbar { width: 4px; }
.split-left::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 4px; }

/* ── Filter bar ── */
.filter-bar {
  display: flex; align-items: center; gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.filter-bar select {
  padding: var(--sp-2) var(--sp-3);
  border: var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--fs-sm);
  outline: none;
  cursor: pointer;
}

.filter-bar select:focus { border-color: var(--accent); }

/* ── Empty state ── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--sp-16);
  color: var(--text-muted);
  text-align: center;
  gap: var(--sp-4);
}

.empty-state-icon {
  font-size: 3rem;
  opacity: .4;
}

/* ── Grid layouts ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--sp-4); }



/* ── Agent card ── */
.agent-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
}

.agent-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  transition: background var(--dur-slow) var(--ease-out);
  pointer-events: none;
}

.agent-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .4), 0 0 20px rgba(0, 212, 255, .08);
}

.agent-card:hover::after {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.agent-card-header {
  display: flex; align-items: center; gap: var(--sp-3);
}

.agent-avatar {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xl);
}

.agent-name {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.agent-status {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.agent-status-dot {
  width: 6px; height: 6px;
  border-radius: var(--radius-full);
}

.agent-status-dot.active { background: var(--success); }
.agent-status-dot.idle   { background: var(--text-muted); }
.agent-status-dot.processing { background: var(--warning); animation: pulse 1s infinite; }

.agent-activity-log {
  display: flex; flex-direction: column; gap: var(--sp-2);
  flex: 1;
}

.agent-log-item {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  display: flex; align-items: flex-start; gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.agent-log-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Agent chat panel ── */
.agent-chat-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: var(--chat-panel-width);
  background: var(--bg-surface);
  border-left: var(--border);
  z-index: var(--z-chat);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-slow) var(--ease-out);
}

.agent-chat-panel.open {
  transform: translateX(0);
}

.chat-panel-header {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: var(--border);
  flex-shrink: 0;
}

.chat-panel-close {
  margin-left: auto;
}



/* ── Gauge / meter ── */
.gauge-container {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-3);
}

.gauge-label {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

.gauge-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

/* ── Heatmap grid ── */
.heatmap-grid {
  display: grid;
  gap: 3px;
}

.heatmap-cell {
  border-radius: 3px;
  aspect-ratio: 1;
  min-width: 16px;
  transition: transform var(--dur-fast);
}

.heatmap-cell:hover { transform: scale(1.3); }

/* ── Checklist ── */
.checklist-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: var(--border);
}

.checklist-item input[type="checkbox"] {
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--dur-fast);
}

.checklist-item input[type="checkbox"]:checked {
  background: var(--success);
  border-color: var(--success);
}

.checklist-item input[type="checkbox"]:checked::after {
  content: '✓';
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: bold;
}

/* ── Redaction demo ── */
.redacted {
  background: var(--danger-dim);
  color: var(--danger);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

/* ── Misc utilities ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══════════════════════════════════════
   Mobile-specific component overrides
   ═══════════════════════════════════════ */

/* Tablet breakpoint */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }

  .split-pane { grid-template-columns: 1fr; height: auto; }

  .split-left {
    border-right: none;
    border-bottom: var(--border);
    padding-right: 0;
    padding-bottom: var(--sp-4);
    max-height: 320px;
    overflow-y: auto;
  }
}

/* Mobile phone breakpoint */
@media (max-width: 640px) {
  /* KPI grid: 2 columns instead of 5 */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-3);
  }

  .kpi-card {
    padding: var(--sp-3);
  }

  .kpi-value {
    font-size: var(--fs-xl);
  }

  .kpi-icon {
    width: 36px; height: 36px;
  }

  /* Cards compact on mobile */
  .card {
    padding: var(--sp-3);
  }

  .card-header {
    margin-bottom: var(--sp-3);
  }

  .card-title {
    font-size: var(--fs-base);
  }

  /* Buttons: bigger touch targets */
  .btn {
    min-height: 40px;
    padding: var(--sp-2) var(--sp-4);
  }

  .btn-sm {
    min-height: 34px;
    padding: var(--sp-2) var(--sp-3);
  }

  /* Tabs scrollable */
  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar { display: none; }

  .tab {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-xs);
  }

  /* Tables: horizontal scroll */
  .data-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .data-table th,
  .data-table td {
    padding: var(--sp-2) var(--sp-3);
    font-size: var(--fs-sm);
  }

  /* Agent cards grid: single column */
  .grid-auto {
    grid-template-columns: 1fr;
  }

  .agent-card {
    padding: var(--sp-4);
  }

  .agent-avatar {
    width: 40px; height: 40px;
    font-size: var(--fs-md);
  }

  /* Chat panel full width on mobile */
  .agent-chat-panel {
    width: 100%;
    bottom: 56px; /* Above bottom nav */
  }

  .chat-bubble {
    max-width: 92%;
    font-size: var(--fs-sm);
  }

  .suggested-questions {
    padding: var(--sp-2) var(--sp-3);
  }

  .suggested-q {
    font-size: var(--fs-xs);
    padding: var(--sp-1) var(--sp-2);
  }

  /* Split pane: stack vertically */
  .split-pane {
    grid-template-columns: 1fr;
    height: auto;
  }

  .split-left {
    max-height: 260px;
    padding-right: 0;
    border-right: none;
    border-bottom: var(--border);
    padding-bottom: var(--sp-3);
  }

  /* Filter bar wrap nicely */
  .filter-bar {
    gap: var(--sp-2);
  }

  .filter-bar select {
    font-size: var(--fs-xs);
    padding: var(--sp-1) var(--sp-2);
  }

  /* Heatmap smaller cells */
  .heatmap-cell {
    min-width: 12px;
  }

  /* Progress bars */
  .progress-bar {
    height: 5px;
  }

  /* Badges slightly smaller */
  .badge {
    padding: 1px 8px;
    font-size: 10px;
  }

  /* Timeline more compact */
  .timeline { padding-left: 20px; }
  .timeline-item::before {
    left: -16px;
    width: 8px; height: 8px;
  }

  /* Gauge */
  .gauge-container canvas {
    max-width: 200px;
  }

  /* Fix overflows on small screens */
  .flex {
    flex-wrap: wrap;
  }

  /* Utility: don't wrap button rows */
  .flex.gap-2:has(.btn) {
    flex-wrap: wrap;
  }
}

/* Very small screens (iPhone SE etc.) */
@media (max-width: 375px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-value {
    font-size: var(--fs-lg);
  }

  .page-header h1 {
    font-size: var(--fs-lg);
  }
}

/* ═══════════════════════════════════════════════════════════════
   NEW: Landing Page Components
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero ── */
.landing-hero {
  text-align: center;
  padding: var(--sp-8) var(--sp-4) var(--sp-6);
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(0,212,255,.15);
  border-radius: 50px;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--accent);
  margin-bottom: var(--sp-4);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: var(--fw-bold);
  line-height: 1.1;
  margin-bottom: var(--sp-4);
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto var(--sp-6);
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-dim);
  border-radius: 50%;
  margin: 0 auto var(--sp-2);
  color: var(--accent);
}

.hero-stat-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-8);
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }

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

.btn-lg { padding: 14px 28px; font-size: var(--fs-base); }
.btn-sm { padding: 6px 14px; font-size: var(--fs-xs); }
.w-full { width: 100%; justify-content: center; }
.mt-4 { margin-top: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

/* ── Hero Network Visualization ── */
.hero-visual {
  position: relative;
  width: 240px; height: 240px;
  margin: 0 auto;
}

.network-core {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--accent);
  z-index: 2;
  font-size: 9px;
  font-weight: var(--fw-semibold);
}

.hero-logo-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 140px; height: 140px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, .3));
  animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, .3)); }
  50% { filter: drop-shadow(0 0 35px rgba(0, 212, 255, .5)); }
}

.hero-tagline {
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .12em;
  text-align: center;
}

.network-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(0,212,255,.12);
}

.ring-1 { width: 120px; height: 120px; transform: translate(-50%,-50%); animation: pulse-ring 3s ease-in-out infinite; }
.ring-2 { width: 180px; height: 180px; transform: translate(-50%,-50%); animation: pulse-ring 3s ease-in-out 1s infinite; }
.ring-3 { width: 240px; height: 240px; transform: translate(-50%,-50%); animation: pulse-ring 3s ease-in-out 2s infinite; }

@keyframes pulse-ring {
  0%, 100% { opacity: .3; }
  50% { opacity: .7; }
}

.network-nodes {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
}

.network-node {
  position: absolute;
  width: 36px; height: 36px;
  background: var(--bg-surface);
  border: 1px solid rgba(0,212,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  top: calc(50% + 100px * sin(var(--i) * 60deg) - 18px);
  left: calc(50% + 100px * cos(var(--i) * 60deg) - 18px);
  animation: float-node 4s ease-in-out calc(var(--i) * .3s) infinite;
}

@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Landing Sections ── */
.landing-section {
  padding: var(--sp-8) 0;
  border-top: 1px solid rgba(255,255,255,.04);
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(124,77,255,.1);
  border: 1px solid rgba(124,77,255,.15);
  border-radius: 50px;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--accent-2);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.section-title {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--sp-2);
}

.section-subtitle {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
  max-width: 600px;
}

/* ── About Grid ── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-5);
}

.about-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  transition: border-color var(--dur-normal), transform var(--dur-normal);
}

.about-card:hover {
  border-color: var(--accent-color, var(--accent));
  transform: translateY(-2px);
}

.about-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.about-logo {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: #000;
  flex-shrink: 0;
}

.about-name {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.about-tagline {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.about-desc {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin-bottom: var(--sp-4);
}

.about-stats {
  display: flex;
  gap: var(--sp-4);
}

.about-stat { text-align: center; flex: 1; }

.about-stat-value {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.about-stat-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* ── Architecture Stack (Landing) ── */
.arch-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.arch-layer {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-normal), transform var(--dur-normal);
}

.arch-layer:hover {
  border-color: var(--layer-color);
  transform: translateX(6px);
}

.arch-layer-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arch-layer-content { flex: 1; }
.arch-layer-name { font-weight: var(--fw-semibold); margin-bottom: 2px; }
.arch-layer-desc { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.4; }
.arch-layer-arrow { color: var(--text-muted); }

.arch-connector {
  text-align: center;
  padding: var(--sp-1) 0;
}

/* ── Agent Preview Grid (Landing) ── */
.agent-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-4);
}

.agent-preview-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  text-align: center;
  transition: border-color var(--dur-normal), transform var(--dur-normal);
}

.agent-preview-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}

.agent-preview-icon {
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 50%;
  margin: 0 auto var(--sp-2);
  color: var(--accent);
}

.agent-preview-name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  margin-bottom: 4px;
}

.agent-preview-status {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: capitalize;
}

/* ═══════════════════════════════════════════════════════════════
   NEW: Brand Command Center Components
   ═══════════════════════════════════════════════════════════════ */

.global-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.global-metric {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.global-metric-icon {
  width: 44px; height: 44px;
  background: var(--accent-dim);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.global-metric-value {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.global-metric-label {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.brand-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--sp-5);
}

.brand-card {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color var(--dur-normal), transform var(--dur-normal), box-shadow var(--dur-normal);
}

.brand-card:hover {
  border-color: var(--brand-color);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.brand-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.brand-logo {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  color: #000;
  flex-shrink: 0;
}

.brand-name {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-md);
}

.brand-industry {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.brand-risk {
  margin-left: auto;
  text-transform: capitalize;
}

.brand-sentiment-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 3px;
  overflow: hidden;
  margin-top: var(--sp-3);
}

.brand-sentiment-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 1s var(--ease-out);
}

.brand-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: var(--border);
}

.brand-metric { text-align: center; }

.brand-metric-value {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.brand-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.brand-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: var(--border);
}

.brand-enter {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border-radius: 50%;
  color: var(--accent);
  transition: background var(--dur-fast);
}

.brand-card:hover .brand-enter {
  background: var(--accent);
  color: #000;
}

/* Badge variants */
.badge-positive { background: rgba(0,200,83,.12); color: var(--success); }
.badge-negative { background: rgba(255,82,82,.12); color: var(--danger); }
.badge-warning  { background: rgba(255,171,0,.12); color: var(--warning); }
.badge-neutral  { background: rgba(138,148,168,.12); color: var(--text-muted); }
.badge-accent   { background: var(--accent-dim); color: var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   NEW: Architecture Page (Interactive)
   ═══════════════════════════════════════════════════════════════ */

.arch-interactive-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.arch-interactive-layer {
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: border-color var(--dur-normal), box-shadow var(--dur-normal);
}

.arch-interactive-layer:hover {
  border-color: var(--layer-color);
}

.arch-interactive-layer.expanded {
  border-color: var(--layer-color);
  box-shadow: 0 0 30px rgba(0,212,255,.08);
}

.arch-layer-main {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.arch-layer-num {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  opacity: .3;
  flex-shrink: 0;
  width: 40px;
}

.arch-layer-icon-lg {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arch-layer-info { flex: 1; }
.arch-layer-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); margin-bottom: 2px; }
.arch-layer-subtitle { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.5; }

.arch-layer-toggle {
  color: var(--text-muted);
  transition: transform var(--dur-normal);
}

.arch-interactive-layer.expanded .arch-layer-toggle {
  transform: rotate(180deg);
}

.arch-layer-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s var(--ease-out), opacity .3s;
  opacity: 0;
}

.arch-interactive-layer.expanded .arch-layer-detail {
  max-height: 600px;
  opacity: 1;
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: var(--border);
}

.arch-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.arch-detail-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: var(--sp-3);
}

.arch-components {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.arch-component {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
}

.arch-metrics-grid {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.arch-metric-item { text-align: center; flex: 1; min-width: 80px; }
.arch-metric-val { font-size: var(--fs-lg); font-weight: var(--fw-bold); }
.arch-metric-key { font-size: 10px; color: var(--text-muted); text-transform: capitalize; }

/* Architecture Flow Connector */
.arch-flow-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 32px;
}

.arch-flow-line {
  width: 2px;
  flex: 1;
  border-radius: 1px;
}

.arch-flow-arrow {
  margin-top: -4px;
}

/* ═══════════════════════════════════════════════════════════════
   NEW: Workflow Visualization
   ═══════════════════════════════════════════════════════════════ */

.workflow-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-5);
  flex-wrap: wrap;
}

.workflow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  min-width: 80px;
}

.workflow-step-num {
  width: 48px; height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
}

.workflow-step-label {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
}

.workflow-step-arrow {
  display: flex;
  align-items: center;
  padding-bottom: 28px;
}

/* ═══════════════════════════════════════════════════════════════
   NEW: Agent Hub Status Bar
   ═══════════════════════════════════════════════════════════════ */

.agent-status-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.agent-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-activity-log {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
}

.agent-log-item {
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  display: flex;
  gap: 8px;
  line-height: 1.4;
}

.agent-log-time {
  color: var(--text-muted);
  flex-shrink: 0;
  width: 56px;
}

/* ── Live Dot ── */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-live 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0,200,83,.4); }
  50% { opacity: .7; box-shadow: 0 0 0 6px rgba(0,200,83,0); }
}

/* ── Helper classes ── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.text-xs { font-size: var(--fs-xs); }
.text-sm { font-size: var(--fs-sm); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* ═══════════════════════════════════════════════════════════════
   Mobile Responsive Overrides for New Components
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .arch-detail-grid { grid-template-columns: 1fr; }
  .brand-cards-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: var(--sp-4); }
  .workflow-flow { gap: var(--sp-1); }
  .workflow-step { min-width: 60px; }
  .workflow-step-num { width: 40px; height: 40px; }
  .workflow-step-label { font-size: 10px; }
}

@media (max-width: 640px) {
  .landing-hero { padding: var(--sp-4) var(--sp-2); }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: var(--fs-base); }
  .hero-visual { width: 180px; height: 180px; }
  .network-node { width: 28px; height: 28px; }
  .ring-3 { width: 180px; height: 180px; }
  .ring-2 { width: 140px; height: 140px; }
  .ring-1 { width: 100px; height: 100px; }
  .network-core { width: 56px; height: 56px; }
  .hero-stats { gap: var(--sp-3); }
  .hero-stat-value { font-size: var(--fs-lg); }
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
  .global-metrics { grid-template-columns: repeat(2, 1fr); }
  .global-metric { padding: var(--sp-3); }
  .global-metric-value { font-size: var(--fs-lg); }
  .brand-cards-grid { grid-template-columns: 1fr; }
  .brand-metrics { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .agent-status-bar { gap: var(--sp-3); }
  .about-stats { flex-wrap: wrap; }
  .arch-layer-main { flex-wrap: wrap; }
  .arch-layer-num { display: none; }
  .section-title { font-size: var(--fs-xl); }
  .agent-chat-panel { width: 100%; }
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(138,148,168,.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(138,148,168,.35); }

/* ── Selection ── */
::selection {
  background: var(--accent);
  color: var(--text-inverse);
}


