/* ═══════════════════════════════════════════════════════════════
   CRALGO — Retail Replenishment Intelligence Platform
   Premium Design System v2
   Brand Color: #914523
   ═══════════════════════════════════════════════════════════════ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  /* ── Brand / Primary ── */
  --brand-50: #fff3ec;
  --brand-100: #ffe6d6;
  --brand-200: #ffc9a8;
  --brand-300: #ffaa7a;
  --brand-400: #ff8b4d;
  --brand-500: #f25424;
  --brand-600: #d64215;
  --brand-700: #a8310c;
  --brand-800: #80260a;
  --brand-900: #661f09;

  /* ── Accent / Indigo ── */
  --accent-50: #eef2ff;
  --accent-100: #e0e7ff;
  --accent-500: #6366f1;
  --accent-600: #4f46e5;
  --accent-700: #4338ca;

  /* ── Backgrounds ── */
  --bg-main: #faf8f6;
  --bg-card: #ffffff;
  --bg-subtle: #f8f6f3;
  --bg-dark: #1a1008;
  --bg-dark-alt: #2a1c10;

  /* ── Text ── */
  --text-main: #1a1008;
  --text-secondary: #3d2e1c;
  --text-muted: #7a6c5d;
  --text-light: #a59888;
  --text-on-dark: #ffffff;
  --text-on-dark-muted: rgba(255, 255, 255, 0.7);

  /* ── Status ── */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #166534;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #92400e;

  --danger-50: #fef2f2;
  --danger-100: #fee2e2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #991b1b;

  --info-50: #eff6ff;
  --info-100: #dbeafe;
  --info-500: #3b82f6;
  --info-700: #1d4ed8;

  /* ── Borders & Shadows ── */
  --border-color: #e8e0d8;
  --border-light: #f0ebe5;
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.04);
  --shadow-md:
    0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg:
    0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.03);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.04);
  --shadow-brand: 0 4px 14px rgba(242, 84, 36, 0.25);

  /* ── Radius ── */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* ── Typography ── */
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */
.font-bold {
  font-weight: 600;
}
.font-extrabold {
  font-weight: 800;
}
.text-muted {
  color: var(--text-muted);
}
.text-brand {
  color: var(--brand-500);
}
.text-large {
  font-size: 1.25rem;
}
.text-xs {
  font-size: 0.75rem;
}
.text-sm {
  font-size: 0.8125rem;
}
.text-right {
  text-align: right;
}
.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-main {
  color: var(--text-main);
}
.text-danger {
  color: var(--danger-600);
}
.text-primary {
  color: var(--brand-500);
}
.mt-2 {
  margin-top: 0.25rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.gap-3 {
  gap: 0.75rem;
}

.icon-primary {
  color: var(--brand-500);
}
.icon-success {
  color: var(--success-500);
}
.icon-warning {
  color: var(--warning-500);
}
.icon-danger {
  color: var(--danger-500);
}
.icon-info {
  color: var(--info-500);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   PREMIUM HEADER (All Pages)
   ═══════════════════════════════════════════════════════════════ */

.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.header-brand img {
  height: 32px;
  width: auto;
}

.header-brand-text {
  font-family: 'Bauhaus 93', 'Fredoka', var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-500);
  letter-spacing: -0.01em;
}

.header-brand .brand-tag {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(145, 69, 35, 0.25);
  color: var(--brand-200);
  border: 1px solid rgba(145, 69, 35, 0.35);
}

/* ── Main Nav ── */
.main-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  margin-right: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: white;
  font-weight: 600;
  box-shadow: var(--shadow-brand);
}

/* ── Nav Dropdown ── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

.nav-dropdown-trigger i {
  width: 14px;
  height: 14px;
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  min-width: 220px;
  box-shadow: var(--shadow-xl);
  z-index: 200;
  padding-top: 0.75rem;
}

/* Invisible bridge that keeps hover alive when moving to the menu */
.nav-dropdown-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

/* ── Demo Sub-Navigation (shown on demo pages) ── */
.demo-subnav {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 0.375rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.demo-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-lg);
  white-space: nowrap;
  transition: all 0.2s;
}

.demo-subnav a:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.demo-subnav a.active {
  background: var(--brand-500);
  color: white;
  box-shadow: var(--shadow-brand);
}

