:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --accent-cyan: #06b6d4;
  --accent-cyan-glow: rgba(6, 182, 212, 0.25);
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(6, 182, 212, 0.5);
  --glass-blur: blur(16px);
  --header-height: 80px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

h1:focus, h1:focus-visible,
h2:focus, h2:focus-visible,
h3:focus, h3:focus-visible,
h4:focus, h4:focus-visible,
h5:focus, h5:focus-visible,
h6:focus, h6:focus-visible,
img:focus, img:focus-visible,
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.12) 0px, transparent 50%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3.5rem 1.5rem;
  width: 100%;
  flex: 1 0 auto;
}

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-color);
  background: rgba(11, 15, 25, 0.85);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.header-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 1rem;
}

.header-workspace-thumb-area,
.header-red-marked-area {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 38px;
  gap: 0.75rem;
}

.header-org-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.4);
  border-radius: 8px;
  padding: 0.2rem 0.65rem;
  height: 36px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-org-badge:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}

.header-user-badge {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 0.2rem 0.65rem;
  height: 36px;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
  font-size: 0.82rem;
  color: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-user-badge:hover {
  border-color: rgba(245, 158, 11, 0.8);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}

.header-user-badge .user-icon {
  font-size: 0.9rem;
}

.header-user-badge .user-name {
  font-weight: 600;
  color: var(--text-primary);
}

.org-icon {
  font-size: 0.95rem;
  -webkit-user-select: none;
  user-select: none;
}

.header-org-select {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 220px;
}

.header-org-select option {
  background: #0f172a;
  color: #fff;
}

.header-thumb-slot {
  display: flex;
  align-items: center;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.8), rgba(168, 85, 247, 0.8));
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-thumb-slot:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.6);
}

.header-red-box-thumb {
  width: 52px;
  height: 34px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #0b1120;
}

.shared-workspace-alert-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  color: #fef08a;
  font-size: 0.86rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon,
.brand-logo-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  max-width: 44px;
  min-height: 44px;
  max-height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--accent-cyan-glow);
  overflow: hidden;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.brand-logo-img {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: white;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Project Selector in Header */
.project-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(17, 24, 39, 0.9);
  padding: 0.35rem 0.6rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.project-select {
  background: transparent;
  color: var(--text-primary);
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  outline: none;
  cursor: pointer;
  min-width: 160px;
}

.project-select option {
  background: #111827;
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Header Main Navigation Buttons with Glowing Active State */
.header-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.95rem;
  background: rgba(15, 23, 42, 0.75);
  color: #94a3b8 !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-nav-btn:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.25);
  text-decoration: none !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* ACTIVE STATE: Vibrant Gradient, Bright White Text, Glowing Cyan Border & Ambient Halo */
.header-nav-btn.active,
.header-nav-btn.active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(99, 102, 241, 0.25) 50%, rgba(168, 85, 247, 0.25) 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.header-nav-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #22d3ee, #a855f7, transparent);
  border-radius: 2px;
  box-shadow: 0 0 8px #22d3ee;
}

.header-nav-btn .nav-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.header-nav-btn .nav-label {
  letter-spacing: 0.01em;
}

.header-nav-btn .nav-active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  margin-left: 3px;
  animation: navPulseGlow 2s infinite ease-in-out;
}

@keyframes navPulseGlow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
    box-shadow: 0 0 6px #22d3ee;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
    box-shadow: 0 0 12px #22d3ee, 0 0 18px rgba(34, 211, 238, 0.65);
  }
}

/* Secondary & Administrative Tabs: Glowing Neon Halo standard */
.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
}

.nav-tab-btn:hover {
  color: #f8fafc !important;
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none !important;
  transform: translateY(-1px);
}

.nav-tab-btn.active,
.nav-tab-btn.active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(99, 102, 241, 0.22) 50%, rgba(168, 85, 247, 0.22) 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18) !important;
  text-decoration: none !important;
  transform: translateY(-1px);
}

.nav-tab-btn .nav-active-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
  margin-left: 4px;
  animation: navPulseGlow 2s infinite ease-in-out;
}

/* Metrics Ribbon */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s, border-color 0.2s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.metric-icon.blue { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.metric-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }
.metric-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.metric-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.metric-data h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 500;
}

.metric-data .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Main Studio Layout */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 1.5rem;
}

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

/* Consumer 2-Panel Layout: Query & History (Left) | Results & Inspector (Right) */
.qa-two-panel-layout {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1100px) {
  .qa-two-panel-layout {
    grid-template-columns: 1fr;
  }
}

.qa-left-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 85px;
}

@media (max-width: 1100px) {
  .qa-left-panel {
    position: static;
  }
}

.qa-right-panel {
  display: flex;
  flex-direction: column;
  min-height: 600px;
}

.results-panel {
  min-height: 620px;
}

.results-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  text-align: center;
  color: var(--text-secondary);
  padding: 3rem 2rem;
}

.results-empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  opacity: 0.85;
  filter: drop-shadow(0 0 25px var(--accent-cyan-glow));
}

.results-empty-state h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.results-empty-state p {
  max-width: 500px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* History List & Cards */
.history-panel {
  display: flex;
  flex-direction: column;
}

.query-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.history-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.history-item:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: var(--accent-cyan);
  transform: translateX(4px);
}

.history-item.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.history-query-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.history-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.history-item-bottom {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-metric {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.history-empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.query-echo-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-style: italic;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-meta-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
}

.text-muted-xs {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Top Studio Nav Tabs - Sticky Below Header */
.main-nav-tabs {
  position: sticky;
  top: var(--header-height, 80px);
  z-index: 45;
  background: rgba(11, 15, 25, 0.94);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  display: flex;
  gap: 0.5rem;
  margin-top: -0.75rem;
  margin-bottom: 1.5rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  overflow-x: auto;
}

.corpus-page-wrapper .qa-left-panel {
  top: calc(var(--header-height, 80px) + 72px);
}

.main-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.6rem 1.2rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.main-tab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(99, 102, 241, 0.22) 50%, rgba(168, 85, 247, 0.22) 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.42), inset 0 0 8px rgba(6, 182, 212, 0.15) !important;
  position: relative;
}

.main-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 15%;
  right: 15%;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, #22d3ee, #a855f7, transparent);
  border-radius: 2px;
  box-shadow: 0 0 8px #22d3ee;
}

.main-tab-pane {
  display: none;
}

.main-tab-pane.active {
  display: block;
}

/* Role Prompt Config Box */
.role-box-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.role-textarea {
  width: 100%;
  min-height: 70px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

/* Query Box */
.query-box-wrapper {
  position: relative;
  margin-bottom: 1.25rem;
}

.query-input {
  width: 100%;
  min-height: 145px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  padding-bottom: 56px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.query-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-glow);
}

/* Query Box Actions Toolbar & Attachment Tray */
.query-actions-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.query-actions-left,
.query-actions-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
}

.btn-action-icon {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.btn-action-icon:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-action-icon.listening {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  animation: pulse-mic 1.2s infinite;
}

@keyframes pulse-mic {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  70% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.query-submit-btn-inline {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 8px;
  line-height: 1;
}

.hidden-file-input {
  display: none;
}

.action-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: rgba(15, 23, 42, 0.85);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Attachment Tray */
.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
}

.attachment-pill .pill-remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
  font-weight: bold;
  margin-left: 0.2rem;
}

.attachment-pill .pill-remove:hover {
  opacity: 1;
  color: var(--accent-rose);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.6) !important;
  box-shadow: none !important;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #0284c7);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-cyan-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger:hover {
  background: rgba(244, 63, 94, 0.3);
}

.query-submit-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
}

.query-submit-btn.btn-icon-submit {
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: 8px;
  line-height: 1;
}

/* Suggested Prompts */
.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.chip:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Answer Card */
.answer-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 14px;
  padding: 1.5rem;
  margin-top: 1rem;
}

.answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.3); }
.badge-purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }

.answer-body {
  font-size: 1.02rem;
  color: #f8fafc;
  line-height: 1.7;
  white-space: pre-wrap;
}

.answer-body strong,
.answer-body b,
.answer-body mark,
.highlight-keyword {
  color: #fde047 !important;
  background: rgba(250, 204, 21, 0.16) !important;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  font-weight: 700;
  display: inline;
}

.answer-body code {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: var(--accent-cyan);
}

