/* ============================================================================
   LG MAP Intelligence — Portal Design System
   ============================================================================
   Brand: GuildBuild host/operator + LG Electronics Canada client context
   Typography: Inter + JetBrains Mono (Google Fonts)
   Style: Modern enterprise SaaS — dense, status-color-driven
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Custom Properties ─────────────────────────────────────────────────── */
:root {
  /* Font families */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Brand — compatibility names mapped to GuildBuild primary */
  --lg-red: #008272;
  --lg-red-hover: #006b5f;
  --lg-red-press: #004b43;
  --lg-red-light: #e8f6f3;
  --lg-red-glow: rgba(0, 130, 114, 0.16);

  /* Brand — GuildBuild */
  --gb-navy: #252423;
  --gb-navy-deep: #201f1e;
  --gb-teal: #008272;
  --gb-teal-deep: #004b43;
  --gb-accent: #00b294;
  --gb-orange: #F08A1C;

  /* Neutrals */
  --bg-body: #f7f7f5;
  --bg-card: #ffffff;
  --bg-card-hover: #faf9f8;
  --bg-nav: #252423;
  --bg-code: #f3f2f1;
  --border-light: #e1dfdd;
  --border-strong: #c8c6c4;
  --border-card: rgba(0, 0, 0, 0.06);

  /* Text */
  --text-primary: #201f1e;
  --text-secondary: #605e5c;
  --text-muted: #8a8886;
  --text-inverse: #ffffff;

  /* Status */
  --status-update: #3b82f6;
  --status-new: #10b981;
  --status-unchanged: #94a3b8;
  --status-notfound: #ef4444;
  --status-warning: #f59e0b;

  /* Accents */
  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-teal: #2BA199;

  /* Spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.10), 0 8px 20px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 0 20px var(--lg-red-glow);
  --shadow-glow-red: 0 0 20px var(--lg-red-glow);
  --shadow-focus-red: 0 0 0 3px var(--lg-red-glow);

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);
}

/* ── Base ───────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.portal-nav {
  background: var(--bg-nav);
  border-bottom: none;
  padding: 0.6rem 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.portal-nav .navbar-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.15rem;
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.portal-nav .brand-accent {
  display: inline-block;
  width: 4px;
  height: 22px;
  background: var(--lg-red);
  border-radius: 2px;
}

.portal-nav .brand-sub {
  font-weight: 400;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.45);
  margin-left: 0.25rem;
}

.portal-nav .nav-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.portal-nav .nav-link:hover {
  color: var(--text-inverse);
  background: rgba(255, 255, 255, 0.08);
}

.portal-nav .nav-link.active {
  color: var(--text-inverse);
  background: var(--lg-red);
}

.portal-nav .nav-link i {
  font-size: 0.9rem;
}

/* ── Page Container ─────────────────────────────────────────────────────────── */
.page-container {
  animation: fadeSlideUp 0.4s var(--ease-out);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card Body ───────────────────────────────────────────────────────────────── */
/* Fallback for .card-body without Bootstrap's padding stripping */
.card-body {
  padding: 1.25rem;
}

/* ── Back Link ───────────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 14px;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--lg-red);
}

.back-link i {
  font-size: 0.88rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.glass-card:hover {
  box-shadow: var(--shadow-md);
}

.glass-card .card-header {
  background: transparent;
  border-bottom: 1px solid var(--border-light);
  padding: 0.85rem 1.25rem;
  font-weight: 600;
  font-size: 0.88rem;
}

/* Trust and run-health panels */
.trust-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.trust-ok {
  border-left-color: var(--accent-green);
}

.trust-warning {
  border-left-color: var(--status-warning);
}

.trust-critical {
  border-left-color: var(--status-notfound);
}

.trust-main {
  align-items: center;
  display: flex;
  gap: 12px;
}

.trust-icon {
  align-items: center;
  background: var(--bg-code);
  border-radius: var(--radius-sm);
  display: flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
}

.trust-ok .trust-icon {
  color: var(--accent-green);
}

.trust-warning .trust-icon {
  color: var(--status-warning);
}

.trust-critical .trust-icon {
  color: var(--status-notfound);
}

.trust-title {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.trust-meta,
.trust-note {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.trust-metrics,
.trust-detail-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trust-metrics > div,
.trust-detail-grid > div {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.trust-metrics strong,
.trust-detail-grid strong {
  color: var(--text-primary);
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.trust-metrics span,
.trust-detail-grid span {
  color: var(--text-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
}

.trust-issues {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.trust-issue,
.trust-status-pill {
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
  text-transform: uppercase;
}

.trust-issue-warning,
.trust-status-partial,
.trust-status-running,
.trust-status-price_mismatch,
.trust-status-render_failed {
  background: rgba(245, 158, 11, 0.12);
  color: #9a5a00;
}

.trust-issue-critical,
.trust-status-failed,
.trust-status-error,
.trust-status-blocked,
.trust-status-missing_url,
.trust-status-url_mismatch {
  background: rgba(239, 68, 68, 0.12);
  color: #b42318;
}

.trust-status-completed,
.trust-status-success,
.trust-status-succeeded {
  background: rgba(16, 185, 129, 0.12);
  color: #067647;
}

.trust-table-wrap {
  overflow-x: auto;
}

.trust-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  width: 100%;
}

.trust-table th,
.trust-table td {
  border-bottom: 1px solid var(--border-light);
  padding: 8px 10px;
  white-space: nowrap;
}

.trust-table th {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.trust-detail-grid {
  padding: 16px;
}

.trust-note {
  border-top: 1px solid var(--border-light);
  padding: 10px 16px 14px;
}

@media (max-width: 900px) {
  .trust-metrics,
  .trust-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ── Stat Cards ─────────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transition: height var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  height: 4px;
}

.stat-card.stat-update::before  { background: var(--status-update); }
.stat-card.stat-new::before     { background: var(--status-new); }
.stat-card.stat-unchanged::before { background: var(--status-unchanged); }
.stat-card.stat-notfound::before { background: var(--status-notfound); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-update  .stat-value { color: var(--status-update); }
.stat-new     .stat-value { color: var(--status-new); }
.stat-unchanged .stat-value { color: var(--status-unchanged); }
.stat-notfound .stat-value { color: var(--status-notfound); }

/* ── Drop Zone ──────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: var(--bg-card);
  position: relative;
}

.drop-zone:hover {
  border-color: var(--lg-red);
  background: var(--lg-red-light);
  box-shadow: var(--shadow-glow);
}

.drop-zone.drag-over {
  border-color: var(--lg-red);
  background: var(--lg-red-light);
  box-shadow: var(--shadow-glow);
  transform: scale(1.01);
}

.drop-zone .drop-icon {
  font-size: 3rem;
  color: var(--text-muted);
  transition: all var(--transition-normal);
  display: block;
  margin-bottom: 0.75rem;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
  color: var(--lg-red);
  transform: translateY(-4px);
}

.drop-zone .drop-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.drop-zone .drop-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.drop-zone .file-selected {
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 0.5rem;
}

/* ── Tables ──────────────────────────────────────────────────────────────────── */
.portal-table {
  font-size: 0.85rem;
}

.portal-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 2px solid var(--border-light);
  padding: 0.7rem 0.75rem;
  white-space: nowrap;
  user-select: none;
}

.portal-table thead th.sortable {
  cursor: pointer;
  transition: color var(--transition-fast);
}

.portal-table thead th.sortable:hover {
  color: var(--lg-red);
}

.portal-table tbody td {
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.portal-table tbody tr {
  transition: background var(--transition-fast);
}

.portal-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.portal-table .model-number {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
}

.portal-table .price {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-weight: 500;
}

/* Compact one-pager variant: fit a wide, dense table (e.g. the retailer-detail
   Current Cycle Violations grid) without left/right scrolling. */
.portal-table.table-compact {
  font-size: 0.78rem;
}
.portal-table.table-compact thead th,
.portal-table.table-compact tbody td {
  padding-left: 0.32rem;
  padding-right: 0.32rem;
}
.portal-table.table-compact thead th {
  font-size: 0.63rem;
  letter-spacing: 0.02em;
}
.portal-table.table-compact .model-number {
  font-size: 0.74rem;
}
.portal-table.table-compact .price {
  font-size: 0.74rem;
}

.portal-table .sku-product {
  color: var(--text-primary);
  font-size: 12.5px;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Status Badges ──────────────────────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-will_update { color: var(--status-update); }
.status-will_update .dot { background: var(--status-update); }
.status-first_upload { color: var(--status-new); }
.status-first_upload .dot { background: var(--status-new); }
.status-new_sku { color: var(--status-new); }
.status-new_sku .dot { background: var(--status-new); }
.status-product_group { color: var(--accent-purple); }
.status-product_group .dot { background: var(--accent-purple); }
.status-unchanged { color: var(--status-unchanged); }
.status-unchanged .dot { background: var(--status-unchanged); }
.status-not_found { color: var(--status-notfound); }
.status-not_found .dot { background: var(--status-notfound); }

.ops-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}

.ops-kpi span {
  color: var(--text-muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ops-kpi strong {
  color: var(--text-primary);
  display: block;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-top: 4px;
}

.ops-health-metrics {
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-health-metric {
  min-width: 0;
  padding: 4px 16px 14px 0;
}

.ops-health-metric span {
  color: var(--text-muted);
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ops-health-metric strong {
  color: var(--text-primary);
  display: block;
  font-size: 1.35rem;
  line-height: 1.2;
  margin-top: 4px;
}

.ops-status {
  align-items: center;
  border-radius: var(--radius-pill);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 6px;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
}

.ops-status-dot {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 7px;
  height: 7px;
  width: 7px;
}

.ops-status-queued,
.ops-status-paused,
.ops-status-pausing {
  background: rgba(245, 158, 11, 0.12);
  color: #9a5a00;
}

.ops-status-queued .ops-status-dot,
.ops-status-paused .ops-status-dot,
.ops-status-pausing .ops-status-dot {
  background: var(--status-warning);
}

.ops-status-running {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.ops-status-running .ops-status-dot {
  background: var(--status-update);
}

.ops-status-completed {
  background: rgba(16, 185, 129, 0.12);
  color: #067647;
}

.ops-status-completed .ops-status-dot {
  background: var(--accent-green);
}

.ops-status-stopping,
.ops-status-stopped,
.ops-status-cancelled {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.ops-status-stopping .ops-status-dot,
.ops-status-stopped .ops-status-dot,
.ops-status-cancelled .ops-status-dot {
  background: var(--status-unchanged);
}

.ops-status-failed,
.ops-status-aborted {
  background: rgba(239, 68, 68, 0.12);
  color: #b42318;
}

.ops-status-failed .ops-status-dot,
.ops-status-aborted .ops-status-dot {
  background: var(--status-notfound);
}

.ops-run-table td {
  min-width: 120px;
}

.ops-history-table td {
  min-width: 100px;
}

.ops-event-cell {
  max-width: 220px;
}

.ops-history-event {
  max-width: 260px;
}

.ops-retailer-grid {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: 260px;
  overflow: auto;
  padding: 10px;
}

.ops-retailer-option {
  align-items: flex-start;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 8px;
}

.ops-retailer-option .form-check-label {
  display: grid;
  gap: 2px;
  min-width: 0;
}

@media (max-width: 900px) {
  .ops-kpi-grid,
  .ops-health-metrics,
  .ops-retailer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .ops-kpi-grid,
  .ops-health-metrics,
  .ops-retailer-grid {
    grid-template-columns: 1fr;
  }
}

.row-not-found {
  background: rgba(239, 68, 68, 0.04);
}

.row-review {
  background: rgba(245, 158, 11, 0.06);
}

.review-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: var(--status-warning);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.review-warning-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.review-warning-list span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.1);
  color: #8a4d00;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.12rem 0.38rem;
}

.review-confirm {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.08);
  padding: 0.75rem;
}

.manual-supersede-box {
  border: 1px solid rgba(0, 130, 114, 0.22);
  border-radius: var(--radius-md);
  background: rgba(0, 130, 114, 0.04);
  padding: 0.85rem;
}

/* ── Change Indicators ──────────────────────────────────────────────────────── */
.change-up   { color: var(--accent-green); font-weight: 700; }
.change-down { color: var(--status-notfound); font-weight: 700; }
.change-flat { color: var(--status-warning); font-weight: 500; }
.change-new  { color: var(--accent-blue); font-weight: 700; }
.change-neutral { color: var(--text-secondary); font-weight: 700; }

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn-lg-red {
  background: var(--lg-red);
  color: var(--text-inverse);
  border: none;
  padding: 0.55rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 130, 114, 0.24);
}

.btn-lg-red:hover:not(:disabled) {
  background: var(--lg-red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 130, 114, 0.28);
  color: var(--text-inverse);
}

.btn-lg-red:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-positive {
  background: var(--accent-green);
  border: none;
  color: var(--text-inverse);
  font-weight: 700;
}

.btn-positive:hover,
.btn-positive:focus {
  background: #047857;
  color: var(--text-inverse);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ── Upload Type Badges ─────────────────────────────────────────────────────── */
.badge-type {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-weekly {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-blue);
}

.badge-adhoc {
  background: rgba(124, 58, 237, 0.1);
  color: var(--accent-purple);
}

.badge-completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.badge-reverted {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-warning);
}

/* ── Source Badges ───────────────────────────────────────────────────────────── */
.source-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}

.source-lg_provided {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-green);
}

.source-auto_discovered {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-warning);
}

/* ── CSV Hint Box ───────────────────────────────────────────────────────────── */
.csv-hint {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
}

.csv-hint code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.78rem;
  background: transparent;
  color: var(--text-primary);
}

/* ── Form Controls ──────────────────────────────────────────────────────────── */
.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-control, .form-select {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--lg-red);
  box-shadow: 0 0 0 3px var(--lg-red-glow);
}

/* ── Search/Filter Input ────────────────────────────────────────────────────── */
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.85rem;
  width: 100%;
  max-width: 320px;
  transition: all var(--transition-fast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b92a5' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.75rem center;
}

.search-input:focus {
  border-color: var(--lg-red);
  box-shadow: 0 0 0 3px var(--lg-red-glow);
  outline: none;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  border: none;
  font-weight: 500;
}

/* ── Empty State ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state a {
  color: var(--lg-red);
  text-decoration: none;
  font-weight: 600;
}

.empty-state a:hover {
  text-decoration: underline;
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */
.portal-footer {
  border-top: 1px solid var(--border-light);
  padding: 1.25rem 0;
  margin-top: 3rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-footer .footer-dot {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--border-light);
  margin: 0 0.5rem;
  vertical-align: middle;
}

/* ── Confirmation Modal ─────────────────────────────────────────────────────── */
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  border-bottom: 1px solid var(--border-light);
  padding: 1.25rem 1.5rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--border-light);
  padding: 1rem 1.5rem;
}

/* When a modal wraps its header/body/footer in a <form> (e.g. Start Run), the
   .modal-content flex column has only the <form> as its child, so .modal-body
   never shrinks and .modal-dialog-scrollable can't pin the footer — the submit
   button ends up below the viewport and is unreachable. display:contents lets the
   header/body/footer participate in the modal-content flex column directly. */
.modal-content > form {
  display: contents;
}

/* ── Loading Spinner ────────────────────────────────────────────────────────── */
.spinner-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.spinner-overlay.active {
  display: flex;
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .stat-value { font-size: 1.5rem; }
  .page-title { font-size: 1.25rem; }
  .drop-zone { padding: 2rem 1.5rem; }
  .drop-zone .drop-icon { font-size: 2.5rem; }
}

/* ── Utility ────────────────────────────────────────────────────────────────── */
.font-mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.text-lg-red { color: var(--lg-red); }
.text-muted-custom { color: var(--text-muted); }

.pill-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.pill-filter:hover {
  border-color: var(--lg-red);
  color: var(--lg-red);
}

.pill-filter.active {
  background: var(--lg-red);
  border-color: var(--lg-red);
  color: var(--text-inverse);
}

/* ============================================================================
   Violations Reporting Module
   ============================================================================ */

/* ── Severity Variables (design system) ────────────────────────────────────── */
:root {
  --sev-critical: #9F1239;
  --sev-critical-bg: rgba(159, 18, 57, 0.07);
  --sev-major: #B45309;
  --sev-major-bg: rgba(180, 83, 9, 0.07);
  --sev-moderate: #92733A;
  --sev-moderate-bg: rgba(146, 115, 58, 0.07);
  --sev-minor: #15663F;
  --sev-minor-bg: rgba(21, 102, 63, 0.07);
  --sev-info: #64748B;
  --sev-info-bg: rgba(100, 116, 139, 0.07);
}

/* ── Violations summary (3 aspects) + filter bar ───────────────────────────── */
.viol-summary {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 860px) {
  .viol-summary { grid-template-columns: 1fr; }
}
.summary-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.summary-label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.summary-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
}
.summary-total {
  color: var(--text-primary);
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
}
.summary-sub {
  color: var(--text-muted);
  font-size: 12px;
}
.sev-bar {
  background: var(--border-light);
  border-radius: 6px;
  display: flex;
  height: 18px;
  overflow: hidden;
  width: 100%;
}
.sev-seg {
  align-items: center;
  color: rgba(255, 255, 255, 0.96);
  display: flex;
  font-size: 10px;
  font-weight: 800;
  height: 100%;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.2);
  white-space: nowrap;
}
.sev-seg-critical { background: var(--sev-critical); }
.sev-seg-major { background: var(--sev-major); }
.sev-seg-moderate { background: var(--sev-moderate); }
.sev-seg-minor { background: var(--sev-minor); }
.sev-seg-info { background: var(--sev-info); }
.sev-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.sev-legend-item {
  align-items: center;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
}
.sev-legend-item strong { color: var(--text-primary); font-size: 13px; }
.sev-dot {
  border-radius: 2px;
  display: inline-block;
  height: 9px;
  width: 9px;
}
.severity-glossary {
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: -4px 0 18px;
  padding: 10px 12px;
}
.severity-glossary-title {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 6px;
}
.severity-glossary-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.severity-glossary-items span {
  color: var(--text-muted);
  font-size: 12px;
}
.severity-glossary-items strong {
  font-weight: 800;
  text-transform: uppercase;
}
.sev-text-critical { color: var(--sev-critical); }
.sev-text-major { color: var(--sev-major); }
.sev-text-moderate { color: var(--sev-moderate); }
.sev-text-minor { color: var(--sev-minor); }
.summary-dual {
  align-items: center;
  display: flex;
  gap: 18px;
}
.summary-dual > div { display: flex; flex-direction: column; }
.summary-dual-value {
  color: var(--text-primary);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.summary-dual-cap {
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: 4px;
}
.summary-dual-sep {
  align-self: stretch;
  background: var(--border-light);
  width: 1px;
}
.filter-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 18px;
}
.filter-tiles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  text-decoration: none;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.filter-tile:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-tile.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}
.filter-tile-critical.active { background: var(--sev-critical); border-color: var(--sev-critical); }
.filter-tile-major.active { background: var(--sev-major); border-color: var(--sev-major); }
.filter-tile-moderate.active { background: var(--sev-moderate); border-color: var(--sev-moderate); }
.filter-tile-minor.active { background: var(--sev-minor); border-color: var(--sev-minor); }
.filter-tile-info.active { background: var(--sev-info); border-color: var(--sev-info); }
.filter-dropdowns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12.5px;
  max-width: 210px;
  min-height: 36px;
  padding: 6px 34px 6px 10px;
}
.run-filter-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -6px 0 16px;
}
.run-filter-row label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.run-filter-select {
  max-width: none;
  min-width: min(420px, 100%);
  width: min(520px, 100%);
}

