/* ============================================================
   Simporter Dashboard — Shared Styles
   Design: Liquid Glass (Apple WWDC 2025 aesthetic)
   Font: Plus Jakarta Sans (Google Fonts)
   Brand: Simporter blue #1A52CC / #2563EB
   ============================================================ */

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

/* ── Design tokens ── */
:root {
  --blue-900: #0B2463;
  --blue-800: #0F3490;
  --blue-700: #1A52CC;
  --blue-600: #2563EB;
  --blue-100: #E0EAFF;
  --blue-50: #F0F5FF;

  --text-1: #0F172A;
  --text-2: #475569;
  --text-3: #94A3B8;

  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-shadow: 0 4px 32px rgba(26, 82, 204, 0.08), 0 1px 4px rgba(15, 23, 42, 0.06);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;
}

/* ── Base ── */
html,
body {
  min-height: 100vh;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
  background-color: #E8EEF8;
  background-image:
    radial-gradient(ellipse 900px 600px at 15% 10%, rgba(26, 82, 204, 0.13) 0%, transparent 70%),
    radial-gradient(ellipse 600px 500px at 85% 80%, rgba(26, 82, 204, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 350px at 60% 20%, rgba(249, 115, 22, 0.05) 0%, transparent 60%);
}

/* ── App layout ── */
.layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: rgba(240, 245, 255, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.85);
  padding: 28px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 28px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, #2563EB 0%, #1A3FC4 60%, #0F2A9E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(26, 82, 204, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.logo-mark svg {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(26, 82, 204, 0.06);
  color: var(--text-1);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(26, 82, 204, 0.12) 0%, rgba(37, 99, 235, 0.08) 100%);
  color: var(--blue-700);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-700), #4F46E5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.avatar-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
}

.avatar-role {
  font-size: 11px;
  color: var(--text-3);
}

/* ============================================================
   MAIN / PAGES
   ============================================================ */
.main {
  padding: 32px 36px;
  overflow: auto;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.18s ease;
}

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

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Top bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-1);
}

.page-title span {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 2px;
}

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

/* ── Glass select (Country / Category dropdowns) ── */
.glass-select {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  transition: all 0.2s ease;
}

.glass-select:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-1);
}

.glass-select svg {
  width: 14px;
  height: 14px;
  color: var(--text-3);
}

.glass-select-input {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  min-width: 120px;
  cursor: pointer;
}

.glass-select-input:disabled {
  opacity: 1;
  color: inherit;
  -webkit-text-fill-color: inherit;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   TAB BAR  (full-width, integrated card top)
   ============================================================ */
.tab-bar {
  display: flex;
  margin-bottom: -14px;
  position: relative;
  z-index: 0;
}
.tab-item {
  position: relative;
  padding: 8px 60px 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  background: rgba(226, 232, 240, 0.35);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-bottom: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.tab-item:first-child {
  border-radius: var(--radius-lg) var(--radius-sm) 0 0;
}
.tab-item:last-child {
  border-radius: var(--radius-sm) var(--radius-lg) 0 0;
}
.tab-item:not(:first-child):not(:last-child) {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-item:not(:first-child) {
  border-left: none;
}
.tab-item span {
  position: relative;
  z-index: 1;
}
.tab-item:hover {
  color: var(--text-1);
  background: rgba(226, 232, 240, 0.55);
}
.tab-item.active {
  color: var(--blue-700);
  font-weight: 600;
  background: var(--glass-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.table-card--tabbed {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: 1px solid rgba(148, 163, 184, 0.10);
}

/* Coming soon placeholder */
.coming-soon {
  padding: 80px 40px;
  text-align: center;
}
.coming-soon svg {
  opacity: 0.25;
  color: var(--blue-700);
  margin-bottom: 16px;
}
.coming-soon-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.coming-soon-desc {
  font-size: 13px;
  color: var(--text-3);
}

/* ── Reports list ── */
.reports-container {
  padding: 16px 20px;
}
.report-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
@keyframes reportFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.report-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: reportFadeIn 0.35s ease both;
}
.report-item:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(26, 82, 204, 0.15);
  box-shadow: 0 4px 16px rgba(26, 82, 204, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}
.report-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(26, 82, 204, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}
.report-icon svg {
  width: 15px;
  height: 15px;
  color: var(--blue-700);
}
.report-name {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
}
.report-badge-new {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--blue-100);
  color: var(--blue-700);
  letter-spacing: 0.02em;
}
.report-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.report-open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-700);
  background: var(--blue-50);
  transition: background 0.15s, color 0.15s;
}
.report-item:hover .report-open {
  background: var(--blue-100);
  color: var(--blue-800);
}
.report-open svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* ============================================================
   TABLE CARD
   ============================================================ */
.table-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  overflow: visible;
  position: relative;
}