/* Technical Details Collapsible Accordion */
.technical-accordion {
  margin-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

.technical-accordion-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  text-align: left;
}

.technical-accordion-header:hover {
  background: rgba(30, 41, 59, 0.6);
  border-color: var(--accent-cyan);
}

.technical-accordion-header.expanded {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(6, 182, 212, 0.4);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.accordion-chevron {
  font-size: 0.85rem;
  color: var(--accent-cyan);
  transition: transform 0.2s ease;
  display: inline-block;
}

.technical-accordion-header.expanded .accordion-chevron {
  transform: rotate(90deg);
}

.accordion-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
}

.accordion-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.accordion-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.technical-accordion-content {
  border: 1px solid var(--border-color);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  padding: 1.25rem;
  background: rgba(11, 15, 25, 0.35);
}

.technical-accordion-content .tabs-nav {
  margin-top: 0;
}

/* Context Inspection Tabs */
.tabs-nav {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
}

.tab-pane {
  display: none;
  padding-top: 1rem;
}

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

/* Triples & Chunks */
.triples-container {
  display: grid;
  gap: 0.75rem;
}

.triple-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.node-pill {
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid var(--accent-purple);
  color: #e9d5ff;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.edge-arrow {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
}

.triple-context {
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.35rem;
}

.chunk-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.chunk-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.chunk-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Upload Drop Zone */
.upload-dropzone {
  border: 2px dashed rgba(6, 182, 212, 0.4);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  background: rgba(6, 182, 212, 0.03);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1.25rem;
}

.upload-dropzone:hover, .upload-dropzone.dragover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--accent-cyan);
}

.upload-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Document Sidebar / Table */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-item {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}

.doc-item:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.doc-info h5 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.doc-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 2rem;
  max-width: 540px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-cyan);
}

/* Benchmark Result Cards */
.bench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bench-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.bench-card .score {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0.5rem;
}

.evaluation-item {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

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

@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* Sidebar & Layout Helpers */
.selector-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.entities-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sidebar-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.sidebar-metric-box {
  background: rgba(15, 23, 42, 0.5);
  padding: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.sidebar-metric-val-purple {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.sidebar-metric-val-emerald {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-emerald);
}

.sidebar-heading {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.doc-list-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
}

.sidebar-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-footer-link {
  font-size: 0.82rem;
  color: var(--accent-cyan);
  text-decoration: none;
}

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

/* Studio Design System & Component Classes */
.panel-mw-850 { max-width: 850px; }
.panel-mw-650 { max-width: 650px; }

/* Settings Tab Full-Width 2-Column Responsive Dashboard */
.settings-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 768px) {
  .settings-meta-row {
    grid-template-columns: 1fr;
  }
}

.settings-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

@media (max-width: 1024px) {
  .settings-dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.settings-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.flex-1 { flex: 1; }
.d-flex-col { display: flex; flex-direction: column; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.font-icon-lg { font-size: 1.1rem; }
.font-semibold { font-weight: 600; }
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }
.text-white { color: #fff; }

.role-textarea {
  min-height: 130px;
  font-family: var(--font-sans);
}

.modal-textarea-md { min-height: 90px; }
.modal-textarea-sm { min-height: 60px; }
.btn-group-sm { display: flex; gap: 0.75rem; }
.setting-select { flex: 1; min-width: 280px; }
.setting-btn { height: 42px; }
.score-accuracy { color: var(--accent-emerald); }
.score-retrieval { color: var(--accent-cyan); }

.text-muted-center {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
}

.form-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.matrix-panel {
  margin-top: 1.25rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
}

.matrix-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.matrix-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.matrix-box {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.matrix-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.matrix-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.badge-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.setting-card {
  background: rgba(15, 23, 42, 0.5);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.setting-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.setting-note {
  font-size: 0.83rem;
  color: var(--accent-cyan);
  margin-top: 0.6rem;
  line-height: 1.4;
}

.download-alert {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.download-alert-body {
  flex: 1;
}

.download-alert-title {
  color: #fff;
  font-size: 0.92rem;
}

.download-alert-msg {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.banner-box {
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-color);
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.banner-text {
  font-size: 0.88rem;
  font-weight: 500;
}

.dataset-scroll-list {
  max-height: 350px;
  overflow-y: auto;
}

.live-bench-card {
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--accent-cyan);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.15);
}

.live-bench-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width 0.3s ease;
}

.live-case-box {
  background: rgba(30, 41, 59, 0.5);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--accent-purple);
}

.live-case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.live-case-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-purple);
}

.live-case-question {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 500;
}

.bench-empty-state {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem 0;
}

.active-model-val {
  font-size: 1.1rem;
  padding-top: 4px;
}

.db-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.db-card {
  background: rgba(15, 23, 42, 0.5);
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.db-card-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.db-card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.preset-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;
}

.preset-chip-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-chip-btn:hover {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.form-section-divider {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 1.5rem 0 1.25rem 0;
}

.ontology-header {
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}

.ontology-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.role-textarea-sm {
  min-height: 85px;
}

.suggestions-list-compact {
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ====================================================
   GRAPH VISUALISER & CYTOSCAPE STYLES
   ==================================================== */

.graph-workspace-panel {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  border-radius: 10px;
}

.graph-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.graph-toolbar-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.graph-select-perspective {
  min-width: 260px;
  max-width: 340px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  background: rgba(30, 41, 59, 0.9);
}

.graph-select-sm {
  min-width: 140px;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  background: rgba(30, 41, 59, 0.9);
}

.graph-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-icon {
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Custom Natural Language Prompt Box */
.custom-graph-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--accent-purple);
  border-radius: 10px;
  padding: 1rem;
  animation: fadeIn 0.3s ease;
}

.custom-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.custom-graph-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.custom-graph-input-row {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.custom-graph-textarea {
  flex: 1;
  min-height: 65px;
  font-size: 0.9rem;
}

.custom-graph-submit-btn {
  min-width: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Cypher preview box */
.cypher-code-box {
  margin-top: 0.75rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
}

.cypher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--accent-cyan);
  margin-bottom: 0.4rem;
}

.cypher-pre {
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: #fde047;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Graph Canvas Container */
.graph-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 620px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.5) 0%, rgba(10, 15, 29, 0.95) 100%);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.graph-cytoscape-canvas {
  width: 100%;
  height: 100%;
}

.graph-loading-overlay, .graph-empty-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

/* Slide-out Inspector Drawer */
.graph-inspector-drawer {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 320px;
  max-height: calc(100% - 2rem);
  background: rgba(15, 23, 42, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.25s ease;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.5);
}

.inspector-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.btn-close-sm {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
}

.btn-close-sm:hover {
  color: #fff;
}

.inspector-body {
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.inspector-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.inspector-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inspector-val-bold {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.inspector-desc-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem;
  border-radius: 6px;
}

.inspector-neighbors-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 180px;
  overflow-y: auto;
}

.inspector-neighbor-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s;
}

.inspector-neighbor-item:hover {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

/* Graph Footer Bar */
.graph-footer-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.graph-stats-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.graph-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s ease;
}