/* ── Severity Badges ───────────────────────────────────────────────────────── */
.sev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.sev-CRITICAL { background: var(--sev-critical-bg); color: var(--sev-critical); border: 1px solid rgba(239,68,68,0.2); }
.sev-MAJOR    { background: var(--sev-major-bg);    color: var(--sev-major);    border: 1px solid rgba(249,115,22,0.2); }
.sev-MODERATE { background: var(--sev-moderate-bg); color: var(--sev-moderate); border: 1px solid rgba(234,179,8,0.2); }
.sev-MINOR    { background: var(--sev-minor-bg);    color: var(--sev-minor);    border: 1px solid rgba(34,197,94,0.2); }
.sev-INFO     { background: var(--sev-info-bg);     color: var(--sev-info);     border: 1px solid rgba(100,116,139,0.2); }

/* Enforcement readiness — enforce-ready vs review-only (from enforcement_eligible) */
.enf-badge {
  align-items: center;
  border-radius: 20px;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 600;
  gap: 0.25rem;
  margin-top: 3px;
  padding: 0.12rem 0.45rem;
  white-space: nowrap;
}
.enf-ready {
  background: var(--sev-minor-bg);
  border: 1px solid rgba(21, 102, 63, 0.25);
  color: var(--sev-minor);
}
.enf-pending {
  background: var(--sev-moderate-bg);
  border: 1px solid rgba(146, 115, 58, 0.25);
  color: var(--sev-moderate);
  cursor: help;
}
.enf-review {
  background: var(--sev-major-bg);
  border: 1px solid rgba(180, 83, 9, 0.25);
  color: var(--sev-major);
  cursor: help;
}

