/* ================================================================
   RETAIL INTELLIGENCE — Premium Dashboard 2026
   ================================================================ */

/* ---- CSS Custom Properties ---- */
:root {
  --bg: #0a0e1a;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --bg-surface: #0f1629;
  --bg-sidebar: #0d1117;
  --border: #1e293b;
  --border-light: #334155;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-dark: #4f46e5;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --accent-glow-strong: rgba(99, 102, 241, 0.3);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --purple: #a78bfa;
  --purple-bg: rgba(167, 139, 250, 0.12);
  --cyan: #22d3ee;
  --cyan-bg: rgba(34, 211, 238, 0.12);
  --orange: #fb923c;
  --orange-bg: rgba(251, 146, 60, 0.12);
  --pink: #f472b6;
  --pink-bg: rgba(244, 114, 182, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 8px 32px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.08);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-w: 260px;
}

/* Light theme */
[data-theme='light'] {
  --bg: #f0f2f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #f8fafc;
  --bg-sidebar: #ffffff;
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-glow: rgba(99, 102, 241, 0.08);
  --accent-glow-strong: rgba(99, 102, 241, 0.15);
  --success-bg: rgba(16, 185, 129, 0.08);
  --warning-bg: rgba(245, 158, 11, 0.08);
  --danger-bg: rgba(239, 68, 68, 0.08);
  --purple-bg: rgba(167, 139, 250, 0.08);
  --cyan-bg: rgba(34, 211, 238, 0.08);
  --orange-bg: rgba(251, 146, 60, 0.08);
  --pink-bg: rgba(244, 114, 182, 0.08);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.06);
  --shadow-glow: none;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ================================================================
   LOGIN
   ================================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.login-bg-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(168, 85, 247, 0.12), transparent),
    radial-gradient(ellipse 40% 30% at 20% 80%, rgba(34, 211, 238, 0.08), transparent);
}
.login-card {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
  width: 400px;
  box-shadow:
    var(--shadow-lg),
    0 0 80px rgba(99, 102, 241, 0.06);
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  font-size: 24px;
  color: #fff;
}
.login-card h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.login-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}
.login-field {
  margin-bottom: 18px;
}
.login-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.login-field input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.login-field input::placeholder {
  color: var(--text-muted);
}
.login-error {
  color: var(--danger);
  font-size: 12px;
  min-height: 18px;
  margin-bottom: 6px;
}
.login-btn {
  width: 100%;
  padding: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition:
    transform 0.15s,
    box-shadow var(--transition);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.4);
}
.login-btn:active {
  transform: scale(0.98);
}

/* ================================================================
   APP SHELL — Sidebar + Main
   ================================================================ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition:
    width var(--transition),
    transform var(--transition);
  overflow: hidden;
  z-index: 50;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo-ring {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent-light), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}
.sidebar-link:hover {
  color: var(--text);
  background: var(--bg-card-hover);
}
.sidebar-link.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}
.sl-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.sl-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sidebar bottom */
.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-client-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.sidebar-client-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.sidebar-client-select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
}
.sidebar-client-select:focus {
  outline: none;
  border-color: var(--accent);
}

.sidebar-quick-stats {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: none;
}
.sidebar-quick-stats.has-data {
  display: block;
}
.sqs-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sqs-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.sqs-label {
  font-size: 11px;
  color: var(--text-secondary);
}
.sqs-val {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
}

.sidebar-user-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px;
}
.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-meta {
  display: flex;
  flex-direction: column;
}
.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
}
.sidebar-user-role {
  font-size: 10px;
  color: var(--text-muted);
}
.sidebar-user-actions {
  display: flex;
  gap: 4px;
}
.sidebar-action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  line-height: 1;
}
.sidebar-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
}