/* Default / Cyberpunk Theme */
.graph-legend .dot-standard,
.graph-legend[data-theme="cyberpunk"] .dot-standard { background: #a855f7; box-shadow: 0 0 6px #c084fc; }
.graph-legend .dot-component,
.graph-legend[data-theme="cyberpunk"] .dot-component { background: #06b6d4; box-shadow: 0 0 6px #38bdf8; }
.graph-legend .dot-failure,
.graph-legend[data-theme="cyberpunk"] .dot-failure { background: #f43f5e; box-shadow: 0 0 6px #fb7185; }
.graph-legend .dot-process,
.graph-legend[data-theme="cyberpunk"] .dot-process { background: #f59e0b; box-shadow: 0 0 6px #fbbf24; }
.graph-legend .dot-general,
.graph-legend[data-theme="cyberpunk"] .dot-general { background: #10b981; box-shadow: 0 0 6px rgba(255, 255, 255, 0.4); }

/* Matrix Theme */
.graph-legend[data-theme="matrix"] .dot-standard { background: #16a34a; box-shadow: 0 0 6px #86efac; }
.graph-legend[data-theme="matrix"] .dot-component { background: #10b981; box-shadow: 0 0 6px #4ade80; }
.graph-legend[data-theme="matrix"] .dot-failure { background: #15803d; box-shadow: 0 0 6px #22c55e; }
.graph-legend[data-theme="matrix"] .dot-process { background: #84cc16; box-shadow: 0 0 6px #bef264; }
.graph-legend[data-theme="matrix"] .dot-general { background: #059669; box-shadow: 0 0 6px rgba(134, 239, 172, 0.5); }

/* Ocean Theme */
.graph-legend[data-theme="ocean"] .dot-standard { background: #6366f1; box-shadow: 0 0 6px #818cf8; }
.graph-legend[data-theme="ocean"] .dot-component { background: #0284c7; box-shadow: 0 0 6px #38bdf8; }
.graph-legend[data-theme="ocean"] .dot-failure { background: #0d9488; box-shadow: 0 0 6px #2dd4bf; }
.graph-legend[data-theme="ocean"] .dot-process { background: #0ea5e9; box-shadow: 0 0 6px #7dd3fc; }
.graph-legend[data-theme="ocean"] .dot-general { background: #2563eb; box-shadow: 0 0 6px rgba(125, 211, 252, 0.5); }

/* Crimson Theme */
.graph-legend[data-theme="crimson"] .dot-standard { background: #d97706; box-shadow: 0 0 6px #f59e0b; }
.graph-legend[data-theme="crimson"] .dot-component { background: #e11d48; box-shadow: 0 0 6px #fb7185; }
.graph-legend[data-theme="crimson"] .dot-failure { background: #dc2626; box-shadow: 0 0 6px #ef4444; }
.graph-legend[data-theme="crimson"] .dot-process { background: #ea580c; box-shadow: 0 0 6px #f97316; }
.graph-legend[data-theme="crimson"] .dot-general { background: #e11d48; box-shadow: 0 0 6px rgba(253, 164, 175, 0.5); }

/* Sunset Theme */
.graph-legend[data-theme="sunset"] .dot-standard { background: #7c3aed; box-shadow: 0 0 6px #c084fc; }
.graph-legend[data-theme="sunset"] .dot-component { background: #c026d3; box-shadow: 0 0 6px #f0abfc; }
.graph-legend[data-theme="sunset"] .dot-failure { background: #ea580c; box-shadow: 0 0 6px #fb923c; }
.graph-legend[data-theme="sunset"] .dot-process { background: #f59e0b; box-shadow: 0 0 6px #fde047; }
.graph-legend[data-theme="sunset"] .dot-general { background: #f97316; box-shadow: 0 0 6px rgba(254, 215, 170, 0.5); }

/* Minimal Theme */
.graph-legend[data-theme="minimal"] .dot-standard { background: #cbd5e1; box-shadow: 0 0 6px #f8fafc; }
.graph-legend[data-theme="minimal"] .dot-component { background: #64748b; box-shadow: 0 0 6px #94a3b8; }
.graph-legend[data-theme="minimal"] .dot-failure { background: #475569; box-shadow: 0 0 6px #64748b; }
.graph-legend[data-theme="minimal"] .dot-process { background: #334155; border: 1px solid #94a3b8; }
.graph-legend[data-theme="minimal"] .dot-general { background: #94a3b8; box-shadow: 0 0 6px rgba(255, 255, 255, 0.8); }

.dot-purple { background: var(--accent-purple); }
.dot-cyan { background: var(--accent-cyan); }
.dot-rose { background: var(--accent-rose); }
.dot-amber { background: var(--accent-amber); }
.dot-emerald { background: var(--accent-emerald); }

.settings-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1rem;
}

/* ==========================================================================
   AI CONFIGURATION & MULTI-PROVIDER ORCHESTRATOR STYLES
   ========================================================================== */

.ai-provider-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ai-provider-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.ai-provider-card:hover {
  background: rgba(30, 41, 59, 0.7);
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.ai-provider-card.active {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.25);
}

.ai-provider-card.active::before {
  content: "ACTIVE";
  position: absolute;
  top: 10px;
  right: -24px;
  transform: rotate(45deg);
  background: var(--accent-cyan);
  color: #041017;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 28px;
}

.ai-provider-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.ai-provider-icon {
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-provider-title-wrap h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.ai-provider-badge {
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.ai-provider-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.85rem;
  flex: 1;
}

.ai-provider-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Provider Configuration Form Panel */
.provider-config-panel {
  background: rgba(11, 15, 25, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.provider-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.provider-form-row-full {
  grid-column: 1 / -1;
}

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

.input-password-wrapper input {
  padding-right: 46px;
}

.btn-toggle-token {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
}

.btn-toggle-token:hover {
  color: var(--accent-cyan);
}

.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-primary);
  -webkit-user-select: none;
  user-select: none;
}

.form-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.provider-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.test-connection-alert {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.test-connection-alert.success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid var(--accent-emerald);
  color: #a7f3d0;
}

.test-connection-alert.error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid var(--accent-rose);
  color: #fecdd3;
}

.test-connection-alert .alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.test-connection-alert-body {
  flex: 1;
}

.test-connection-alert-title {
  font-weight: 700;
  display: block;
  margin-bottom: 0.25rem;
}

.table-cell-desc {
  max-width: 260px;
}

.table-cell-truncate {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-actions-row {
  display: flex;
  gap: 0.4rem;
}

.text-purple {
  color: var(--accent-purple);
}

.text-cyan {
  color: var(--accent-cyan);
}

.text-emerald {
  color: var(--accent-emerald);
}

.redirect-body {
  background: var(--bg-main, #0b0f19);
  color: var(--text-primary, #e2e8f0);
  font-family: var(--font-main, sans-serif);
  padding: 2rem;
}

.redirect-link {
  color: var(--accent-cyan, #38bdf8);
}

/* Document Ingestion Full-Width Grid & Search */
.doc-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  width: 100%;
}

.doc-search-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  color: #fff;
  font-size: 0.825rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.doc-search-input:focus {
  border-color: var(--accent-cyan);
}

.doc-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.65rem;
  max-height: 480px;
  overflow-y: auto;
  width: 100%;
  padding-right: 4px;
}

.doc-card-compact {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  transition: all 0.2s ease;
}

.doc-card-compact:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-1px);
}

.doc-card-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
}

.doc-card-details {
  flex: 1;
  min-width: 0;
}

.doc-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-card-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-icon-xs {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: #ef4444;
  transition: background 0.15s ease;
}

.btn-icon-xs:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Benchmark Result Breakdown Card */
.bench-result-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.bench-result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.bench-result-body {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Document Table & Sticky Header Grid */
.doc-table-container {
  width: 100%;
  max-height: 480px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8rem;
}

.doc-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 5;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.doc-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #f1f5f9;
  vertical-align: middle;
}

.doc-table tbody tr {
  transition: background-color 0.15s ease;
}

.doc-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.6);
}

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

.doc-name-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: #f8fafc;
}

.doc-name-text {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ground-Truth Benchmarks Matrix Table & Controls */
.bench-controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.matrix-table-wrap {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 440px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.825rem;
}

.matrix-table th {
  position: sticky;
  top: 0;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 2;
  white-space: nowrap;
}

.matrix-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  vertical-align: middle;
}

.matrix-table tbody tr {
  transition: background-color 0.15s ease;
}

.matrix-table tbody tr:hover {
  background: rgba(30, 41, 59, 0.5);
}

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

.table-col-num {
  width: 45px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.table-col-question {
  width: 32%;
  font-weight: 600;
  color: #f8fafc;
}

.table-col-expected {
  width: 38%;
  color: var(--text-secondary);
  line-height: 1.45;
}

.table-col-source {
  width: 20%;
  color: var(--accent-cyan);
  font-size: 0.78rem;
}

.table-col-action {
  width: 60px;
  text-align: center;
}

.matrix-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.matrix-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

/* ==========================================================================
   VISUAL GROUNDING, INLINE IMAGES & LIGHTBOX STYLES
   ========================================================================== */

.result-inline-image-wrap {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  max-width: 540px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.result-inline-image-wrap:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.18);
}

.result-inline-img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: #060c18;
  cursor: pointer;
  transition: transform 0.2s;
  display: block;
}

.result-inline-img:hover {
  transform: scale(1.015);
}

.image-caption {
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: rgba(10, 15, 28, 0.85);
  width: 100%;
  border-top: 1px solid var(--border-color);
}

.image-reference-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: var(--font-mono);
  font-weight: 600;
  margin: 0.2rem 0.1rem;
}

.referenced-visual-gallery {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

.gallery-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gallery-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.visual-evidence-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  width: 220px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.visual-evidence-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.img-thumbnail-wrap {
  position: relative;
  width: 100%;
  height: 130px;
  overflow: hidden;
  background: #060c18;
  cursor: pointer;
}

.visual-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.img-thumbnail-wrap:hover .zoom-overlay {
  opacity: 1;
}

.evidence-meta {
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.evidence-filename {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-archived-box {
  padding: 1.25rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(245, 158, 11, 0.08);
}

.archived-icon {
  font-size: 1.6rem;
  opacity: 0.8;
}

.badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.15s ease-out;
}

.lightbox-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-header {
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.95);
}

.lightbox-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.lightbox-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}

.lightbox-close-btn:hover {
  color: var(--text-primary);
}

.lightbox-body {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

.lightbox-img {
  max-width: 85vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
}

/* Document Dependency / Grounding Temperature Slider */
.dependency-control-card {
  background: rgba(15, 23, 42, 0.45);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.dependency-guide-box {
  background: rgba(11, 15, 25, 0.6);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
}

.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, #8b5cf6 0%, #06b6d4 50%, #10b981 100%);
  outline: none;
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 0.5rem 0;
}

.custom-slider:focus {
  box-shadow: 0 0 12px var(--accent-cyan-glow);
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.8), 0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.95);
}

.custom-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.35);
  border-color: #10b981;
}

.custom-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #06b6d4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.8), 0 2px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.15s ease;
}

.custom-slider::-moz-range-thumb:hover {
  transform: scale(1.25);
}

.slider-ticks-row span {
  transition: color 0.15s ease;
  font-size: 0.72rem;
  -webkit-user-select: none;
  user-select: none;
}

.slider-ticks-row span:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   WORKSPACE ACTIVE BANNER & HEADER THUMBNAIL
   ========================================================================== */
.workspace-active-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-bottom: 1.25rem;
}

.workspace-active-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 0;
}

.workspace-active-info {
  min-width: 0;
}

.workspace-active-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--text-primary);
}

.workspace-active-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0.2rem 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 650px;
}

.workspace-active-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.workspace-banner-thumb-wrapper {
  position: relative;
  display: inline-block;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.workspace-banner-thumb-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
}

.workspace-header-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #000;
}

/* ==========================================================================
   WORKSPACES HUB LANDING PAGE
   ========================================================================== */
.workspace-hub-container {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.workspace-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(17, 24, 39, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.workspace-hub-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  letter-spacing: -0.02em;
}

.workspace-hub-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0.35rem 0 0 0;
}

/* Executive Totals Grid */
.workspace-hub-totals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
}

.workspace-hub-total-card {
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.workspace-hub-total-card:hover {
  transform: translateY(-2px);
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.workspace-hub-total-icon {
  font-size: 1.75rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.workspace-hub-total-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.15;
}

.workspace-hub-total-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

/* Workspaces Hub Search & Filters Toolbar */
.workspace-hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(17, 24, 39, 0.65);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.workspace-hub-search-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  flex: 1;
  min-width: 280px;
  max-width: 480px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.workspace-hub-search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
}

.hub-search-icon {
  font-size: 0.95rem;
  opacity: 0.75;
  -webkit-user-select: none;
  user-select: none;
}

.hub-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.85rem;
  width: 100%;
}

.hub-search-input::placeholder {
  color: var(--text-muted);
}

.hub-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 0.25rem;
  transition: color 0.15s ease;
}

.hub-clear-btn:hover {
  color: #fff;
}

.workspace-hub-filter-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hub-filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hub-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.hub-filter-select {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  color: #fff;
  font-size: 0.82rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

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

.workspace-hub-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0 0.35rem;
}

.workspace-hub-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 2rem;
  background: rgba(17, 24, 39, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  text-align: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.workspace-hub-empty-state h3 {
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}

/* Workspaces Grid */
.workspace-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.workspace-hub-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  position: relative;
}

.workspace-hub-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(6, 182, 212, 0.15);
}

.workspace-card-header-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.workspace-card-thumb-badge-wrap {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.workspace-card-thumb-small {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  background: #000;
}

.workspace-card-title-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.workspace-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.workspace-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
}

.workspace-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4rem;
}

.workspace-card-role-snippet {
  background: rgba(0, 0, 0, 0.3);
  border-left: 3px solid var(--accent-purple);
  padding: 0.5rem 0.65rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.75rem;
  color: #c4b5fd;
  font-style: italic;
  margin-bottom: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.6rem 0.4rem;
  margin-top: auto;
  margin-bottom: 1rem;
  text-align: center;
}

.workspace-card-metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workspace-card-metric-val {
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
  line-height: 1.2;
}

.workspace-card-metric-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.1rem;
}

.workspace-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.btn-open-workspace {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  padding: 0.6rem 1rem;
}

/* ==========================================================================
   DANGEROUS OPERATIONS MODALS & STATUS TRACKING
   ========================================================================== */
.danger-modal-card {
  border: 1px solid rgba(244, 63, 94, 0.4) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7), 0 0 30px rgba(244, 63, 94, 0.2) !important;
}

.danger-alert-box {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.danger-alert-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}

.danger-alert-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fb7185;
  margin-bottom: 0.25rem;
}

.danger-alert-body {
  font-size: 0.82rem;
  color: #fecdd3;
  line-height: 1.45;
  margin: 0;
}

.danger-step-log {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.danger-confirm-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  -webkit-user-select: none;
  user-select: none;
}

.danger-confirm-check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #f43f5e;
  cursor: pointer;
}

/* Thumbnail Visual Identity In Persona Tab */
.thumb-upload-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.thumb-preview-box {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 2px solid var(--accent-cyan);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  flex-shrink: 0;
  background: #000;
}

.thumb-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   TOP-RIGHT USER PROFILE DROPDOWN & GLOWING NEON HALO
   ========================================================================== */
.header-user-dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.header-user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(34, 211, 238, 0.4);
  border-radius: 9px;
  padding: 0.25rem 0.75rem;
  height: 38px;
  font-size: 0.84rem;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.header-user-dropdown-btn:hover,
.header-user-dropdown-btn.active {
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18) !important;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(99, 102, 241, 0.22) 50%, rgba(168, 85, 247, 0.22) 100%), rgba(15, 23, 42, 0.95) !important;
}

.header-user-dropdown-btn .user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 6px rgba(6, 182, 212, 0.5);
}

.header-user-dropdown-btn .user-details-column {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.header-user-dropdown-btn .user-display-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.82rem;
}

.header-user-dropdown-btn .user-org-caption {
  font-size: 0.68rem;
  color: #94a3b8;
}

.header-user-dropdown-btn .dropdown-caret {
  font-size: 0.65rem;
  color: #38bdf8;
  transition: transform 0.2s ease;
}

.header-user-dropdown-btn.active .dropdown-caret {
  transform: rotate(180deg);
}

.header-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 250px;
  background: rgba(10, 15, 30, 0.96);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.15);
  border-radius: 12px;
  padding: 0.6rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  animation: dropdownFadeSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-menu-header {
  padding: 0.5rem 0.65rem 0.65rem;
  border-bottom: 1px solid rgba(34, 211, 238, 0.2);
  margin-bottom: 0.25rem;
}

.user-menu-header-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.9rem;
}