.table-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(255, 255, 255, 0) 100%);
  z-index: 1;
}

/* ── Toolbar ── */
.table-toolbar {
  position: relative;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  flex-wrap: wrap;
}

/* ── Filter pills (liquid glass) ── */
.filter-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.filter-pill:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.filter-pill svg {
  width: 13px;
  height: 13px;
}

.filter-pill.active {
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(26, 82, 204, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.filter-pill.date-active,
.filter-pill.filter-dark {
  background: rgba(26, 82, 204, 0.12);
  border-color: rgba(255, 255, 255, 0.8);
  color: var(--blue-700);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(26, 82, 204, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.filter-dropdown {
  min-width: 140px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  font-family: inherit;
}

.filter-multilevel {
  position: relative;
  padding: 0;
  overflow: visible;
}

.filter-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 7px 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
}

.filter-trigger-label {
  pointer-events: none;
}

.filter-trigger-chevron {
  width: 13px;
  height: 13px;
  color: var(--text-3);
  transition: transform 0.2s ease;
}

.filter-multilevel.open .filter-trigger-chevron {
  transform: rotate(180deg);
}

.filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 250px;
  background: #FFFFFF;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 10px;
}

.filter-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.filter-menu-actions button {
  border: none;
  background: transparent;
  color: var(--blue-700);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s ease;
}

.filter-menu-actions button:hover {
  text-decoration: underline;
}

.filter-options {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.filter-menu-footer {
  display: flex; gap: 8px; padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12); margin-top: 8px;
}
.filter-cancel-btn, .filter-apply-btn {
  flex: 1; padding: 8px 0; border: none; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.2s ease;
}
.filter-cancel-btn {
  background: rgba(241, 245, 249, 0.7); color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.filter-cancel-btn:hover {
  background: rgba(226, 232, 240, 0.85); color: var(--text-1);
}
.filter-apply-btn {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(26, 82, 204, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.filter-apply-btn:hover {
  background: linear-gradient(135deg, var(--blue-600) 0%, #3B82F6 100%);
  box-shadow: 0 4px 14px rgba(26, 82, 204, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.filter-apply-btn:disabled {
  opacity: 0.35; cursor: not-allowed;
  box-shadow: none;
}

.filter-reset-btn {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.15s ease;
}
.filter-reset-btn:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.filter-group:hover {
  background: rgba(26, 82, 204, 0.05);
}
.filter-group.filter-disabled {
  opacity: 0.35;
  pointer-events: none;
}
.filter-group.filter-disabled label {
  color: var(--text-3);
}

.group-spacer {
  width: 16px;
  flex-shrink: 0;
}

.group-toggle {
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.group-toggle svg {
  width: 11px;
  height: 11px;
  transition: transform 0.15s ease;
}

.group-toggle[aria-expanded="false"] svg {
  transform: rotate(-90deg);
}

.filter-group input[type="checkbox"] {
  width: 15px; height: 15px; margin: 0; flex-shrink: 0;
  accent-color: var(--blue-700); cursor: pointer;
}

.filter-group label,
.filter-children label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.filter-group:hover label {
  color: var(--text-1);
}

.filter-group label {
  font-weight: 600;
  color: var(--text-1);
}

.filter-group.no-children label {
  font-weight: 500;
  color: var(--text-2);
}
.filter-group label.is-child {
  padding-left: 18px;
  font-weight: 400;
}

.filter-children {
  padding: 0 0 6px 32px;
  display: grid;
  gap: 6px;
}

.filter-children label {
  font-weight: 500;
}

.filter-children[hidden] {
  display: none;
}

/* Per-dropdown sizing tuned to content lengths */
.filter-multilevel[data-filter-name="Product"] .filter-menu {
  min-width: 300px;
}

.filter-multilevel[data-filter-name="Vertical"] .filter-menu {
  min-width: 280px;
}

.filter-multilevel[data-filter-name="Persona"] .filter-menu {
  min-width: 280px;
}

.filter-multilevel[data-filter-name="Areas"] .filter-menu {
  min-width: 330px;
}

.filter-multilevel[data-filter-name="Topic"] .filter-menu {
  min-width: 440px;
}

.filter-multilevel[data-filter-name="Sub-topics"] .filter-menu {
  min-width: 220px;
}

.filter-multilevel.has-selection {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(26, 82, 204, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1);
}

.filter-multilevel.date-active .filter-trigger,
.filter-multilevel.filter-dark .filter-trigger {
  color: var(--blue-700);
  font-weight: 600;
}

.filter-single .filter-menu {
  min-width: 160px;
}

.filter-single-options {
  display: grid;
  gap: 4px;
}

.filter-single-option {
  border: none;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--text-1);
  text-align: left;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-single-option:hover {
  background: rgba(26, 82, 204, 0.06);
}

.filter-single-option.active {
  background: rgba(26, 82, 204, 0.12);
  color: var(--blue-700);
}

.filter-single-option.is-child {
  padding-left: 24px;
  color: var(--text-2);
}

/* ── Search ── */
.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  border-radius: var(--radius-pill);
}

.search-pill svg {
  width: 13px;
  height: 13px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search-pill input {
  border: none;
  background: none;
  outline: none;
  font-size: 12.5px;
  color: var(--text-1);
  font-family: inherit;
  width: 100%;
}

.search-pill input::placeholder {
  color: var(--text-3);
}

/* ── Icon / export buttons (liquid glass circles) ── */
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-2);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-1);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

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

.metrics-control {
  position: relative;
}

.metrics-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 260px;
  background: #FFFFFF;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
  padding: 10px;
}

.metrics-menu-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 8px;
}

.metrics-menu-actions button {
  border: none;
  background: transparent;
  color: var(--blue-700);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.metrics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.metrics-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
}

.metrics-item:hover {
  background: rgba(26, 82, 204, 0.05);
}

.metrics-item-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.metrics-item-main label {
  font-size: 13px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.metrics-drag {
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.metrics-item.dragging {
  opacity: 0.55;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(26, 82, 204, 0.55);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: white;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(26, 82, 204, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: rgba(26, 82, 204, 0.72);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(26, 82, 204, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.download-btn svg {
  width: 15px;
  height: 15px;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
}

.table-scroll {
  overflow-x: scroll;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-scroll table {
  width: max-content;
  min-width: 100%;
}

.table-scroll::-webkit-scrollbar {
  height: 10px;
}

.table-scroll::-webkit-scrollbar-track {
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.7);
  border-radius: 999px;
}

thead tr {
  background: rgba(240, 245, 255, 0.5);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

th:hover {
  color: var(--text-2);
}

th.sorted {
  color: var(--blue-700);
}

td {
  padding: 13px 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  white-space: nowrap;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover,
tbody tr.cell-hover {
  background: rgba(26, 82, 204, 0.025);
}

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

.name-cell {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.1px;
}

/* ── Text columns: truncation, hover-copy, tooltip ── */
td.col-text {
  max-width: 400px;
}

.cell-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#cell-copy-btn {
  position: fixed;
  z-index: 9991;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0.45;
  transition: color 0.12s, opacity 0.12s;
}

#cell-copy-btn:hover {
  color: var(--blue-700, #2563eb);
  opacity: 1;
}

#cell-copy-btn:focus-visible {
  opacity: 1;
  outline: 2px solid var(--blue-600, #2563eb);
  outline-offset: 1px;
  border-radius: 3px;
}

#cell-copy-btn[hidden] {
  display: none !important;
}

#cell-copy-btn svg {
  pointer-events: none;
}

#cell-tooltip {
  position: fixed;
  z-index: 9990;
  max-width: min(320px, calc(100vw - 24px));
  max-height: min(40vh, 280px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  color: var(--text-1, #0f172a);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.10),
    0 1px 2px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
}

#cell-tooltip[hidden] {
  display: none !important;
}

/* ── Badges (dot + number) — kept for potential future use ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 4px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  background: none;
  border: none;
  color: var(--text-1);
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.badge-vh::before {
  background: #DC2626;
}

.badge-h::before {
  background: #FB923C
  /* background: #EA580C; */
}

.badge-m::before {
  background: #FDE047;
}

.badge-l::before {
  background: #22C55E;
}

.badge-vl::before {
  background: #15803D;
}
.badge-na::before {
  background: #94A3B8;
}

/* ── SOV bar ── */
.sov-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 80px;
}

.sov-bar-track {
  height: 4px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 2px;
  overflow: hidden;
}

.sov-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-600));
}

.sov-bar-fill.orange {
  background: linear-gradient(90deg, #F97316, #FB923C);
}

.sov-bar-fill.amber {
  background: linear-gradient(90deg, #D97706, #F59E0B);
}

.sov-bar-fill.green {
  background: linear-gradient(90deg, #16A34A, #22C55E);
}

.sov-bar-fill.red {
  background: linear-gradient(90deg, #DC2626, #EF4444);
}

/* ── Pagination ── */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.row-count {
  font-size: 12px;
  color: var(--text-3);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.15s;
}

.page-btn:hover {
  background: rgba(26, 82, 204, 0.07);
  color: var(--blue-700);
}

.page-btn.active {
  background: var(--blue-700);
  color: white;
  border-color: var(--blue-700);
}

.page-btn svg {
  width: 13px;
  height: 13px;
}

.page-btn.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   RESOURCES PAGE
   ============================================================ */
.resources-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}

.resources-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.55);
  border: none;
  border-radius: var(--radius-pill);
  width: 100%;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  margin-bottom: 24px;
}

.resources-search svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
  flex-shrink: 0;
}

.resources-search input {
  border: none;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--text-1);
  font-family: inherit;
  width: 100%;
}

.resources-search input::placeholder {
  color: var(--text-3);
}

/* Doc tree nav */
.doc-nav {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  overflow: hidden;
  position: sticky;
  top: 0;
}

.doc-nav::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(255, 255, 255, 0) 100%);
}

.doc-nav-inner {
  padding: 12px 8px;
  position: relative;
}

.tree-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.tree-header:hover {
  background: rgba(26, 82, 204, 0.05);
  color: var(--text-1);
}

.tree-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform 0.2s ease;
}

