/* ==========================================================================
   Trace. | OrbitTech AI Observability & Evaluation Platform - Design System
   ========================================================================== */

:root {
  /* Color Palette - Main Light Glass Canvas & Dark Slate Sidebar */
  --sidebar-bg: #0b0f19;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-item-active-bg: rgba(99, 102, 241, 0.14);
  --sidebar-accent: #6366f1;

  --main-bg: #f4f6f9;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* Accent Colors */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.12);
  --rose: #ef4444;
  --rose-bg: rgba(239, 68, 68, 0.12);
  --cyan: #06b6d4;

  /* Typography & Geometry */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Dark Mode Overrides */
body.dark-mode {
  --main-bg: #090d16;
  --card-bg: #111827;
  --card-border: #1f2937;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
}

/* Reset & Global Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--main-bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Main Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
}

/* ==========================================================================
   LEFT SIDEBAR (Dark Slate Theme)
   ========================================================================== */
.sidebar {
  width: 260px;
  height: 100vh;
  position: sticky;
  top: 0;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  padding: 16px 14px;
  z-index: 10;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 16px;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.5px;
}

.brand-dot {
  color: #a855f7;
}

.sidebar-collapse-btn {
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.sidebar-collapse-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.8px;
  padding: 8px 10px 2px 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.gate-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.gate-status-pill.passed {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.date-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: #ffffff;
  background: var(--sidebar-item-active-bg);
  border-left: 3px solid var(--sidebar-accent);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.nav-badge.alert-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* Project Widget at bottom of sidebar */
.project-widget {
  margin-top: auto;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
}

.widget-label {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.5px;
}

.project-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  margin-bottom: 10px;
}

.project-name {
  display: block;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
}

.project-env {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-dot.online {
  background-color: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}

.project-card-banner {
  height: 54px;
  border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}

.banner-gradient {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.banner-tag {
  font-size: 9px;
  font-weight: 700;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
  padding: 1px 5px;
  border-radius: 3px;
  width: fit-content;
}

.banner-title {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #3b82f6;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
}

.user-role {
  font-size: 10px;
  color: #64748b;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 32px;
  overflow-y: auto;
  max-width: 1600px;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  width: 340px;
  box-shadow: var(--shadow-sm);
}

.search-icon {
  color: var(--text-muted);
  font-size: 14px;
}

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

.shortcut-key {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--main-bg);
  border: 1px solid var(--card-border);
  padding: 2px 6px;
  border-radius: 4px;
}

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

.gate-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 20px;
}

.gate-status-pill.passed {
  background: var(--emerald-bg);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.date-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

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

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

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rose);
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: var(--radius-sm);
}

.filter-pill {
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ==========================================================================
   ROW 1: KPI STAT CARDS
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.kpi-icon {
  font-size: 14px;
  color: var(--text-muted);
}

.kpi-body {
  margin-top: 8px;
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

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

.kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 4px;
}

.kpi-trend.positive {
  color: var(--emerald);
}

.kpi-trend.negative {
  color: var(--rose);
}

.sparkline-container {
  margin-top: 10px;
  height: 35px;
}

/* Gauge Score Card */
.gauge-card {
  align-items: center;
  text-align: center;
}

.gauge-body {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 4px auto;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-score {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.gauge-total {
  font-size: 10px;
  color: var(--text-muted);
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-bg {
  fill: none;
  stroke: var(--card-border);
  stroke-width: 8;
}

.gauge-fill {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}

/* ==========================================================================
   ROW 2: CHARTS SECTION
   ========================================================================== */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

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

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

.donut-wrapper {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 10px auto;
}

.donut-center-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.donut-center-lbl {
  font-size: 11px;
  color: var(--text-muted);
}

.legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.legend-val {
  font-weight: 700;
  color: var(--text-primary);
}

/* ==========================================================================
   ROW 3: DATA TABLE & LIVE FEED
   ========================================================================== */
.bottom-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--main-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.table-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 12px;
  color: var(--text-primary);
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.6);
}

.table-container {
  overflow-x: auto;
  max-height: 460px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}

.dataset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding-right: 6px;
}

.dataset-card {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.dataset-card:hover,
.dataset-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--indigo);
  box-shadow: var(--shadow-md);
  outline: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

.data-table th {
  background: var(--main-bg);
  color: var(--text-secondary);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.04);
}

.qa-id-code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

/* Badges */
.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-easy { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.tag-medium { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tag-hard { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-adversarial { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.tag-pass { background: var(--emerald-bg); color: var(--emerald); }
.tag-fail { background: var(--rose-bg); color: var(--rose); }

/* Progress bar inside table cell */
.metric-bar-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bar-bg {
  flex-grow: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--card-border);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

.bar-val {
  font-size: 11px;
  font-weight: 700;
  width: 32px;

}

/* Feed Panel */
.flex-align {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(0.95); opacity: 1; }
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 4px;
}

.feed-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--main-bg);
  border: 1px solid var(--card-border);
  font-size: 12px;
}

.feed-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.feed-desc {
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.4;
}

/* ==========================================================================
   TAB CONTENT VISIBILITY
   ========================================================================== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* ==========================================================================
   MODAL DIALOG (DownloadAnything Zoom-fade Style & 90deg X hover)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  width: 680px;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--rose);
  transform: rotate(90deg);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-text-box {
  background: var(--main-bg);
  border: 1px solid var(--card-border);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.modal-text-box.code-bg {
  font-family: var(--font-mono);
  font-size: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border: none;
}

.modal-text-box.success-bg {
  background: var(--emerald-bg);
  border-color: rgba(16, 185, 129, 0.3);
}

.modal-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
}

/* Sandbox Styling */
.sandbox-input-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--main-bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
  resize: vertical;
  margin-top: 8px;
}

.sandbox-presets {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.preset-btn {
  background: var(--main-bg);
  border: 1px solid var(--card-border);
  font-size: 11.5px;
  color: var(--primary);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

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

.sandbox-results-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sandbox-metric-card {
  background: var(--main-bg);
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.sm-label { font-size: 11px; color: var(--text-secondary); display: block; }
.sm-val { font-size: 18px; font-weight: 800; color: var(--text-primary); }
.progress-bar-sm { height: 4px; background: var(--card-border); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.pb-fill { height: 100%; background: var(--emerald); width: 0%; transition: width 0.5s ease; }

/* ==========================================================================
   NOTIFICATION CENTER DROPDOWN
   ========================================================================== */
.notification-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-md);
  z-index: 100;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideDownFade 0.2s ease;
}

.notification-menu.active {
  display: flex;
}

@keyframes slideDownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.noti-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  background: var(--main-bg);
}

.noti-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.noti-count-badge {
  background: var(--rose-bg);
  color: var(--rose);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.btn-text-sm {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-sm:hover {
  text-decoration: underline;
}

.noti-list {
  max-height: 320px;
  overflow-y: auto;
}

.noti-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.2s;
}

.noti-item:hover {
  background: rgba(99, 102, 241, 0.04);
}

.noti-item.unread {
  background: rgba(99, 102, 241, 0.06);
}

.noti-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.noti-icon.pass { background: var(--emerald-bg); color: var(--emerald); }
.noti-icon.warning { background: var(--amber-bg); color: var(--amber); }
.noti-icon.info { background: var(--indigo-bg); color: var(--primary); }

.noti-content {
  flex-grow: 1;
}

.noti-item-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.noti-item-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.4;
}

.noti-item-time {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.noti-footer {
  padding: 8px 14px;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  background: var(--main-bg);
  border-top: 1px solid var(--card-border);
}