.user-menu-header-email {
  font-size: 0.74rem;
  color: #94a3b8;
  word-break: break-all;
}

.user-menu-header-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.18);
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: #38bdf8;
  font-weight: 600;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: #e2e8f0;
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.user-menu-item:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(99, 102, 241, 0.22) 50%, rgba(168, 85, 247, 0.22) 100%);
  border-color: rgba(34, 211, 238, 0.6);
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

.user-menu-item .item-icon {
  font-size: 1rem;
}

.user-menu-item .item-ext {
  margin-left: auto;
  font-size: 0.75rem;
  color: #38bdf8;
}

.user-menu-item.logout {
  color: #fca5a5;
}

.user-menu-item.logout:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
}

/* ==========================================================================
   SESSION INACTIVITY WARNING MODAL (GLOWING NEON HALO)
   ========================================================================== */
.session-timeout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 9, 20, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  animation: timeoutFadeIn 0.3s ease;
}

@keyframes timeoutFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.session-timeout-card {
  width: 440px;
  max-width: 90vw;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(99, 102, 241, 0.15) 50%, rgba(168, 85, 247, 0.15) 100%), #0c1222;
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.55), inset 0 0 14px rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: center;
  color: #ffffff;
}

.timeout-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  margin-bottom: 1.25rem;
}