/* ---- Main Area ---- */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bc-item {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.bc-sep {
  font-size: 11px;
  color: var(--text-muted);
}
.bc-current {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Filter chips */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.filter-chip .chip-x {
  font-size: 10px;
  opacity: 0.7;
}
.filter-dropdown {
  padding: 5px 28px 5px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}
.filter-dropdown:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- View container ---- */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 48px;
}
.view {
  animation: viewFadeIn 0.35s ease;
}

/* ================================================================
   WELCOME VIEW
   ================================================================ */
.welcome-hero {
  text-align: center;
  padding: 48px 32px 40px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.08) 0%,
    rgba(168, 85, 247, 0.06) 50%,
    rgba(34, 211, 238, 0.04) 100%
  );
  border: 1px solid var(--border);
  border-radius: 20px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.welcome-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.06), transparent 70%);
  pointer-events: none;
}
.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--accent-glow);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}
.welcome-title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 12px;
}
.welcome-title .accent-grad {
  background: linear-gradient(135deg, var(--accent-light), var(--purple), var(--cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.welcome-sub {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto 28px;
  line-height: 1.6;
}
.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}
.welcome-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

/* Gender selector cards */
.gender-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 960px;
  margin: 0 auto 32px;
}
.gender-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.gender-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--accent-glow));
  opacity: 0;
  transition: opacity var(--transition);
}
.gender-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.gender-card:hover::after {
  opacity: 1;
}
.gender-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow-strong);
}
.gender-card.selected::after {
  opacity: 1;
}
.gc-icon {
  font-size: 44px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.gc-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}
.gc-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.gc-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  position: relative;
  z-index: 1;
}
.gc-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-light);
}
.gc-stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Feature cards row */
.feature-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  border-top: 3px solid transparent;
}
.feature-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.feature-card[data-color='indigo'] {
  border-top-color: var(--accent);
}
.feature-card[data-color='emerald'] {
  border-top-color: var(--success);
}
.feature-card[data-color='amber'] {
  border-top-color: var(--warning);
}
.feature-card[data-color='rose'] {
  border-top-color: var(--danger);
}
.fc-icon {
  font-size: 28px;
  margin-bottom: 10px;
}
.fc-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.fc-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ================================================================
   DASHBOARD VIEW
   ================================================================ */
/* KPI row */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-color, var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}
.kpi-card:hover {
  border-color: var(--kpi-color, var(--accent));
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.kpi-card:hover::before {
  opacity: 1;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.kpi-icon {
  font-size: 20px;
}
.kpi-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 50px;
}
.kpi-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  color: var(--kpi-color, var(--accent-light));
}
.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* Dashboard grid — two-column from here */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.dash-grid .span-full {
  grid-column: 1/-1;
}

/* Generic panel card */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}
.panel:hover {
  border-color: var(--border-light);
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-badge {
  font-size: 10px;
  padding: 2px 8px;
  background: var(--accent-glow);
  color: var(--accent-light);
  border-radius: 50px;
  font-weight: 600;
}
.panel-body {
  padding: 16px 20px;
}
.panel-body-np {
  padding: 0;
}

/* ---- Insight cards ---- */
.insights-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.insight-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.insight-card[data-severity='high'] {
  border-left-color: var(--danger);
}
.insight-card[data-severity='warning'] {
  border-left-color: var(--warning);
}
.insight-card[data-severity='medium'] {
  border-left-color: var(--accent);
}
.insight-card[data-severity='info'] {
  border-left-color: var(--success);
}
.ic-icon {
  font-size: 24px;
  flex-shrink: 0;
  padding-top: 2px;
}
.ic-body {
  flex: 1;
  min-width: 0;
}
.ic-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
}
.ic-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ================================================================
   TABLES (shared) — Premium Modern Tables
   ================================================================ */
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 700;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table thead th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
.data-table thead th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}
.data-table thead th.num {
  text-align: right;
}
.data-table tbody td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.2);
  vertical-align: middle;
  transition: all var(--transition);
}
.data-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.data-table tbody tr {
  transition: all var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover {
  background: var(--accent-glow);
  transform: scale(1.001);
}
.data-table tbody tr:hover td {
  color: var(--text);
}
.data-table tbody tr:hover td:first-child {
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:nth-child(even) {
  background: rgba(15, 22, 41, 0.2);
}
[data-theme='light'] .data-table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.015);
}