.tree-header.open .tree-chevron {
  transform: rotate(90deg);
  color: var(--text-2);
}

.tree-children {
  display: none;
  padding-left: 22px;
  margin-top: 2px;
}

.tree-children.visible {
  display: block;
}

.tree-subheader {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  background: rgba(26, 82, 204, 0.06);
  margin-bottom: 2px;
}

.tree-subheader .tree-chevron {
  transform: rotate(90deg);
  color: var(--text-2);
}

.tree-link {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
}

.tree-link:hover {
  background: rgba(26, 82, 204, 0.05);
  color: var(--text-1);
}

.tree-link.active {
  color: var(--blue-700);
  font-weight: 500;
  background: rgba(26, 82, 204, 0.07);
}

.tree-divider {
  height: 1px;
  background: rgba(148, 163, 184, 0.12);
  margin: 6px 12px;
}

/* Doc content panel */
.doc-content {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  overflow: hidden;
  position: relative;
}

.doc-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(255, 255, 255, 0) 100%);
  z-index: 1;
}

.doc-content-inner {
  padding: 36px 40px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--blue-700);
}

.breadcrumb .crumb-sep {
  font-size: 11px;
}

.breadcrumb .crumb-current {
  color: var(--text-1);
  font-weight: 500;
}

.doc-h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.4px;
  color: var(--text-1);
  margin-bottom: 8px;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.doc-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.doc-meta svg {
  width: 13px;
  height: 13px;
}