.timeout-pulse-icon {
  font-size: 2rem;
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)); }
}

.timeout-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.timeout-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.timeout-counter-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid rgba(34, 211, 238, 0.6);
  border-radius: 12px;
  padding: 1.2rem;
  margin: 1rem 0;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35), inset 0 0 10px rgba(6, 182, 212, 0.12);
}

.countdown-digits {
  font-size: 3rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: monospace;
  letter-spacing: 2px;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.8);
}

.countdown-label {
  font-size: 0.78rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 0.25rem;
}

.timeout-note {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin-bottom: 1.25rem;
}

.timeout-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.timeout-btn-logout {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.timeout-btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.7);
  color: #f87171;
}

.timeout-btn-extend {
  flex: 1.5;
  background: linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.5);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timeout-btn-extend:hover {
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.8);
  transform: translateY(-1px);
}

/* ==========================================================================
   Thin Application Footer & Light Text
   ========================================================================== */
.app-footer-thin {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0.25rem 1.5rem;
  min-height: 28px;
  background: rgba(11, 15, 25, 0.94);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.7);
  letter-spacing: 0.01em;
  z-index: 60;
  width: 100%;
  -webkit-user-select: none;
  user-select: none;
}

.footer-col-left {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-persona-text {
  color: rgba(168, 85, 247, 0.85);
  font-weight: 500;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-col-center {
  text-align: center;
  white-space: nowrap;
}

.footer-copyright {
  color: rgba(148, 163, 184, 0.75);
  font-weight: 400;
}

.footer-col-right {
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
  white-space: nowrap;
  font-family: var(--font-mono, monospace);
  font-size: 0.70rem;
  color: rgba(148, 163, 184, 0.55);
}

.footer-version {
  color: rgba(148, 163, 184, 0.75);
  font-weight: 500;
}

.footer-sep {
  opacity: 0.35;
}

.footer-build {
  color: rgba(148, 163, 184, 0.5);
}

.auth-layout-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-layout-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .app-footer-thin {
    display: flex;
    flex-direction: column;
    padding: 0.35rem 1rem;
    gap: 0.2rem;
    text-align: center;
  }
  .footer-col-left {
    display: none;
  }
  .footer-col-right {
    justify-content: center;
  }
}

/* ====================================================================
   FORM CONTROLS & DROPDOWNS: GLOWING NEON CYBER THEME
   ==================================================================== */
.form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: rgba(15, 23, 42, 0.88);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2322d3ee'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px 14px;
  color: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 2.25rem 0.45rem 0.85rem;
  border: 1.5px solid rgba(34, 211, 238, 0.45);
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.3);
  outline: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-select:hover {
  border-color: rgba(34, 211, 238, 0.8);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
  color: #ffffff;
}

.form-select:focus {
  border: 1.5px solid rgba(34, 211, 238, 0.95);
  box-shadow: 0 0 18px rgba(6, 182, 212, 0.5), inset 0 0 8px rgba(6, 182, 212, 0.2);
  color: #ffffff;
}

.form-select option {
  background-color: #0b1120;
  color: #f1f5f9;
  padding: 0.6rem 0.8rem;
  font-weight: 500;
}

.form-select option:checked {
  background-color: #0284c7;
  color: #ffffff;
}

.form-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

/* FORM INPUT */
.form-input {
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f8fafc;
  font-family: 'Inter', sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.form-input:hover {
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.2);
}

.form-input:focus {
  border: 1.5px solid rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 8px rgba(6, 182, 212, 0.15);
  color: #ffffff;
}

.form-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

/* ====================================================================
   ADMIN TABLE TOOLBAR, SORTABLE HEADERS & MATRIX TABLE
   ==================================================================== */
.global-admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.6);
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.global-admin-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.global-admin-subtitle {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0.25rem 0 0 0;
}

.admin-table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.toolbar-search-wrapper {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
}

.toolbar-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #38bdf8;
  pointer-events: none;
  font-size: 0.82rem;
}

.toolbar-search-input {
  width: 100%;
  padding-left: 2.2rem !important;
}

.toolbar-filters-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toolbar-count-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(30, 41, 59, 0.6);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* TABLE MATRIX */
.table-matrix {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.83rem;
  color: #cbd5e1;
}

.table-matrix thead th {
  background: rgba(15, 23, 42, 0.92);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 1rem;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.table-matrix tbody tr {
  transition: background 0.15s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.table-matrix tbody tr:hover {
  background: rgba(30, 41, 59, 0.45);
}

.table-matrix tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

/* SORTABLE TABLE HEADERS */
.sortable-th {
  cursor: pointer;
  transition: all 0.18s ease;
}

.sortable-th:hover {
  color: #22d3ee !important;
  background: rgba(34, 211, 238, 0.08) !important;
}

.sortable-th.active-sort {
  color: #22d3ee !important;
  border-bottom-color: #22d3ee !important;
}

.sort-icon {
  display: inline-block;
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: #22d3ee;
  text-shadow: 0 0 6px rgba(34, 211, 238, 0.7);
}

.sort-icon-inactive {
  opacity: 0.25;
}

/* ==========================================================================
   IMPERSONATION ALERT BANNER & CONTROLS (GLOWING NEON AMBER/HALO)
   ========================================================================== */

.impersonation-alert-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.22) 0%, rgba(245, 158, 11, 0.28) 50%, rgba(180, 83, 9, 0.22) 100%);
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35), inset 0 0 10px rgba(245, 158, 11, 0.15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding: 0.55rem 1rem;
}

.impersonation-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.impersonation-info-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.impersonation-pulse-badge {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  animation: pulse-impersonate 2.5s infinite ease-in-out;
}

@keyframes pulse-impersonate {
  0%, 100% {
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
    border-color: rgba(245, 158, 11, 0.6);
  }
  50% {
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.7);
    border-color: rgba(245, 158, 11, 1);
  }
}

.impersonation-text {
  color: #ffffff;
  font-size: 0.88rem;
}

.impersonation-text strong {
  color: #fbbf24;
  font-weight: 700;
}

.impersonation-meta {
  color: #94a3b8;
  font-size: 0.8rem;
  margin-left: 0.25rem;
}

.impersonation-actor-pill {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
  color: #e2e8f0;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.impersonation-actor-pill strong {
  color: #38bdf8;
}

.btn-exit-impersonation {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(220, 38, 38, 0.4) 100%);
  border: 1.5px solid rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35), inset 0 0 8px rgba(239, 68, 68, 0.2);
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-exit-impersonation:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.45) 0%, rgba(220, 38, 38, 0.65) 100%);
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.6), inset 0 0 10px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-impersonate {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2) 0%, rgba(217, 119, 6, 0.35) 100%) !important;
  border: 1.2px solid rgba(245, 158, 11, 0.8) !important;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25) !important;
  color: #ffffff !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-impersonate:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(217, 119, 6, 0.55) 100%) !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5), inset 0 0 8px rgba(245, 158, 11, 0.2) !important;
  transform: translateY(-1px);
}

/* User Impersonation Active Permission Warning Pill & Withdrawal */
.active-grant-warning-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.15);
  border: 1.5px solid rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35), inset 0 0 8px rgba(245, 158, 11, 0.18);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  color: #fbbf24;
  font-weight: 600;
  animation: pulse-amber-glow 3s infinite ease-in-out;
}

.active-grant-warning-pill .grant-label {
  white-space: nowrap;
}

.btn-withdraw-grant {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border: 1px solid rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.4);
  color: #ffffff !important;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-withdraw-grant:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.7);
  transform: translateY(-1px);
}

.btn-pending-grant-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(6, 182, 212, 0.18);
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.4), inset 0 0 8px rgba(6, 182, 212, 0.2);
  border-radius: 9999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.78rem;
  color: #38bdf8;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-pending-grant-pill:hover {
  background: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.65);
  transform: translateY(-1px);
}

/* Security Alert Impersonation Modals */
.impersonation-security-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.impersonation-security-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid rgba(245, 158, 11, 0.85);
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.45), inset 0 0 16px rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  padding: 2rem;
  max-width: 580px;
  width: 100%;
  animation: modal-enter 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.impersonation-security-card.alert-red {
  border: 1.5px solid rgba(239, 68, 68, 0.85);
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.5), inset 0 0 16px rgba(239, 68, 68, 0.18);
}