.demo-subnav a i {
  width: 15px;
  height: 15px;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all 0.15s;
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--bg-subtle);
  color: var(--brand-600);
}

.nav-dropdown-menu a.active i {
  color: var(--brand-500);
  opacity: 1;
}

.nav-dropdown-menu a i {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* ── Header Right ── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.3rem 0.75rem 0.3rem 0.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}

.user-profile .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(145, 69, 35, 0.4);
}

.user-profile .user-role {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: inherit;
  outline: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn i {
  width: 16px;
  height: 16px;
}

.btn:disabled {
  background: var(--border-light) !important;
  color: var(--text-light) !important;
  cursor: not-allowed;
  box-shadow: none !important;
  transform: none !important;
}

.btn-brand {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-brand:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-500));
  box-shadow: 0 6px 20px rgba(145, 69, 35, 0.35);
  transform: translateY(-1px);
}

.btn-brand-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: white;
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  box-shadow: 0 6px 18px rgba(145, 69, 35, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--brand-50);
  border-color: var(--brand-200);
  color: var(--brand-700);
}

.btn-outline.active {
  background: var(--text-main);
  color: white;
  border-color: var(--text-main);
}

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

.btn-secondary:hover:not(:disabled) {
  background: #e8e0d8;
}

.btn-sm {
  padding: 0.375rem 0.5rem;
  border-radius: var(--radius-md);
}
.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-white {
  background: white;
  color: var(--brand-600);
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.btn-white:hover {
  background: var(--brand-50);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge i {
  width: 12px;
  height: 12px;
}

.badge-brand {
  background: var(--brand-100);
  color: var(--brand-700);
}
.badge-primary {
  background: var(--brand-100);
  color: var(--brand-700);
}
.badge-success {
  background: var(--success-100);
  color: var(--success-700);
}
.badge-warning {
  background: var(--warning-100);
  color: var(--warning-700);
}
.badge-danger {
  background: var(--danger-100);
  color: var(--danger-700);
}
.badge-neutral {
  background: var(--border-light);
  color: var(--text-muted);
}
.badge-info {
  background: var(--info-100);
  color: var(--info-700);
}

/* ═══════════════════════════════════════════════════════════════
   FORM CONTROLS
   ═══════════════════════════════════════════════════════════════ */

.filter-select {
  padding: 0.625rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  background: white;
  cursor: pointer;
  appearance: auto;
  transition: all 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(145, 69, 35, 0.12);
}

.filter-select.full-width {
  width: 100%;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-light);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.8125rem;
  color: var(--text-main);
  background: white;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(145, 69, 35, 0.12);
}

/* ═══════════════════════════════════════════════════════════════
   SHARED PAGE LAYOUTS
   ═══════════════════════════════════════════════════════════════ */

.page-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

/* ── KPI Dashboard (demo pages) ── */
.kpi-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 0.5rem;
}

.kpi-card {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--brand-50);
  transform: translate(20px, -20px);
  opacity: 0.5;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.kpi-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-header i {
  width: 16px;
  height: 16px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

/* ── Main Grid (demo-detail) ── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
  align-items: start;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section-card {
  padding: 1.5rem;
  border-radius: var(--radius-xl);
}

.card-header {
  margin-bottom: 1rem;
}
.card-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  letter-spacing: -0.01em;
}
.card-header .subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ── SKU / OTB ── */
.sku-details-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.otb-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.otb-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar.warning {
  background: linear-gradient(90deg, var(--warning-500), var(--warning-600));
}
.progress-bar.danger {
  background: linear-gradient(90deg, var(--danger-500), var(--danger-600));
}

.otb-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Intelligence Layers ── */
.intelligence-card {
  padding: 0;
}

.layer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
}