.contact-card {
  background: rgba(240, 245, 255, 0.6);
  border: 1px solid rgba(26, 82, 204, 0.1);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  background: rgba(26, 82, 204, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 17px;
  height: 17px;
  color: var(--blue-700);
}

.contact-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 6px;
}

.contact-emails {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-emails a {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-700);
  text-decoration: none;
  transition: opacity 0.15s;
}

.contact-emails a:hover {
  opacity: 0.75;
}

.doc-section-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}

.article-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 32px;
}

.article-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.article-link:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(26, 82, 204, 0.15);
  box-shadow: 0 4px 16px rgba(26, 82, 204, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-1px);
}

.article-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  background: rgba(26, 82, 204, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-link-icon svg {
  width: 15px;
  height: 15px;
  color: var(--blue-700);
}

.article-link-text {
  flex: 1;
  min-width: 0;
}

.article-link-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  margin-bottom: 2px;
}

.article-link-desc {
  font-size: 12px;
  color: var(--text-3);
}

.article-link-arrow {
  color: var(--text-3);
  transition: transform 0.2s, color 0.2s;
}

.article-link:hover .article-link-arrow {
  transform: translateX(3px);
  color: var(--blue-700);
}

.article-link-arrow svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   STATS PANEL & REFRESH
   ============================================================ */