/* ── Violation KPI Cards ───────────────────────────────────────────────────── */
.viol-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.viol-kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.viol-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.viol-kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.viol-kpi:hover::before { height: 4px; }

.viol-kpi.kpi-critical::before { background: var(--sev-critical); }
.viol-kpi.kpi-major::before    { background: var(--sev-major); }
.viol-kpi.kpi-exposure::before { background: var(--lg-red); }
.viol-kpi.kpi-retailers::before { background: var(--accent-blue); }
.viol-kpi.kpi-total::before    { background: var(--accent-purple); }
.viol-kpi.kpi-products::before { background: var(--accent-green); }

.viol-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.viol-kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Retailer Cards Grid ───────────────────────────────────────────────────── */
.retailer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.retailer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.retailer-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--lg-red);
  color: inherit;
  text-decoration: none;
}

.retailer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.retailer-card-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.retailer-card-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--sev-critical);
  line-height: 1;
}

.retailer-severity-strip {
  background: var(--border-light);
  border-radius: 6px;
  display: flex;
  height: 16px;
  overflow: hidden;
  width: 100%;
}
.retailer-severity-strip span {
  align-items: center;
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  font-size: 10px;
  font-weight: 800;
  height: 100%;
  justify-content: center;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-shadow: 0 1px 1px rgba(15, 23, 42, 0.2);
  white-space: nowrap;
}
.retailer-severity-counts {
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11.5px;
  gap: 4px 10px;
}