.layer-section {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.data-layer {
  background: linear-gradient(180deg, #faf8f5 0%, #f5f0eb 100%);
  border-right: 1px solid var(--border-color);
}

.intel-layer {
  background: white;
}

.layer-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.layer-badge {
  width: 26px;
  height: 26px;
  background: var(--text-main);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

.layer-badge.pulse {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  box-shadow: 0 0 0 0 rgba(145, 69, 35, 0.4);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(145, 69, 35, 0.4);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(145, 69, 35, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(145, 69, 35, 0);
  }
}

.layer-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
}

.data-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}
.data-item .label {
  color: var(--text-muted);
}
.data-item .subtext {
  font-size: 0.7rem;
  color: var(--text-light);
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

.data-item.highlight {
  padding: 0.75rem;
  background: var(--brand-50);
  border-radius: var(--radius-md);
  border: 1px dashed var(--brand-200);
}

.data-item.highlight.action-required {
  background: var(--warning-100);
  border-color: var(--warning-500);
}

/* ── Decision Layer ── */
.decision-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.recommendation-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, var(--brand-50) 0%, white 100%);
  border-radius: var(--radius-xl);
  border-left: 4px solid var(--brand-500);
  box-shadow: var(--shadow-xs);
}

.recommendation-text {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.validation-checks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.check-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.check-item i {
  width: 15px;
  height: 15px;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.action-buttons .btn {
  padding: 0.625rem 1.25rem;
}

.execution-status {
  margin-top: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
}

#execution-status-container {
  transition: opacity 0.15s ease-in-out;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.8125rem;
}

.status-indicator i {
  width: 18px;
  height: 18px;
}

.status-pending {
  background: var(--warning-100);
  color: var(--warning-700);
}
.status-success {
  background: var(--success-100);
  color: var(--success-700);
}
.status-info {
  background: var(--brand-50);
  color: var(--brand-700);
}

.status-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
}

.status-badge-inline i {
  width: 16px;
  height: 16px;
}

/* ── Action Table (demo-actions) ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 0.5rem;
  gap: 1rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

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

.table-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.table-actions .search-input-wrapper {
  width: 280px;
}

.action-card {
  padding: 0;
  overflow: visible;
}

.action-table {
  width: 100%;
  border-collapse: collapse;
}

.action-table th,
.action-table td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.action-table th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  font-weight: 700;
  background: var(--bg-subtle);
}

.action-table th:first-child {
  border-top-left-radius: var(--radius-2xl);
}
.action-table th:last-child {
  border-top-right-radius: var(--radius-2xl);
}

.action-table tbody tr {
  transition: background 0.15s;
}
.action-table tbody tr:hover {
  background: var(--brand-50);
}
.action-table tbody tr:last-child td {
  border-bottom: none;
}

.recommendation-cell {
  display: flex;
  flex-direction: column;
}
.table-action-btns {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ═══════════════════════════════════════════════════════════════
   MARKETING PAGE STYLES
   ═══════════════════════════════════════════════════════════════ */

/* ── Hero Section ── */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(
    160deg,
    var(--bg-dark) 0%,
    #2a1c10 40%,
    var(--brand-900) 100%
  );
  padding: 6rem 2rem;
  text-align: center;
  color: white;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 60% 40%,
    rgba(145, 69, 35, 0.15) 0%,
    transparent 60%
  );
  animation: hero-glow 8s ease-in-out infinite alternate;
}

@keyframes hero-glow {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-5%, 5%);
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero h1 .brand-gradient {
  background: linear-gradient(135deg, var(--brand-300), var(--brand-100));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-on-dark-muted);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
}

.hero-badge i {
  width: 14px;
  height: 14px;
  color: var(--brand-300);
}

/* ── Section Layout (marketing pages) ── */
.section {
  padding: 5rem 2rem;
}

.section-dark {
  background: var(--bg-dark);
  color: white;
}

.section-alt {
  background: var(--bg-subtle);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-tag i {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.section-header .section-tag {
  background: var(--brand-50);
  color: var(--brand-600);
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.section-header p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.section-dark .section-header .section-tag {
  background: rgba(145, 69, 35, 0.2);
  color: var(--brand-200);
}

.section-dark .section-header p {
  color: var(--text-on-dark-muted);
}

/* ── Feature Grid ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon i {
  width: 22px;
  height: 22px;
}

.fi-brand {
  background: var(--brand-100);
  color: var(--brand-600);
}
.fi-success {
  background: var(--success-100);
  color: var(--success-600);
}
.fi-warning {
  background: var(--warning-100);
  color: var(--warning-600);
}
.fi-danger {
  background: var(--danger-100);
  color: var(--danger-600);
}
.fi-info {
  background: var(--info-100);
  color: var(--info-500);
}
.fi-purple {
  background: #ede9fe;
  color: #7c3aed;
}

.feature-card h4 {
  font-size: 1rem;
  font-weight: 700;
}
.feature-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ── Stats Grid (impact page) ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card {
  text-align: center;
  padding: 2rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--brand-500);
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

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

/* ── GIF Showcase Frame ── */
.gif-showcase {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
}

.gif-showcase::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--brand-500),
    var(--brand-300),
    #7c3aed
  );
  z-index: 1;
}