/* ==========================================================================
   TOP-RIGHT THEME TOGGLE (DARK / LIGHT MODE)
   ========================================================================== */
.auth-top-right-bar {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(34, 211, 238, 0.4);
  border-radius: 9px;
  color: #38bdf8;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
  flex-shrink: 0;
}

.header-theme-toggle-btn:hover {
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18) !important;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.22) 0%, rgba(99, 102, 241, 0.22) 50%, rgba(168, 85, 247, 0.22) 100%), rgba(15, 23, 42, 0.95) !important;
  color: #ffffff;
  transform: translateY(-1px);
}

.header-theme-toggle-btn:focus-visible {
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45);
}

.header-theme-toggle-btn .theme-toggle-icon {
  display: block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-theme-toggle-btn:hover .theme-toggle-icon {
  transform: rotate(18deg) scale(1.12);
}

/* ==========================================================================
   LIGHT THEME DESIGN SYSTEM (ACTIVATED VIA [data-theme="light"])
   ========================================================================== */
html[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.98);
  --bg-card-hover: rgba(248, 250, 252, 0.98);
  --accent-cyan: #0284c7;
  --accent-cyan-glow: rgba(2, 132, 199, 0.2);
  --accent-purple: #7c3aed;
  --accent-purple-glow: rgba(124, 58, 237, 0.2);
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border-color: rgba(203, 213, 225, 0.8);
  --border-focus: rgba(2, 132, 199, 0.7);
}

/* Base Body & Layout */
html[data-theme="light"] body {
  background-color: #f8fafc !important;
  background-image:
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.07) 0px, transparent 55%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.06) 0px, transparent 55%) !important;
  color: #0f172a !important;
}

html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] h4,
html[data-theme="light"] h5,
html[data-theme="light"] h6 {
  color: #0f172a;
}

html[data-theme="light"] p {
  color: #334155;
}

html[data-theme="light"] .text-muted {
  color: #64748b !important;
}

/* Header & Nav */
html[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.92) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .brand-title {
  background: linear-gradient(to right, #0f172a, #334155) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .project-selector-wrapper {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

html[data-theme="light"] .project-select {
  color: #0f172a !important;
}

html[data-theme="light"] .project-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] .header-nav-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .header-nav-btn:hover {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(6, 182, 212, 0.6) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

html[data-theme="light"] .header-nav-btn.active,
html[data-theme="light"] .header-nav-btn.active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(99, 102, 241, 0.3) 50%, rgba(168, 85, 247, 0.3) 100%), #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(14, 165, 233, 0.95) !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.38), inset 0 0 10px rgba(14, 165, 233, 0.12) !important;
}

html[data-theme="light"] .header-org-badge {
  background: #ffffff !important;
  border: 1.5px solid rgba(6, 182, 212, 0.35) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .header-org-select {
  color: #0f172a !important;
}

html[data-theme="light"] .header-org-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] .header-org-static-label {
  color: #0f172a !important;
}

html[data-theme="light"] .header-user-dropdown-btn {
  background: #ffffff !important;
  border: 1.5px solid rgba(34, 211, 238, 0.45) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

html[data-theme="light"] .header-user-dropdown-btn:hover,
html[data-theme="light"] .header-user-dropdown-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(99, 102, 241, 0.18) 50%, rgba(168, 85, 247, 0.18) 100%), #ffffff !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35), inset 0 0 10px rgba(6, 182, 212, 0.12) !important;
}

html[data-theme="light"] .header-user-dropdown-btn .user-display-name {
  color: #0f172a !important;
}

html[data-theme="light"] .header-user-dropdown-btn .user-org-caption {
  color: #64748b !important;
}

html[data-theme="light"] .header-user-menu {
  background: #ffffff !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12), 0 0 16px rgba(6, 182, 212, 0.22) !important;
}

html[data-theme="light"] .user-menu-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .user-menu-header-name {
  color: #0f172a !important;
}

html[data-theme="light"] .user-menu-header-email {
  color: #64748b !important;
}

html[data-theme="light"] .user-menu-header-badge {
  color: #0284c7 !important;
}

html[data-theme="light"] .user-menu-item {
  color: #334155 !important;
}

html[data-theme="light"] .user-menu-item:hover {
  background: rgba(6, 182, 212, 0.1) !important;
  color: #0284c7 !important;
}

html[data-theme="light"] .user-menu-item.logout {
  color: #e11d48 !important;
}

html[data-theme="light"] .user-menu-item.logout:hover {
  background: rgba(244, 63, 94, 0.1) !important;
  color: #be123c !important;
}

/* Light Theme: Toggle Button specific styles */
html[data-theme="light"] .header-theme-toggle-btn {
  background: #ffffff !important;
  border: 1.5px solid rgba(124, 58, 237, 0.45) !important;
  color: #7c3aed !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .header-theme-toggle-btn:hover {
  border: 1.5px solid rgba(124, 58, 237, 0.85) !important;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.35), inset 0 0 8px rgba(124, 58, 237, 0.15) !important;
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.95) 0%, rgba(245, 243, 255, 0.95) 100%) !important;
  color: #6d28d9 !important;
}

/* ==========================================================================
   WORKSPACES HUB LANDING PAGE (LIGHT THEME OVERRIDES)
   ========================================================================== */