/* Rank column */
.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-glow);
  color: var(--accent-light);
}
.rank-num.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}
.rank-num.silver {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.rank-num.bronze {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

/* Thumbnail in table */
.td-thumb {
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-surface);
  transition: all var(--transition);
}
.table-thumb:hover {
  transform: scale(1.6);
  z-index: 10;
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}
.td-thumb-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.td-thumb-main {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.td-thumb-sub {
  font-size: 11px;
  color: var(--text-muted);
}
.thumb-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Sparkline in table */
.sparkline-cell {
  display: inline-block;
  vertical-align: middle;
}
.sparkline-cell canvas {
  vertical-align: middle;
}

/* Revenue bar in table */
.rev-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rev-bar {
  height: 6px;
  border-radius: 3px;
  min-width: 2px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.rev-bar-val {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Brand name styling */
.brand-name {
  font-weight: 600;
}
.share-bar {
  display: inline-block;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.6;
  vertical-align: middle;
  margin-right: 6px;
  min-width: 2px;
}

/* ================================================================
   CHARTS
   ================================================================ */
.chart-wrap {
  height: 280px;
  margin: 8px 0;
  position: relative;
}
.chart-wrap-sm {
  height: 200px;
}
.chart-wrap-lg {
  height: 360px;
}

/* ================================================================
   STAT ROWS (inside analysis views)
   ================================================================ */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.stat-val {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 2px;
}
.stat-val.accent {
  color: var(--accent-light);
}
.stat-val.success {
  color: var(--success);
}
.stat-val.warning {
  color: var(--warning);
}
.stat-val.danger {
  color: var(--danger);
}
.stat-val.purple {
  color: var(--purple);
}
.stat-val.cyan {
  color: var(--cyan);
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ================================================================
   PRODUCT DETAIL MODAL
   ================================================================ */
.product-detail-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.product-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-main-img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  object-fit: cover;
  cursor: pointer;
  transition: all var(--transition);
}
.product-main-img:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
}
.product-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.product-thumb-sm {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.product-thumb-sm:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}
.product-thumb-sm.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow-strong);
}
.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.product-attr-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.product-attr-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.product-attr-tag .attr-name {
  font-weight: 600;
  color: var(--text-muted);
}

/* Image gallery grid */
.img-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.img-gallery img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: cover;
  aspect-ratio: 1;
  cursor: pointer;
  transition: all var(--transition);
}
.img-gallery img:hover {
  border-color: var(--accent);
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

/* Image lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.2s ease;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
}

/* ================================================================
   SUGGESTION / ACTION CARDS
   ================================================================ */
.suggestion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  border-left: 3px solid transparent;
}
.suggestion-card:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateX(3px);
}
.suggestion-card.high {
  border-left-color: var(--danger);
}
.suggestion-card.medium {
  border-left-color: var(--warning);
}
.suggestion-card.low {
  border-left-color: var(--success);
}
.suggestion-card .sug-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.suggestion-card .sug-priority {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
}
.suggestion-card.high .sug-priority {
  background: var(--danger-bg);
  color: var(--danger);
}
.suggestion-card.medium .sug-priority {
  background: var(--warning-bg);
  color: var(--warning);
}
.suggestion-card.low .sug-priority {
  background: var(--success-bg);
  color: var(--success);
}
.suggestion-card .sug-title {
  font-weight: 700;
  font-size: 13px;
}
.suggestion-card .sug-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ================================================================
   MINI METRIC CARDS (for inside panels)
   ================================================================ */
.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 12px;
  text-align: center;
}
.metric-val {
  font-size: 18px;
  font-weight: 800;
}
.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 2px;
}

/* Cannibal pair garment images */
.garment-pair-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.2);
}
.garment-pair-row:last-child {
  border-bottom: none;
}
.garment-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.garment-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.garment-info {
  min-width: 0;
}
.garment-sku {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.garment-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.garment-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

/* ================================================================
   COLLAPSIBLE SECTIONS
   ================================================================ */
.collapse-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  transition: all var(--transition);
}
.collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  transition: background var(--transition);
}
.collapse-header:hover {
  background: var(--bg-card-hover);
}
.collapse-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.collapse-icon {
  font-size: 22px;
}
.collapse-title {
  font-size: 15px;
  font-weight: 700;
}
.collapse-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.collapse-arrow {
  font-size: 14px;
  color: var(--text-muted);
  transition: transform var(--transition);
}
.collapse-section.open .collapse-arrow {
  transform: rotate(180deg);
}
.collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.collapse-section.open .collapse-body {
  max-height: 8000px;
}
.collapse-inner {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
}