.gif-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.gif-toolbar .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.gif-toolbar .dot-red {
  background: #ef4444;
}
.gif-toolbar .dot-yellow {
  background: #f59e0b;
}
.gif-toolbar .dot-green {
  background: #22c55e;
}

.gif-toolbar .toolbar-title {
  flex: 1;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gif-container {
  padding: 1rem;
  display: flex;
  justify-content: center;
  background: white;
}

.gif-container img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* ── Layers Visual (solution page) ── */
.layers-visual {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto 3rem auto;
}

.layer-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  padding: 1.75rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.layer-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.layer-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.layer-card:nth-child(1)::after {
  background: var(--info-500);
}
.layer-card:nth-child(2)::after {
  background: var(--brand-500);
}
.layer-card:nth-child(3)::after {
  background: var(--warning-500);
}
.layer-card:nth-child(4)::after {
  background: var(--success-500);
}

.layer-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.layer-card:nth-child(1) .layer-num {
  background: var(--info-100);
  color: var(--info-700);
}
.layer-card:nth-child(2) .layer-num {
  background: var(--brand-100);
  color: var(--brand-700);
}
.layer-card:nth-child(3) .layer-num {
  background: var(--warning-100);
  color: var(--warning-700);
}
.layer-card:nth-child(4) .layer-num {
  background: var(--success-100);
  color: var(--success-700);
}

.layer-card h4 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.layer-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

.tracking-in {
  animation: tracking-in 0.4s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

@keyframes tracking-in {
  0% {
    letter-spacing: -0.5em;
    opacity: 0;
  }
  40% {
    opacity: 0.6;
  }
  100% {
    opacity: 1;
  }
}

.animate-pulse {
  animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-slow {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fade-up 0.6s ease-out both;
}
.fade-up-d1 {
  animation-delay: 0.1s;
}
.fade-up-d2 {
  animation-delay: 0.2s;
}
.fade-up-d3 {
  animation-delay: 0.3s;
}

@keyframes count-up {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ── Tailwind-compat ── */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.h-8 {
  height: 2rem;
}
.w-8 {
  width: 2rem;
}
.rounded-full {
  border-radius: var(--radius-full);
}
.rounded-xl {
  border-radius: var(--radius-lg);
}
.p-4 {
  padding: 1rem;
}
.bg-green-100 {
  background: var(--success-100);
}
.text-green-600 {
  color: var(--success-600);
}
.text-green-800 {
  color: var(--success-700);
}
.bg-blue-100 {
  background: var(--info-100);
}
.text-blue-600 {
  color: var(--info-500);
}
.text-blue-800 {
  color: var(--info-700);
}
.bg-yellow-100 {
  background: var(--warning-100);
}
.text-yellow-600 {
  color: var(--warning-600);
}
.text-yellow-800 {
  color: var(--warning-700);
}
.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.border {
  border-width: 1px;
  border-style: solid;
}
.border-green-200 {
  border-color: #bbf7d0;
}
.border-blue-200 {
  border-color: #bfdbfe;
}
.border-yellow-200 {
  border-color: #fef08a;
}
.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ── Tablet (≤ 1024px) ── */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
  .layer-grid {
    grid-template-columns: 1fr;
  }
  .data-layer {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .layers-visual {
    grid-template-columns: 1fr 1fr;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .table-actions {
    flex-wrap: wrap;
  }

  .left-column,
  .right-column {
    min-width: 0;
  }

  .gif-showcase {
    margin: 0 1rem;
  }
  .gif-container img {
    width: 100%;
    height: auto;
  }
}

/* ── Mobile (≤ 768px) ── */
@media (max-width: 768px) {
  /* Header — collapse nav */
  .site-header-inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    height: auto;
    padding: 0.75rem 1rem;
  }

  .main-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0.125rem;
    padding-bottom: 0.25rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }

  .header-actions {
    display: none;
  }

  /* Demo Sub-Nav — horizontal scroll */
  .demo-subnav {
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .demo-subnav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
  }

  .demo-subnav a i {
    width: 13px;
    height: 13px;
  }

  /* KPI Dashboard */
  .kpi-dashboard {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .kpi-card {
    padding: 0.75rem;
  }
  .kpi-card .value {
    font-size: 1.25rem;
  }
  .kpi-card .label {
    font-size: 0.65rem;
  }

  /* Layer cards / Intelligence panel */
  .validation-checks {
    grid-template-columns: 1fr;
  }
  .action-buttons {
    flex-direction: column;
  }
  .action-buttons .btn {
    width: 100%;
  }

  /* Content sections */
  .feature-grid,
  .stats-grid,
  .layers-visual {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero {
    padding: 3rem 1.25rem;
  }
  .hero-content {
    padding: 0 0.5rem;
  }
  .section {
    padding: 2.5rem 1.25rem;
  }
  .section-header h2 {
    font-size: 1.75rem;
  }
  .section-header p {
    font-size: 0.875rem;
  }

  /* OTB bar */
  .otb-details {
    flex-direction: column;
    gap: 0.375rem;
  }

  /* Tables — horizontal scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Cards */
  .card {
    padding: 1rem;
    border-radius: var(--radius-lg);
  }
  .intelligence-card .layer-header h3 {
    font-size: 0.9rem;
  }

  /* GIF showcase */
  .gif-showcase {
    margin: 0;
    border-radius: var(--radius-lg);
  }
  .gif-container img {
    width: 100%;
    height: auto;
  }

  /* Data list items */
  .data-item {
    padding: 0.375rem 0;
  }
  .data-item .label {
    font-size: 0.7rem;
  }
  .data-item .value {
    font-size: 0.8rem;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 1rem;
    font-size: 0.75rem;
  }

  /* Store/SKU selectors */
  .store-selector {
    flex-direction: column;
    gap: 0.5rem;
  }
  .store-selector select {
    width: 100%;
  }

  /* Selector row */
  .selector-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Steps grid (How it works) */
  .steps {
    grid-template-columns: 1fr !important;
  }

  /* Methodology page formulas */
  .method-section {
    padding: 1.25rem;
  }
  .formula-box {
    font-size: 0.8rem;
    padding: 0.75rem;
    overflow-x: auto;
  }
  .example-box {
    padding: 0.75rem;
  }
  .toc-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Small Mobile (≤ 480px) ── */
@media (max-width: 480px) {
  /* Header — minimal */
  .site-header-inner {
    padding: 0.5rem 0.75rem;
  }

  .main-nav {
    gap: 0;
    justify-content: flex-start;
  }

  .nav-link {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
  }

  .nav-dropdown-trigger {
    font-size: 0.7rem;
  }

  /* Hero */
  .hero h1 {
    font-size: 1.5rem;
  }
  .hero p {
    font-size: 0.85rem;
  }
  .hero {
    padding: 2.5rem 1rem;
  }
  .hero-cta {
    flex-direction: column;
    gap: 0.75rem;
  }
  .hero-cta .btn {
    width: 100%;
    text-align: center;
  }
  .hero-badges {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }

  /* KPIs */
  .kpi-dashboard {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .card {
    padding: 0.75rem;
  }
  .layer-badge {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }
  .layer-header h3 {
    font-size: 0.85rem;
  }

  /* Buttons */
  .btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  .action-buttons {
    gap: 0.5rem;
  }

  /* Section tags */
  .section-tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }

  /* Section headers */
  .section-header h2 {
    font-size: 1.4rem;
  }
  .section-header p {
    font-size: 0.8rem;
  }
  .section {
    padding: 2rem 1rem;
  }

  /* Demo subnav — icon only on tiny screens */
  .demo-subnav a {
    padding: 0.4rem 0.5rem;
    font-size: 0.65rem;
  }

  /* Recommendation box */
  .recommendation-text {
    font-size: 1rem;
  }

  /* Methodology */
  .method-section h3 {
    font-size: 1rem;
  }
  .method-number {
    width: 24px;
    height: 24px;
    font-size: 0.65rem;
  }

  /* Impact stats */
  .stat-card {
    padding: 1rem;
  }
  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  /* Footer */
  .site-footer {
    padding: 1rem 0.75rem;
  }
}