.retailer-card-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.retailer-card-stats strong {
  color: var(--text-primary);
  font-weight: 700;
}

.retailer-card-arrow {
  position: absolute;
  right: 1.25rem;
  bottom: 1.25rem;
  font-size: 1rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.retailer-card:hover .retailer-card-arrow {
  color: var(--lg-red);
  transform: translateX(3px);
}

/* ── Violation Table URL & Evidence Buttons ────────────────────────────────── */
.url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--accent-blue);
  font-size: 0.78rem;
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.evidence-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(124, 58, 237, 0.08);
  color: var(--accent-purple);
  border: 1px solid rgba(124, 58, 237, 0.15);
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.evidence-btn:hover {
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-purple);
  transform: translateY(-1px);
}

/* ── Evidence Viewer ───────────────────────────────────────────────────────── */
.evidence-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.25rem;
}

.evidence-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.evidence-item:hover {
  box-shadow: var(--shadow-md);
}

.evidence-item img {
  width: 100%;
  display: block;
  cursor: zoom-in;
  transition: transform var(--transition-slow);
}

.evidence-item img:hover {
  transform: scale(1.02);
}

.evidence-item-footer {
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
}

.evidence-meta-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.evidence-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.85rem;
}

.evidence-meta-row:last-child {
  border-bottom: none;
}