/* ================================================================
   BRAND ATTRIBUTE TABLES
   ================================================================ */
.brand-attr-block {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-card);
  transition: box-shadow 0.2s;
}
.brand-attr-block:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.brand-attr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}
.brand-attr-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.3px;
}
.brand-attr-meta {
  font-size: 11px;
  color: var(--text-secondary);
}
.brand-attr-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.attr-name-cell {
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.attr-val-cell {
  text-align: center;
}
.attr-val-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-glow);
  color: var(--accent-light);
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.attr-val-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.25);
}
.attr-val-share {
  font-weight: 400;
  font-size: 10px;
  opacity: 0.75;
}

/* Combination value chips (in winning-combinations modal) */
.combo-val-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 14px;
  margin: 3px;
  border-radius: 10px;
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 12px;
  line-height: 1.3;
}
.combo-val-chip strong {
  font-size: 13px;
}
.combo-val-metrics {
  font-size: 10px;
  opacity: 0.8;
  font-weight: 400;
  white-space: nowrap;
}

/* ================================================================
   PILLS & BADGES
   ================================================================ */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  margin: 2px;
}
.pill-accent {
  background: var(--accent-glow);
  color: var(--accent-light);
}
.pill-success {
  background: var(--success-bg);
  color: var(--success);
}
.pill-warning {
  background: var(--warning-bg);
  color: var(--warning);
}
.pill-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.pill-purple {
  background: var(--purple-bg);
  color: var(--purple);
}
.pill-cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.quadrant-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
}
.q-star {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.q-premium {
  background: var(--purple-bg);
  color: var(--purple);
}
.q-volume {
  background: var(--accent-glow);
  color: var(--accent-light);
}
.q-under {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(900px, 94vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
}
.modal-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

/* ================================================================
   METHOD BOX / CALLOUT
   ================================================================ */
.callout {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px 18px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}
.callout strong {
  color: var(--text);
}
.callout.callout-accent {
  border-left: 3px solid var(--accent);
}
.callout.callout-warning {
  border-left: 3px solid var(--warning);
}
.callout.callout-danger {
  border-left: 3px solid var(--danger);
}
.callout.callout-success {
  border-left: 3px solid var(--success);
}

/* ================================================================
   LOADING / EMPTY
   ================================================================ */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  gap: 12px;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ================================================================
   COMPARE VIEW
   ================================================================ */
.compare-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.compare-controls label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.compare-controls select {
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
}
.compare-controls input {
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  width: 200px;
}
.compare-controls input:focus,
.compare-controls select:focus {
  outline: none;
  border-color: var(--accent);
}
.compare-btn {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all var(--transition);
}
.compare-btn:hover {
  background: var(--accent-dark);
}

/* ================================================================
   BRAND CHIPS (multi-select)
   ================================================================ */
.brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.brand-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}
.brand-chip.selected {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-light);
  font-weight: 600;
}

/* ================================================================
   ANIMATIONS
   ================================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes viewFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.stagger > * {
  animation: viewFadeIn 0.4s ease both;
}
.stagger > *:nth-child(1) {
  animation-delay: 0s;
}
.stagger > *:nth-child(2) {
  animation-delay: 0.06s;
}
.stagger > *:nth-child(3) {
  animation-delay: 0.12s;
}
.stagger > *:nth-child(4) {
  animation-delay: 0.18s;
}
.stagger > *:nth-child(5) {
  animation-delay: 0.24s;
}
.stagger > *:nth-child(6) {
  animation-delay: 0.3s;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .topbar-menu-btn {
    display: block;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .feature-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .gender-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 600px) {
  .view-container {
    padding: 16px 12px 40px;
  }
  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-row {
    grid-template-columns: 1fr;
  }
  .gender-grid {
    grid-template-columns: 1fr;
  }
  .welcome-title {
    font-size: 28px;
  }
  .insights-row {
    grid-template-columns: 1fr;
  }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* Light theme tweaks */