html[data-theme="light"] .workspace-hub-header {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .workspace-hub-title {
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-hub-subtitle {
  color: #475569 !important;
}

html[data-theme="light"] .workspace-hub-totals-grid .workspace-hub-total-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .workspace-hub-totals-grid .workspace-hub-total-card:hover {
  border-color: rgba(6, 182, 212, 0.6) !important;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.15) !important;
}

html[data-theme="light"] .workspace-hub-total-icon {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .workspace-hub-total-value {
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-hub-total-label {
  color: #64748b !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .workspace-hub-toolbar {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .workspace-hub-search-box {
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
}

html[data-theme="light"] .workspace-hub-search-box:focus-within {
  border-color: #0284c7 !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.25) !important;
  background: #ffffff !important;
}

html[data-theme="light"] .hub-search-input {
  color: #0f172a !important;
}

html[data-theme="light"] .hub-search-input::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .hub-filter-label {
  color: #334155 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .hub-filter-select {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .hub-filter-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-hub-empty-state {
  background: #ffffff !important;
  border: 2px dashed #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .workspace-hub-empty-state h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-hub-empty-state p {
  color: #475569 !important;
}

html[data-theme="light"] .workspace-hub-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .workspace-hub-card:hover {
  border-color: rgba(6, 182, 212, 0.6) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 0 20px rgba(6, 182, 212, 0.15) !important;
}

html[data-theme="light"] .workspace-card-title {
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-card-desc {
  color: #475569 !important;
}

html[data-theme="light"] .workspace-card-role-snippet {
  background: #f8fafc !important;
  border-left: 3px solid #7c3aed !important;
  color: #6d28d9 !important;
}

html[data-theme="light"] .workspace-card-metrics-grid {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .workspace-card-metric-val {
  color: #0f172a !important;
}

html[data-theme="light"] .workspace-card-metric-lbl {
  color: #64748b !important;
}

/* ==========================================================================
   INSIGHT & STUDIO PANELS, CARDS, CHIPS (LIGHT THEME)
   ========================================================================== */
html[data-theme="light"] .glass-panel,
html[data-theme="light"] .panel,
html[data-theme="light"] .card,
html[data-theme="light"] .settings-card,
html[data-theme="light"] .setting-card,
html[data-theme="light"] .corpus-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .source-card,
html[data-theme="light"] .evidence-card,
html[data-theme="light"] .qa-left-panel,
html[data-theme="light"] .qa-center-panel,
html[data-theme="light"] .qa-right-panel,
html[data-theme="light"] .graph-wrapper,
html[data-theme="light"] .cy-container {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .panel-header,
html[data-theme="light"] .settings-card-header {
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .panel-title,
html[data-theme="light"] .settings-card-title {
  color: #0f172a !important;
}

html[data-theme="light"] .role-box-wrapper {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .role-textarea {
  color: #0f172a !important;
}

html[data-theme="light"] .query-input {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .query-input:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2) !important;
}

html[data-theme="light"] .query-input::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .btn-action-icon {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .btn-action-icon:hover {
  background: rgba(6, 182, 212, 0.15) !important;
  color: #0284c7 !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .action-status-text {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .chip {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

html[data-theme="light"] .chip:hover {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

/* History Items */
html[data-theme="light"] .history-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .history-item:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .history-item.active {
  background: rgba(2, 132, 199, 0.08) !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .history-query-text {
  color: #0f172a !important;
}

html[data-theme="light"] .history-time,
html[data-theme="light"] .history-metric,
html[data-theme="light"] .history-empty-state {
  color: #64748b !important;
}

/* Answer & Accordion */
html[data-theme="light"] .answer-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(6, 182, 212, 0.4) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .answer-body {
  color: #0f172a !important;
}

html[data-theme="light"] .answer-body code {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #0369a1 !important;
}

html[data-theme="light"] .answer-body strong,
html[data-theme="light"] .answer-body b,
html[data-theme="light"] .answer-body mark,
html[data-theme="light"] .highlight-keyword {
  color: #854d0e !important;
  background: rgba(254, 240, 138, 0.45) !important;
  border: 1px solid rgba(250, 204, 21, 0.6) !important;
}

html[data-theme="light"] .results-empty-state h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .results-empty-state p {
  color: #475569 !important;
}

html[data-theme="light"] .technical-accordion-header {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .technical-accordion-header:hover,
html[data-theme="light"] .technical-accordion-header.expanded {
  background: #f1f5f9 !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .technical-accordion-content {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .accordion-title {
  color: #0f172a !important;
}

html[data-theme="light"] .accordion-subtitle {
  color: #64748b !important;
}

html[data-theme="light"] .triple-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .node-pill {
  background: rgba(124, 58, 237, 0.1) !important;
  border: 1px solid #c084fc !important;
  color: #6b21a8 !important;
}

html[data-theme="light"] .triple-context {
  color: #64748b !important;
}

html[data-theme="light"] .chunk-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .chunk-header {
  color: #64748b !important;
}

html[data-theme="light"] .chunk-text {
  color: #0f172a !important;
}

/* ==========================================================================
   WORKSPACE TABS, INGESTION, GRAPH & SETTINGS
   ========================================================================== */
html[data-theme="light"] .main-nav-tabs {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .main-tab-btn {
  color: #475569 !important;
}

html[data-theme="light"] .main-tab-btn:hover {
  color: #0f172a !important;
  background: rgba(241, 245, 249, 0.8) !important;
}

html[data-theme="light"] .main-tab-btn.active,
html[data-theme="light"] .main-tab-btn.active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(99, 102, 241, 0.25) 50%, rgba(168, 85, 247, 0.25) 100%), #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(14, 165, 233, 0.95) !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35), inset 0 0 8px rgba(14, 165, 233, 0.12) !important;
}

html[data-theme="light"] .workspace-active-banner {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .doc-item {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .doc-item:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

html[data-theme="light"] .upload-dropzone {
  background: rgba(2, 132, 199, 0.03) !important;
  border-color: rgba(2, 132, 199, 0.3) !important;
}

html[data-theme="light"] .doc-search-input {
  background: #ffffff !important;
  border: 1.5px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .doc-card-compact {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .doc-card-compact:hover {
  background: #f8fafc !important;
}

html[data-theme="light"] .doc-table-container,
html[data-theme="light"] .matrix-table-wrap {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .doc-table th,
html[data-theme="light"] .matrix-table th {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

html[data-theme="light"] .doc-table td,
html[data-theme="light"] .matrix-table td {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .doc-table tbody tr:hover,
html[data-theme="light"] .matrix-table tbody tr:hover {
  background: rgba(2, 132, 199, 0.04) !important;
}

html[data-theme="light"] .visual-evidence-card,
html[data-theme="light"] .dependency-control-card,
html[data-theme="light"] .sidebar-metric-box,
html[data-theme="light"] .bench-card,
html[data-theme="light"] .evaluation-item,
html[data-theme="light"] .bench-result-item {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .dependency-guide-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

/* Settings & Providers */
html[data-theme="light"] .ai-provider-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .ai-provider-card:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
}

html[data-theme="light"] .provider-config-panel,
html[data-theme="light"] .matrix-panel,
html[data-theme="light"] .matrix-box,
html[data-theme="light"] .banner-box,
html[data-theme="light"] .live-bench-card,
html[data-theme="light"] .live-case-box,
html[data-theme="light"] .db-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .preset-chip-btn {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

/* Graph Explorer */
html[data-theme="light"] .graph-toolbar {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .graph-select-perspective,
html[data-theme="light"] .graph-select-sm {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .graph-inspector-drawer {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .inspector-header {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .inspector-desc-text {
  background: #f8fafc !important;
  color: #334155 !important;
}

html[data-theme="light"] .inspector-neighbor-item {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .graph-footer-bar {
  background: rgba(255, 255, 255, 0.9) !important;
  border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .custom-graph-box {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .cypher-code-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

/* Global Admin & Tables */
html[data-theme="light"] .admin-table-toolbar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

/* Global Admin & Tables */
html[data-theme="light"] .global-admin-header {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .global-admin-title {
  color: #0f172a !important;
}

html[data-theme="light"] .global-admin-subtitle {
  color: #475569 !important;
}

html[data-theme="light"] .admin-table-toolbar {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .toolbar-count-badge {
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .impersonation-actor-pill {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .table-matrix thead th {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

html[data-theme="light"] .table-matrix tbody tr:hover {
  background: rgba(2, 132, 199, 0.05) !important;
}

html[data-theme="light"] .table-matrix tbody td {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Light Theme Overrides for Inline Dark Styles */
html[data-theme="light"] .table-matrix [style*="color: #ffffff"],
html[data-theme="light"] .table-matrix [style*="color: #f1f5f9"],
html[data-theme="light"] .table-matrix [style*="color: #cbd5e1"],
html[data-theme="light"] .table-matrix [style*="color:#ffffff"],
html[data-theme="light"] .table-matrix [style*="color:#f1f5f9"],
html[data-theme="light"] .table-matrix [style*="color:#cbd5e1"] {
  color: #0f172a !important;
}

html[data-theme="light"] .table-matrix [style*="color: #94a3b8"],
html[data-theme="light"] .table-matrix [style*="color:#94a3b8"] {
  color: #64748b !important;
}

html[data-theme="light"] [style*="background: rgba(15, 23, 42"],
html[data-theme="light"] [style*="background:rgba(15, 23, 42"],
html[data-theme="light"] [style*="background: rgba(15,23,42"] {
  background: #ffffff !important;
  border-color: rgba(226, 232, 240, 0.95) !important;
  color: #0f172a !important;
}

html[data-theme="light"] [style*="background: #111827"],
html[data-theme="light"] [style*="background:#111827"] {
  background: #ffffff !important;
  color: #0f172a !important;
}

/* Forms & Modals */
html[data-theme="light"] .form-input,
html[data-theme="light"] .form-select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid #cbd5e1 !important;
}

html[data-theme="light"] .form-input:focus,
html[data-theme="light"] .form-select:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.25) !important;
  background: #ffffff !important;
}

html[data-theme="light"] .form-input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color: #94a3b8 !important;
}

html[data-theme="light"] .form-label {
  color: #334155 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

html[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .nav-tab-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .nav-tab-btn:hover {
  background: #ffffff !important;
  color: #0f172a !important;
}

html[data-theme="light"] .nav-tab-btn.active,
html[data-theme="light"] .nav-tab-btn.active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3) 0%, rgba(99, 102, 241, 0.3) 50%, rgba(168, 85, 247, 0.3) 100%), #ffffff !important;
  color: #0f172a !important;
  border: 1.5px solid rgba(14, 165, 233, 0.95) !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.35), inset 0 0 8px rgba(14, 165, 233, 0.12) !important;
}

html[data-theme="light"] .modal-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 24px rgba(6, 182, 212, 0.25) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.45) !important;
}

html[data-theme="light"] .app-footer-thin {
  background: rgba(255, 255, 255, 0.92) !important;
  border-top: 1px solid rgba(226, 232, 240, 0.95) !important;
  color: #64748b !important;
}

html[data-theme="light"] .footer-copyright,
html[data-theme="light"] .footer-version,
html[data-theme="light"] .footer-build {
  color: #64748b !important;
}

html[data-theme="light"] .footer-persona-text {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  color: #334155 !important;
}

html[data-theme="light"] .access-restricted-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(239, 68, 68, 0.65) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .access-restricted-card h2 {
  color: #0f172a !important;
}

/* Auth & Login */
html[data-theme="light"] .auth-layout-root {
  background-color: #f8fafc !important;
  background-image:
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 55%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.07) 0px, transparent 55%) !important;
}

html[data-theme="light"] .login-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06) !important;
}

html[data-theme="light"] .login-title {
  background: linear-gradient(to right, #0f172a, #334155) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

html[data-theme="light"] .login-subtitle {
  color: #64748b !important;
}

/* ==========================================================================
   SEMANTIC REUSABLE COMPONENT CLASSES (BASE / DARK THEME)
   ========================================================================== */

.access-restricted-card {
  margin: 3rem auto;
  max-width: 620px;
  text-align: center;
  padding: 2.5rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1.5px solid rgba(239, 68, 68, 0.65);
  border-radius: 16px;
  box-shadow: 0 0 24px rgba(239, 68, 68, 0.3);
}

.access-restricted-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.access-restricted-title {
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.access-restricted-desc {
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
}

.access-restricted-meta {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.zitadel-percolation-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 10px;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.zitadel-percolation-title {
  color: #38bdf8;
}

.zitadel-percolation-row {
  color: #cbd5e1;
}

.zitadel-percolation-item {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.zitadel-percolation-val {
  color: #f8fafc;
}

.text-tier-admin {
  color: #22d3ee;
}

.text-tier-org {
  color: #a855f7;
}

.text-tier-member {
  color: #34d399;
}

.table-item-title {
  font-weight: 600;
  color: #f8fafc;
}

.table-item-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
}

.table-item-sub {
  font-size: 0.75rem;
  color: #94a3b8;
}

.modal-subpanel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.modal-scroll-panel {
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.secret-reveal-box {
  position: relative;
  background: rgba(15, 23, 42, 0.9);
  border: 1.5px solid rgba(34, 211, 238, 0.85);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18);
  border-radius: 8px;
  padding: 1rem;
}

.log-trace-cell {
  background: rgba(15, 23, 42, 0.95);
  padding: 1rem;
}

.impersonation-notice-box {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #38bdf8;
  border-radius: 6px;
  color: #38bdf8;
}

.empty-state-title {
  font-weight: 600;
  color: #f8fafc;
}

.empty-state-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  max-width: 500px;
  margin: 0.25rem auto 1rem auto;
}

.evaluation-breakdown-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}

.evaluation-case-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

.evaluation-answer-row {
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   LIGHT THEME OVERRIDES FOR EXTENDED COMPONENTS
   ========================================================================== */

/* Zitadel Percolation Card */
html[data-theme="light"] .zitadel-percolation-card {
  background: #f8fafc !important;
  border: 1.5px solid rgba(14, 165, 233, 0.35) !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.08) !important;
}

html[data-theme="light"] .zitadel-percolation-title {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .zitadel-percolation-row {
  color: #334155 !important;
}

html[data-theme="light"] .zitadel-percolation-item {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .zitadel-percolation-val {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .text-tier-admin {
  color: #0891b2 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .text-tier-org {
  color: #9333ea !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .text-tier-member {
  color: #059669 !important;
  font-weight: 700 !important;
}

/* GPU Guide & Matrix Card */
html[data-theme="light"] .matrix-card {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .matrix-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .matrix-desc {
  color: #475569 !important;
}

html[data-theme="light"] .table-subtext {
  color: #64748b !important;
}

html[data-theme="light"] .matrix-table-wrap {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .matrix-table th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-weight: 700 !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.9) !important;
}

html[data-theme="light"] .matrix-table td {
  color: #1e293b !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

html[data-theme="light"] .matrix-table tbody tr:hover {
  background: rgba(241, 245, 249, 0.75) !important;
}

/* Table Item Titles, Descriptions & Subs */
html[data-theme="light"] .table-item-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .table-item-desc {
  color: #334155 !important;
}

html[data-theme="light"] .table-item-sub {
  color: #64748b !important;
}

/* Modals & Subpanels */
html[data-theme="light"] .modal-subpanel {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .modal-scroll-panel {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  color: #1e293b !important;
}

html[data-theme="light"] .secret-reveal-box {
  background: #f8fafc !important;
  border: 1.5px solid rgba(14, 165, 233, 0.85) !important;
  box-shadow: 0 0 16px rgba(14, 165, 233, 0.2), inset 0 0 8px rgba(14, 165, 233, 0.06) !important;
}

html[data-theme="light"] .log-trace-cell {
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .impersonation-notice-box {
  background: #f0f9ff !important;
  border: 1px solid #7dd3fc !important;
  color: #0369a1 !important;
}

/* Empty states */
html[data-theme="light"] .empty-state-notice {
  background: #f8fafc !important;
  border: 1px dashed rgba(203, 213, 225, 0.9) !important;
}

html[data-theme="light"] .empty-state-title {
  color: #0f172a !important;
}

html[data-theme="light"] .empty-state-desc {
  color: #64748b !important;
}

/* Access Restricted Card */
html[data-theme="light"] .access-restricted-card {
  background: #ffffff !important;
  border: 1.5px solid rgba(239, 68, 68, 0.65) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .access-restricted-title {
  color: #0f172a !important;
}

html[data-theme="light"] .access-restricted-desc {
  color: #475569 !important;
}

html[data-theme="light"] .access-restricted-meta {
  color: #64748b !important;
}

/* General safety for white text in light mode */
html[data-theme="light"] .text-white:not(.badge):not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-warning):not(.btn-accent):not(.btn-success),
html[data-theme="light"] h1.text-white,
html[data-theme="light"] h2.text-white,
html[data-theme="light"] h3.text-white,
html[data-theme="light"] h4.text-white,
html[data-theme="light"] p.text-white,
html[data-theme="light"] span.text-white:not(.badge),
html[data-theme="light"] div.text-white:not(.badge) {
  color: #0f172a !important;
}

html[data-theme="light"] [style*="color: #ffffff"]:not(.btn):not(.badge),
html[data-theme="light"] [style*="color: #f8fafc"]:not(.btn):not(.badge),
html[data-theme="light"] [style*="color: white"]:not(.btn):not(.badge),
html[data-theme="light"] [style*="color: #fff;"]:not(.btn):not(.badge),
html[data-theme="light"] [style*="color:#fff"]:not(.btn):not(.badge),
html[data-theme="light"] [style*="color: #fff "]:not(.btn):not(.badge) {
  color: #0f172a !important;
}

/* Thumbnail Visual Identity & Upload Card */
html[data-theme="light"] .thumb-upload-card {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

html[data-theme="light"] .thumb-upload-card h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .thumb-preview-box {
  background: #f1f5f9 !important;
  border: 2px solid rgba(14, 165, 233, 0.8) !important;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.15) !important;
}

html[data-theme="light"] .header-red-box-thumb,
html[data-theme="light"] .workspace-header-thumb,
html[data-theme="light"] .workspace-card-thumb-small {
  background: #f1f5f9 !important;
}

/* Evaluation Items & Benchmark Breakdown */
html[data-theme="light"] .evaluation-breakdown-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .evaluation-case-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] .evaluation-answer-row {
  color: #1e293b !important;
}

html[data-theme="light"] .bench-empty-state {
  background: #f8fafc !important;
  border: 1px dashed rgba(203, 213, 225, 0.9) !important;
  color: #64748b !important;
}

html[data-theme="light"] .progress-track {
  background: #e2e8f0 !important;
}

/* Dangerous Operations Log */
html[data-theme="light"] .danger-step-log {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  color: #0284c7 !important;
}

/* Visual Evidence, Lightbox & Modals */
html[data-theme="light"] .result-inline-image-wrap {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

html[data-theme="light"] .result-inline-img {
  background: #f1f5f9 !important;
}

html[data-theme="light"] .image-caption {
  background: #f8fafc !important;
  color: #475569 !important;
  border-top: 1px solid rgba(226, 232, 240, 0.95) !important;
}

html[data-theme="light"] .img-thumbnail-wrap {
  background: #f1f5f9 !important;
}

html[data-theme="light"] .lightbox-content {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .lightbox-header {
  background: #f8fafc !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .timeout-counter-box {
  background: #f8fafc !important;
  border: 1.5px solid rgba(239, 68, 68, 0.5) !important;
}

html[data-theme="light"] .impersonation-security-card {
  background: #f8fafc !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
}