.evidence-meta-label {
  color: var(--text-muted);
  font-weight: 500;
}

.evidence-meta-value {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Email Composer ────────────────────────────────────────────────────────── */
.email-preview-frame {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.email-preview-frame iframe {
  width: 100%;
  min-height: 600px;
  border: none;
  display: block;
}

.email-actions-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.email-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.email-sidebar-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.82rem;
}

.email-sidebar-item:last-child { border-bottom: none; }
.email-sidebar-label { color: var(--text-muted); font-weight: 500; }
.email-sidebar-value { color: var(--text-primary); font-weight: 600; }

/* ── Category Accordion ────────────────────────────────────────────────────── */
.cat-accordion {
  margin-bottom: 1.5rem;
}

.cat-accordion-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.cat-accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background var(--transition-fast);
  font-weight: 600;
  font-size: 0.88rem;
}

.cat-accordion-header:hover {
  background: var(--bg-card-hover);
}

.cat-accordion-count {
  font-weight: 700;
  font-size: 0.85rem;
}

/* ── Back Navigation ───────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: color var(--transition-fast);
}

.back-link:hover {
  color: var(--lg-red);
}

/* ── Trend Indicator ───────────────────────────────────────────────────────── */
.trend-up   { color: var(--sev-critical); }
.trend-down { color: var(--sev-minor); }
.trend-flat { color: var(--text-muted); }

/* ── Toast / Copy Feedback ─────────────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-nav);
  color: var(--text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
  pointer-events: none;
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive: Violations ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .retailer-grid { grid-template-columns: 1fr; }
  .evidence-gallery { grid-template-columns: 1fr; }
  .viol-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .viol-kpi-value { font-size: 1.4rem; }
}

/* ============================================================================
   Design System Components (from handoff prototype)
   ============================================================================ */