[data-theme='light'] .login-overlay {
  background: linear-gradient(135deg, #eef2ff, #f0f9ff, #faf5ff);
}
[data-theme='light'] .login-bg-art {
  opacity: 0.5;
}
[data-theme='light'] .sidebar {
  background: var(--bg-sidebar);
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.04);
}
[data-theme='light'] .topbar {
  background: var(--bg-card);
}
[data-theme='light'] .sidebar-link.active {
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}
[data-theme='light'] .data-table thead th {
  background: var(--bg-surface);
  border-bottom-color: var(--border);
}
[data-theme='light'] .data-table tbody tr:hover td:first-child {
  border-left-color: var(--accent);
}

/* ================================================================
   COMPACT WELCOME HERO
   ================================================================ */
/* (compact hero removed — using original hero) */

/* ================================================================
   FILTER HUB
   ================================================================ */
.filter-hub {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fh-section {
  display: flex;
  align-items: center;
  gap: 12px;
}
.fh-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  min-width: 110px;
  white-space: nowrap;
}
.fh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fh-chips-scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.fh-chips-scroll::-webkit-scrollbar {
  display: none;
}

.filter-hub-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
}
.filter-hub-chip:hover {
  border-color: var(--accent-light);
  color: var(--accent-light);
  background: var(--accent-glow);
}
.filter-hub-chip.selected {
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.fhc-count {
  font-size: 10px;
  opacity: 0.7;
  margin-left: 2px;
}
.fh-clear {
  text-align: right;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.fh-clear-btn {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 6px;
  transition: background 0.15s;
}
.fh-clear-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* ================================================================
   INDICATOR GRID (welcome page)
   ================================================================ */
.fh-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}
.indicator-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}
.indicator-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.indicator-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.indicator-card:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
}
.indicator-card:hover::before {
  opacity: 1;
}
.indicator-card[data-color='indigo']::before {
  background: #6366f1;
}
.indicator-card[data-color='emerald']::before {
  background: #10b981;
}
.indicator-card[data-color='amber']::before {
  background: #f59e0b;
}
.indicator-card[data-color='rose']::before {
  background: #f472b6;
}
.indicator-card[data-color='cyan']::before {
  background: #22d3ee;
}
.ic-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ind-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.ind-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.ind-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.ind-arrow {
  font-size: 18px;
  color: var(--text-muted);
  transition:
    transform 0.2s,
    color 0.2s;
}
.indicator-card:hover .ind-arrow {
  transform: translateX(4px);
  color: var(--accent-light);
}

/* ================================================================
   CANNIBALIZATION — Per-pair shared attrs
   ================================================================ */
.cannib-pair-attrs-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.cannib-pair-attrs {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cannib-attr-pill:hover {
  filter: brightness(1.2);
  transform: scale(1.05);
}

/* ================================================================
   COLLAPSIBLE TABLE ROWS
   ================================================================ */
.table-row-hidden {
  display: none !important;
}
.data-table tbody tr[data-brand],
.data-table tbody tr[data-pair-idx],
.data-table tbody tr[data-sku],
.data-table tbody tr[data-cat],
.data-table tbody tr[data-id] {
  cursor: pointer;
}
.data-table tbody tr[data-brand]:hover td,
.data-table tbody tr[data-pair-idx]:hover td,
.data-table tbody tr[data-sku]:hover td,
.data-table tbody tr[data-cat]:hover td,
.data-table tbody tr[data-id]:hover td {
  background: var(--accent-light-10, rgba(99, 102, 241, 0.06));
}
.table-toggle-btn {
  display: block;
  width: 100%;
  padding: 8px 0;
  margin-top: 4px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.table-toggle-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent-light);
}

/* Light theme additions */
[data-theme='light'] .filter-hub {
  background: #fff;
}
[data-theme='light'] .filter-hub-chip {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
[data-theme='light'] .filter-hub-chip.selected {
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  color: #fff;
  border-color: transparent;
}
[data-theme='light'] .filter-hub-chip:hover {
  background: #e2e8f0;
  border-color: #6366f1;
  color: #6366f1;
}
[data-theme='light'] .indicator-card {
  background: #fff;
}
[data-theme='light'] .indicator-card:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.08);
}

/* Executive summary recommendations */
.exec-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}
.exec-rec:last-child {
  border-bottom: none;
}
.exec-rec:hover {
  background: var(--accent-glow);
}