.stats-section {
  margin-bottom: 24px;
}

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

.stats-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.98) 50%, rgba(255, 255, 255, 0) 100%);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: -0.5px;
}

.stat-value-sm {
  font-size: 14px;
  letter-spacing: -0.2px;
  line-height: 1.4;
}

/* Refresh button */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.refresh-btn svg {
  width: 14px;
  height: 14px;
}

/* ============================================================
   LOADING INDICATORS
   ============================================================ */
.htmx-indicator {
  display: none;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-flex;
}

.spinner {
  width: 14px;
  height: 14px;
  animation: spin 0.8s linear infinite;
}

/* Table overlay — dims + spinner while HTMX replaces content */
#table-wrapper {
  position: relative;
}
#table-wrapper.htmx-request::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  pointer-events: all;
}
#table-wrapper.htmx-request::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Card body — centered spinner during tab switches */
#card-body {
  position: relative;
  min-height: 120px;
  min-width: 0;
}
#card-body.htmx-request::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: all;
}
#card-body.htmx-request::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 11;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Export button loading state */
.download-btn.is-loading {
  pointer-events: none;
  opacity: 0.65;
}
.download-btn.is-loading svg {
  display: none;
}
.download-btn.is-loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Dependent filter — subtle pulse while options are fetched */
.filter-pill.is-refreshing .filter-trigger-label {
  animation: filterPulse 1s ease-in-out infinite;
}
@keyframes filterPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   DIALOG (reusable modal)
   ============================================================ */