/* ── Redesigned Top Nav ────────────────────────────────────────────────────── */
.topnav {
  background: var(--bg-nav);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0, 178, 148, 0.18);
  position: sticky;
  top: 0;
  z-index: 1030;
}
.topnav .gb-mark {
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  text-decoration: none;
  width: 138px;
}
.topnav .gb-mark img {
  display: block;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  width: 100%;
}
.topnav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}
.topnav .brand-bar {
  width: 4px;
  height: 22px;
  background: var(--gb-accent);
  border-radius: 2px;
}
.topnav .brand-title {
  color: #fff;
  display: inline-block;
  font: inherit;
  line-height: 1;
}
.topnav .nav-links {
  display: flex;
  flex: 1 1 auto;
  gap: 2px;
  margin-left: 18px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topnav .nav-links::-webkit-scrollbar { display: none; }
.topnav .nav-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 150ms var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.topnav .nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.topnav .nav-link.active {
  color: #fff;
  background: var(--lg-red);
}
.topnav .nav-form {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}
.topnav .nav-action {
  background: transparent;
  border: 0;
  font-family: inherit;
}
.topnav .nav-action:focus-visible {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28);
  outline: 0;
}
.topnav .nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topnav .client-pill {
  color: rgba(255,255,255,0.72);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 8px 4px 12px;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.topnav .client-pill img {
  background: #fff;
  border-radius: 999px;
  display: block;
  height: 20px;
  padding: 2px 5px;
  width: auto;
}
.topnav .avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--lg-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
}
.topnav .profile-menu-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  display: inline-flex;
  gap: 6px;
  padding: 0;
}
.topnav .profile-menu-toggle:hover .avatar,
.topnav .profile-menu-toggle:focus-visible .avatar {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28);
}
.profile-dropdown {
  border: 1px solid var(--border-card);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  min-width: 260px;
  padding: 10px;
}
.profile-dropdown-head {
  align-items: center;
  display: flex;
  gap: 10px;
  padding: 6px 4px 10px;
}
.impersonation-banner {
  background: #f8d26a;
  border-bottom: 1px solid #d6a600;
  color: #2b2200;
  font-size: 13px;
  font-weight: 650;
  position: relative;
  z-index: 1020;
}
.impersonation-banner-inner {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  min-height: 42px;
  padding: 6px 16px;
}
.impersonation-banner-inner span {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}
.impersonation-banner-inner form {
  margin: 0;
}
.topnav .avatar-large {
  height: 38px;
  width: 38px;
}
.profile-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  max-width: 176px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-role {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
}
.profile-meta {
  align-items: center;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 4px;
}
.profile-meta span {
  color: var(--text-muted);
  font-size: 11.5px;
}
.profile-meta strong {
  color: var(--text-secondary);
  font-size: 11.5px;
  text-align: right;
}
.profile-signout {
  align-items: center;
  border-radius: 6px;
  display: flex;
  font-size: 13px;
  gap: 8px;
}