.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: dialogFadeIn 0.15s ease;
}
.dialog-overlay.dialog-closing {
  animation: dialogFadeOut 0.15s ease forwards;
}
.dialog {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
  padding: 28px 32px 24px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  animation: dialogSlideIn 0.15s ease;
}
.dialog-closing .dialog {
  animation: dialogSlideOut 0.15s ease forwards;
}
.dialog-icon {
  margin-bottom: 12px;
}
.dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}
.dialog-message {
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 20px;
}
.dialog-actions {
  display: flex;
  gap: 8px;
}
.dialog-cancel,
.dialog-confirm {
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dialog-cancel {
  background: rgba(241, 245, 249, 0.7);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.dialog-cancel:hover {
  background: rgba(226, 232, 240, 0.85);
  color: var(--text-1);
}
.dialog-confirm--info {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-600) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(26, 82, 204, 0.3);
}
.dialog-confirm--info:hover {
  box-shadow: 0 4px 14px rgba(26, 82, 204, 0.4);
}
.dialog-confirm--warning {
  background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}
.dialog-confirm--warning:hover {
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}
.dialog-confirm--danger {
  background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}
.dialog-confirm--danger:hover {
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

@keyframes dialogFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialogFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes dialogSlideIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes dialogSlideOut { from { opacity: 1; transform: scale(1) translateY(0); } to { opacity: 0; transform: scale(0.95) translateY(8px); } }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: 0 6px 28px rgba(15, 23, 42, 0.14), 0 1px 4px rgba(15, 23, 42, 0.06);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-1);
  max-width: 380px;
  animation: toastIn 0.25s ease;
  border-left: 3px solid;
}
.toast.toast-exit {
  animation: toastOut 0.2s ease forwards;
}
.toast--error {
  border-left-color: #DC2626;
}
.toast--error .toast-icon { color: #DC2626; }
.toast--warning {
  border-left-color: #D97706;
}
.toast--warning .toast-icon { color: #D97706; }
.toast--success {
  border-left-color: #16A34A;
}
.toast--success .toast-icon { color: #16A34A; }

.toast-icon {
  flex-shrink: 0;
  display: flex;
}
.toast-message {
  flex: 1;
  line-height: 1.4;
}
.toast-close {
  flex-shrink: 0;
  border: none;
  background: none;
  font-size: 18px;
  color: var(--text-3);
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
  font-family: inherit;
}
.toast-close:hover {
  color: var(--text-1);
}

@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   SHARED FILTERS — Tab-based visibility
   ============================================================ */

#shared-filters.active-tab-needs .filter-pill:not(.tab-needs) { display: none; }
#shared-filters.active-tab-topics .filter-pill:not(.tab-topics) { display: none; }
#shared-filters.active-tab-deepdive .filter-pill:not(.tab-deepdive) { display: none; }

#filtered-content .table-toolbar {
  z-index: 10;
}

#shared-filters {
  z-index: 20;
}

/* ============================================================
   DEEP DIVE — Review Cards
   ============================================================ */

#reviews-wrapper {
  min-width: 0;
  overflow: hidden;
}

.review-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px;
}
@media (max-width: 860px) {
  .review-list {
    grid-template-columns: 1fr;
  }
}

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

.review-card {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: reviewFadeIn 0.35s ease both;
}
.review-card:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(26, 82, 204, 0.12);
  box-shadow: 0 4px 16px rgba(26, 82, 204, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* ── Header: stars + title ── */
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.review-stars {
  display: inline-flex;
  gap: 2px;
  flex-shrink: 0;
}
.review-stars svg {
  width: 15px;
  height: 15px;
}
.review-stars .star-filled {
  fill: #F59E0B;
  stroke: #F59E0B;
  stroke-width: 1;
}
.review-stars .star-empty {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.5;
}

.review-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ── Body: clamped text ── */
.review-body {
  flex: 1;
  margin-bottom: 12px;
}

.review-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}
.review-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.review-text.expanded {
  -webkit-line-clamp: unset;
  display: block;
}

.review-toggle {
  border: none;
  background: none;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0 0;
  font-family: inherit;
}
.review-toggle:hover {
  color: var(--blue-800);
  text-decoration: underline;
}

/* ── Footer: metadata row ── */
.review-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.review-meta-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-3);
  min-width: 0;
}
.review-meta-row > span:not(:last-child)::after {
  content: "·";
  margin: 0 8px;
  color: var(--text-3);
  opacity: 0.5;
}

.review-username {
  font-weight: 500;
  color: var(--text-2);
}

.review-source {}

.review-engagement {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.review-engagement::after {
  content: none !important;
}
.review-stat {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}
.review-stat:not(:last-child)::after {
  content: none;
}

.review-open {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--blue-700);
  background: var(--blue-50);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.review-card:hover .review-open {
  background: var(--blue-100);
  color: var(--blue-800);
}
.review-open svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}