/* ── KPI Grid (design system) ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 250ms var(--ease-out);
}
.kpi::before {
  content: '';
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  transition: height 250ms var(--ease-out);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi:hover::before { height: 0; }
.kpi.kpi-total::before { background: var(--accent-purple); }
.kpi.kpi-retailers::before { background: var(--accent-blue); }
.kpi.kpi-critical::before { background: var(--sev-critical); }
.kpi.kpi-major::before { background: var(--sev-major); }
.kpi.kpi-products::before { background: var(--accent-green); }
.kpi.kpi-exposure::before { background: var(--lg-red); }
.kpi-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  font-feature-settings: 'tnum' 1;
}
.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Hero Alert Banner ────────────────────────────────────────────────────── */
.hero-alert {
  background: linear-gradient(135deg, #fff 0%, rgba(159, 18, 57, 0.06) 100%);
  border: 1px solid rgba(159, 18, 57, 0.18);
  border-left: 4px solid var(--sev-critical);
  border-radius: 14px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  transition: all 250ms var(--ease-out);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
  text-decoration: none;
  color: inherit;
}
.hero-alert:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: inherit;
  text-decoration: none;
}
.hero-alert-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--sev-critical);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.hero-alert-count {
  font-size: 22px;
  font-weight: 800;
  color: var(--sev-critical);
  letter-spacing: -0.01em;
}
.hero-alert-meta {
  font-size: 13px;
  color: var(--text-secondary);
}
.hero-alert-detail {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Coverage Bar ─────────────────────────────────────────────────────────── */
.cov-track {
  background: var(--bg-code);
  border-radius: 10px;
  height: 36px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}
.cov-fill {
  background: linear-gradient(90deg, var(--accent-green), var(--accent-teal));
  height: 100%;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  transition: width 1s var(--ease-out);
}

/* Catalog readiness */
.catalog-readiness {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 1.25rem;
}
.readiness-section {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.readiness-caption {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.source-stack {
  background: var(--bg-code);
  border-radius: 8px;
  display: flex;
  height: 30px;
  overflow: hidden;
}
.source-segment {
  align-items: center;
  color: #fff;
  display: inline-flex;
  font-size: 11.5px;
  font-weight: 800;
  justify-content: center;
  min-width: 24px;
  text-decoration: none;
}
.source-segment:hover {
  color: #fff;
  filter: brightness(0.96);
}
.source-client { background: var(--accent-green); }
.source-reference { background: var(--accent-blue); }
.source-discovery { background: var(--sev-moderate); }
.source-internal { background: var(--status-unchanged); }
.source-neutral { background: var(--status-unchanged); }
.source-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.source-legend-item {
  align-items: center;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 12px;
  gap: 6px;
  text-decoration: none;
}
.source-legend-item:hover { color: var(--text-primary); }
.source-legend-item strong {
  color: var(--text-primary);
  font-size: 12.5px;
}
.source-dot {
  border-radius: 2px;
  display: inline-block;
  height: 9px;
  width: 9px;
}
.readiness-state-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.readiness-state-row > div,
.readiness-status-link {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: inherit;
  display: block;
  padding: 10px 12px;
  text-decoration: none;
}
.readiness-status-link:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  color: inherit;
  text-decoration: none;
}
.readiness-value {
  color: var(--text-primary);
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.readiness-label {
  color: var(--text-muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-top: 5px;
  text-transform: uppercase;
}
.latest-pricing-line {
  align-items: center;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12.5px;
  gap: 5px;
  padding-top: 12px;
}
.latest-pricing-line strong { color: var(--text-primary); }
.term-glossary {
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 11.5px;
  gap: 6px 14px;
  padding-top: 12px;
}
.term-glossary strong {
  color: var(--text-secondary);
  margin-right: 3px;
}
.readiness-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.readiness-actions .btn {
  border-radius: 6px;
  font-size: 12px;
  padding: 6px 12px;
}

/* Pricing history */
.history-kpi-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 18px;
}

.map-change-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.map-change-row {
  color: inherit;
  display: block;
  padding: 14px 18px;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.map-change-list.is-compact .map-change-row {
  padding: 11px 16px;
}

.map-change-row + .map-change-row {
  border-top: 1px solid var(--border-light);
}

.map-change-row:hover {
  background: var(--bg-card-hover);
  color: inherit;
  text-decoration: none;
}

.map-change-main,
.map-change-prices,
.map-change-meta {
  align-items: center;
  display: flex;
  gap: 8px;
}

.map-change-main {
  justify-content: space-between;
}

.map-change-product {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-change-prices {
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
  margin-top: 8px;
}

.map-change-prices strong {
  color: var(--text-primary);
}

.map-change-prices em {
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-style: normal;
  padding: 2px 7px;
}

.map-change-meta {
  color: var(--text-muted);
  flex-wrap: wrap;
  font-size: 11.5px;
  margin-top: 6px;
}

.map-change-meta span:not(:last-child)::after {
  color: var(--border-strong);
  content: "·";
  margin-left: 8px;
}

.mini-upload-strip {
  color: var(--text-muted);
  display: inline-flex;
  flex-wrap: wrap;
  font-size: 11.5px;
  gap: 6px;
  margin-left: auto;
}

.mini-upload-strip a {
  color: var(--text-secondary);
  font-weight: 700;
  text-decoration: none;
}
.history-retailer-list {
  display: flex;
  flex-direction: column;
  padding: 6px 12px;
}
.history-retailer-row {
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 4px;
}
.history-retailer-row:last-child { border-bottom: 0; }
.history-retailer-row strong {
  color: var(--text-primary);
  display: block;
  font-size: 13px;
}
.history-retailer-row span {
  color: var(--text-muted);
  font-size: 11.5px;
}
.history-retailer-metrics {
  display: flex;
  flex-direction: column;
  text-align: right;
}
.history-export-btn {
  align-items: center;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  width: 34px;
}

/* ── Trend Bars (sparkline chart) ─────────────────────────────────────────── */
.trend-row {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 80px;
  padding: 8px 4px;
}
.trend-bar {
  flex: 1;
  background: linear-gradient(to top, var(--sev-critical), var(--sev-major));
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  opacity: 0.85;
  transition: opacity 150ms;
}
.trend-bar:hover { opacity: 1; }
.trend-labels {
  display: flex;
  gap: 4px;
  padding: 0 4px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.trend-labels span { flex: 1; text-align: center; }

/* ── Quick Action Tiles ───────────────────────────────────────────────────── */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.qa {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 250ms var(--ease-out);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
}
.qa:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--lg-red);
  color: inherit;
}
.qa-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.qa-title { font-weight: 600; font-size: 13.5px; }
.qa-desc { font-size: 11.5px; color: var(--text-muted); }

/* ── Page Header ──────────────────────────────────────────────────────────── */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-actions {
  display: flex;
  gap: 10px;
}

/* ── Jump-to bar ──────────────────────────────────────────────────────────── */
.jump-bar {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.jump-bar-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 6px;
}

/* ── Retailer attention row (dashboard) ───────────────────────────────────── */
.retailer-row {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 150ms;
  text-decoration: none;
  color: inherit;
}
.retailer-row:hover {
  background: var(--bg-card-hover);
  color: inherit;
}
.retailer-row + .retailer-row {
  border-top: 1px solid var(--border-light);
}
.retailer-row-count {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  width: 36px;
  text-align: right;
}

/* ── Source Badges (design system) ─────────────────────────────────────────── */
.src-lg {
  background: rgba(16,185,129,0.10);
  color: var(--accent-green);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}
.src-auto {
  background: rgba(245,158,11,0.10);
  color: var(--status-warning);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
}

.origin-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
}

.origin-client {
  background: rgba(16,185,129,0.10);
  color: var(--accent-green);
}

.origin-reference {
  background: rgba(59,130,246,0.12);
  color: var(--accent-blue);
}

.origin-discovery {
  background: rgba(245,158,11,0.12);
  color: var(--status-warning);
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 420px);
  gap: 22px;
  align-items: stretch;
  margin: 34px auto 0;
  max-width: 980px;
}

.login-brand-panel {
  background:
    linear-gradient(135deg, rgba(0, 130, 114, 0.12), rgba(0, 178, 148, 0.04)),
    var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 34px;
}

.login-gb-logo {
  display: block;
  height: 42px;
  margin-bottom: 38px;
  width: auto;
}

.login-overline {
  color: var(--lg-red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.login-brand-panel h1 {
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 14px;
  max-width: 560px;
}

.login-brand-panel p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  max-width: 620px;
}

.login-domain-chip {
  align-items: center;
  background: rgba(0, 130, 114, 0.10);
  border: 1px solid rgba(0, 130, 114, 0.22);
  border-radius: var(--radius-pill);
  color: var(--lg-red);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 7px;
  margin-top: 24px;
  padding: 7px 11px;
}

.login-card {
  align-self: center;
}

.login-card-body {
  padding: 1.4rem 1.5rem 1.5rem;
}

.login-sso-btn {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
}

.demo-login-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.demo-login-hint {
  color: var(--muted, #6c757d);
  font-size: 0.8rem;
  margin: 0.75rem 0 0;
  text-align: center;
}

.auth-divider {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 10px;
  letter-spacing: 0.06em;
  margin: 22px 0 16px;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--border-light);
  content: '';
  flex: 1;
  height: 1px;
}

.token-disabled {
  align-items: center;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  display: flex;
  font-size: 0.84rem;
  gap: 9px;
  padding: 12px 14px;
}

/* ── Grid helpers ─────────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.upload-grid {
  align-items: start;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
}

@media (max-width: 1320px) {
  .topnav .client-pill {
    display: none;
  }
}

@media (max-width: 880px) {
  .grid-2,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-shell {
    margin-top: 16px;
  }

  .login-brand-panel {
    padding: 24px;
  }

  .login-brand-panel h1 {
    font-size: 1.55rem;
  }

  .topnav {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    padding: 10px 14px;
  }

  .topnav .nav-links {
    flex: 1 1 100%;
    margin-left: 0;
  }

}

/* ── Border helpers ───────────────────────────────────────────────────────── */
.border-strong {
  color: var(--border-light);
}

/* MAP Calendar */
.map-calendar-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) 140px 140px 150px minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px 16px;
  position: relative;
  z-index: 15;
}
.map-calendar-controls.glass-card {
  overflow: visible;
}
.sku-picker {
  position: relative;
  z-index: 20;
}
.sku-picker-results {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  display: none;
  left: 0;
  margin-top: 6px;
  max-height: 320px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 1000;
}
.sku-picker-results.is-open {
  display: block;
}
.sku-picker-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  color: inherit;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
  text-align: left;
  width: 100%;
}
.sku-picker-option:hover,
.sku-picker-option:focus {
  background: var(--bg-card-hover);
}
.sku-picker-option strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.sku-picker-option small {
  color: var(--text-muted);
  display: block;
  font-size: 11.5px;
  margin-top: 2px;
}
.sku-picker-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}
.sku-picker-badges em,
.sku-picker-empty {
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  padding: 2px 8px;
}
.sku-picker-badges em {
  background: var(--bg-code);
}
.sku-picker-badges .map-status-set {
  background: rgba(16,185,129,0.12);
  color: var(--accent-green);
}
.sku-picker-badges .map-status-unset {
  background: var(--bg-code);
  color: var(--text-secondary);
}
.sku-picker-empty {
  display: block;
  padding: 12px;
}
.map-status-pill {
  align-items: center;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  display: inline-flex;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  white-space: nowrap;
}
.map-status-pill.map-status-set {
  background: rgba(16,185,129,0.10);
  color: var(--accent-green);
}
.map-status-pill.map-status-unset {
  background: var(--bg-code);
  color: var(--text-secondary);
}
.map-calendar-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}
.calendar-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.calendar-summary-card,
.map-calendar-card {
  overflow: hidden;
}
.calendar-weekdays,
.calendar-week {
  display: grid;
  grid-template-columns: 96px repeat(7, minmax(0, 1fr));
}
.calendar-weekdays {
  background: var(--bg-code);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.calendar-weekdays > div {
  padding: 10px 12px;
  border-right: 1px solid var(--border-subtle);
}
.calendar-week-label-head,
.calendar-week-label {
  background: var(--bg-code);
  border-right: 1px solid var(--border-subtle);
  color: var(--text-muted);
}
.calendar-week-label {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 132px;
  padding: 10px 12px;
}
.calendar-week-label strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
}
.calendar-day {
  min-height: 132px;
  padding: 10px;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-card);
}
.calendar-day.is-weekend {
  background: rgba(15, 23, 42, 0.035);
}
.calendar-day.is-holiday {
  background: rgba(245, 158, 11, 0.10);
}
.calendar-day.is-sales-event {
  background: rgba(220, 38, 38, 0.08);
}
.calendar-week.is-current-week .calendar-week-label,
.calendar-week.is-current-week .calendar-day {
  background: rgba(0, 130, 114, 0.055);
}
.calendar-week.is-current-week .calendar-week-label {
  box-shadow: inset 3px 0 0 var(--accent-green);
}
.calendar-day.is-today .calendar-day-num {
  align-items: center;
  background: var(--lg-red);
  border-radius: 999px;
  color: white;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}
.calendar-day.is-empty {
  color: var(--text-muted);
}
.calendar-day-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-height: 24px;
}
.calendar-day-num {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
}
.calendar-mark {
  max-width: 88px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
}
.calendar-day-tags {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.calendar-map-price {
  margin-top: 12px;
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 800;
}
.calendar-campaign {
  margin-top: 5px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-origin-chip {
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-range,
.calendar-no-map {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.68rem;
}
@media (max-width: 1020px) {
  .map-calendar-controls,
  .calendar-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .map-calendar-actions {
    grid-column: 1 / -1;
  }
}
@media (max-width: 720px) {
  .map-calendar-controls,
  .calendar-summary-grid {
    grid-template-columns: 1fr;
  }
  .calendar-weekdays,
  .calendar-week {
    min-width: 860px;
  }
  .map-calendar-card {
    overflow-x: auto;
  }
}
