/* ============================================================================
   POTTEL ENTERPRISE KPI DASHBOARD — TOKEN & SPACING SYSTEM
   Calibrated with: enterprise-dashboard-design, laws-of-ux, design-taste-frontend
   8px Baseline Rhythm • 24px Symmetric Gutter • Strict Edge Alignment
   ============================================================================ */

:root {
  /* Pottel Official Brand Palette (from Pottel Brand Foundation PDF) */
  --gold-400: #FBBF24;
  --gold-500: #F59E0B;
  --gold-600: #D97706;
  --gold-700: #B45309;
  --gold-soft: #FEF3C7;
  --gold-tint: #FFFBEB;

  --amber-500: #EA580C;
  --amber-soft: #FFEDD5;

  /* Surfaces */
  --bg-page: #F6F7FB;
  --surface-white: #FFFFFF;
  --surface-lavender: #ECEEF5;
  --surface-soft: #F2F4F8;
  --border-subtle: #E4E7F0;
  --border-strong: #D5D9E6;

  /* Typography Hierarchy */
  --text-main: #18181B;
  --text-sub: #52525B;
  --text-muted: #71717A;

  /* Spacing & Gutter Tokens (8px baseline grid) */
  --container-max: 1380px;
  --gutter-half: 12px;   /* 12px inset per card = 24px total gutter between cards */
  --gutter-full: 24px;   /* 24px gap everywhere: Header->Row1, Row1->Row2, Col1->Col2 */
  --card-pad-y: 28px;
  --card-pad-x: 32px;
  --header-to-body-gap: 20px;

  /* Shape Lock */
  --radius-card: 24px;
  --radius-inner: 14px;
  --radius-control: 12px;
  --radius-pill: 9999px;

  /* Tinted Shadows (No pure black drop shadows) */
  --shadow-card: 0 14px 34px -10px rgba(24, 28, 50, 0.05), 0 2px 6px -1px rgba(24, 28, 50, 0.025);
  --shadow-hero: 0 18px 40px -12px rgba(217, 119, 6, 0.08), 0 4px 10px -2px rgba(24, 28, 50, 0.03);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 111, 121, 0.25) transparent;
}

html {
  background-color: var(--bg-page);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Custom Sleek Scrollbar (from spacing-calibration.md) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 111, 121, 0.25);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 111, 121, 0.45);
}

/* Accessible Focus Ring (WCAG 2.2) */
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* Subtle 3D White Spheres from Pottel PDF */
.bg-sphere {
  position: fixed;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFFFFF 0%, #EEF0F7 65%, #DCE1EE 100%);
  box-shadow: 0 24px 50px rgba(24, 28, 50, 0.06), inset -8px -10px 20px rgba(190, 198, 220, 0.3);
  pointer-events: none;
  z-index: 0;
}

.sphere-top-right {
  width: 150px;
  height: 150px;
  top: -45px;
  right: 4%;
  opacity: 0.65;
}

.sphere-bottom-left {
  width: 104px;
  height: 104px;
  bottom: 5%;
  left: -28px;
  opacity: 0.55;
}

/* ============================================================================
   TOP HEADER (Height Capped at 76px, Single-Row Alignment)
   Left/Right Padding = 40px (Matches 28px canvas pad + 12px card inset = 40px!)
   ============================================================================ */
.pottel-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 76px;
  background: rgba(246, 247, 251, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.pottel-logo-svg {
  width: 78px;
  height: 50px;
  display: block;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badges {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill-gold {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #D97706 0%, #F59E0B 50%, #FBBF24 100%);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
}

.sync-dot.loading {
  background: var(--gold-500);
}

.page-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Header Controls Grouped by Law of Proximity */
.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-strong);
}

/* Date Range Picker Control (100% Vietnamese Custom Popover) */
.date-range-filter {
  position: relative;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.date-range-filter:hover,
.date-range-filter.open {
  border-color: var(--gold-500);
}

.date-range-filter.open {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.calendar-icon {
  color: var(--gold-600);
  flex-shrink: 0;
  margin-right: 2px;
}

.date-trigger-btn {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', 'Be Vietnam Pro', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 7px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.date-trigger-btn:hover,
.date-trigger-btn.active {
  background-color: var(--gold-100);
  color: var(--gold-800);
}

.date-sep {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  user-select: none;
}

/* Custom Vietnamese Calendar Dropdown */
.vn-calendar-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 312px;
  background: #FFFFFF;
  border-radius: 20px;
  border: 1px solid rgba(24, 24, 27, 0.08);
  box-shadow: 0 22px 48px -12px rgba(24, 28, 50, 0.18), 0 4px 14px rgba(24, 28, 50, 0.06);
  padding: 16px;
  z-index: 350;
  display: none;
  user-select: none;
}

.vn-calendar-popover.open {
  display: block;
}

.vn-cal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.vn-cal-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 12px;
  border: 1.5px solid var(--border-subtle);
  background: #FAFAFC;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.vn-cal-tab:hover {
  border-color: var(--gold-400);
}

.vn-cal-tab.active {
  background: var(--surface-cream);
  border-color: var(--gold-500);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
}

.vn-cal-tab-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.vn-cal-tab.active .vn-cal-tab-label {
  color: var(--gold-700);
}

.vn-cal-tab-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.vn-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.vn-cal-month-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.vn-cal-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vn-cal-nav-btn:hover {
  border-color: var(--gold-500);
  background: var(--gold-50);
  color: var(--gold-700);
}

.vn-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 6px;
}

.vn-cal-weekdays span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 4px 0;
}

.vn-cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  column-gap: 2px;
}

.vn-cal-day {
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 9px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.vn-cal-day:hover:not(:disabled) {
  background-color: var(--gold-100);
  color: var(--gold-800);
}

.vn-cal-day.other-month {
  color: #D4D4D8;
  font-weight: 500;
}

.vn-cal-day:disabled {
  color: #E4E4E7;
  cursor: not-allowed;
  opacity: 0.55;
}

.vn-cal-day.in-range {
  background-color: #FEF3C7;
  color: #92400E;
  border-radius: 6px;
}

.vn-cal-day.is-start,
.vn-cal-day.is-end {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #FFFFFF !important;
  font-weight: 800;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.28);
}

.vn-cal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.vn-cal-reset-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.vn-cal-reset-btn:hover {
  color: var(--gold-700);
  background: var(--gold-50);
}

.vn-cal-done-btn {
  border: none;
  background: var(--text-main);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.vn-cal-done-btn:hover {
  background: #27272A;
}

.clean-select {
  height: 40px;
  width: 162px;
  padding: 0 26px 0 11px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  background-color: var(--surface-white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2352525B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  appearance: none;
  -webkit-appearance: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.clean-select:hover {
  border-color: var(--gold-500);
}

.clean-select.select-period {
  width: 106px;
}

.clean-select.select-campaign {
  width: 162px;
}

.clean-select.select-compact {
  min-width: 0;
  width: 108px;
  height: 32px;
  padding: 0 26px 0 10px;
  font-size: 12px;
  border-radius: 10px;
  background-position: right 8px center;
}

.clean-select.full-width {
  width: 100%;
  max-width: none;
}

.btn-primary-gold {
  height: 40px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  border: none;
  background: linear-gradient(135deg, #D97706 0%, #F59E0B 60%, #FBBF24 100%);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 16px -4px rgba(217, 119, 6, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary-gold:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -4px rgba(217, 119, 6, 0.45);
}

.btn-primary-gold:active {
  transform: translateY(0);
}

.btn-ghost {
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  background: var(--surface-white);
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--gold-500);
  background: var(--gold-tint);
}

.btn-icon-only {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  background: var(--surface-white);
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.btn-icon-only:hover {
  color: var(--gold-600);
  border-color: var(--gold-500);
  background: var(--gold-tint);
}

/* ============================================================================
   MAIN CANVAS & GRIDSTACK SYMMETRIC 24PX GUTTER
   padding-top: 12px + 12px card inset = 24px gap below header!
   padding-x: 28px + 12px card inset = 40px outer margin (matches header 40px!)
   ============================================================================ */
.main-canvas {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 28px 40px;
}

/* CRITICAL FIX: Do NOT set width:100% / height:100% on .grid-stack-item-content!
   Let top/right/bottom/left = 12px define the box so both X and Y gutters are 24px! */
.grid-stack > .grid-stack-item > .grid-stack-item-content {
  top: var(--gutter-half) !important;
  right: var(--gutter-half) !important;
  bottom: var(--gutter-half) !important;
  left: var(--gutter-half) !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
}

/* Remove Gridstack's bottom-right expand/resize icon completely */
.grid-stack > .grid-stack-item > .ui-resizable-handle {
  display: none !important;
  background: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pottel-card {
  background: var(--surface-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: var(--card-pad-y) var(--card-pad-x);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease;
}

.hero-card {
  box-shadow: var(--shadow-hero);
  border-color: rgba(245, 158, 11, 0.28);
}

.surface-soft {
  background: var(--surface-lavender);
  border-color: rgba(255, 255, 255, 0.9);
}

/* Card Header */
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.title-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.step-index {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #F59E0B 0%, #FBBF24 60%, #FDE68A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  flex-shrink: 0;
}

.step-index.step-sm {
  font-size: 26px;
}

.card-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
  white-space: nowrap;
}

.card-heading {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.card-heading.heading-sm {
  font-size: 17px;
}

.card-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.completion-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--gold-soft);
  color: var(--gold-700);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
}

.completion-badge.badge-warm {
  background: var(--amber-soft);
  color: var(--amber-500);
}

.completion-badge.achieved {
  background: #DCFCE7;
  color: #15803D;
}

.drag-handle {
  color: #CBD5E1;
  font-size: 17px;
  line-height: 1;
  cursor: grab;
  padding: 4px 6px;
  border-radius: 8px;
  user-select: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.drag-handle:hover {
  color: var(--text-main);
  background: var(--surface-soft);
}

/* ============================================================================
   HERO FOCAL METRIC (01. REACH & 02. ENGAGEMENT)
   ============================================================================ */
.focal-metric {
  margin: auto 0;
  padding: 8px 0;
}

.focal-value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 52px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.focal-caption {
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-sub);
}

/* KPI Progress & Clean Inline Target Input */
.kpi-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: var(--surface-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-gold {
  background: linear-gradient(90deg, #D97706 0%, #F59E0B 55%, #FBBF24 100%);
}

.fill-amber {
  background: linear-gradient(90deg, #EA580C 0%, #F97316 55%, #FB923C 100%);
}

.target-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.target-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
}

.target-inline-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  padding: 4px 6px 4px 12px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.target-inline-box:focus-within {
  background: var(--surface-white);
  border-color: var(--gold-500);
}

.target-input {
  width: 120px;
  border: none;
  background: transparent;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  text-align: right;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.btn-target-save {
  height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  background: var(--text-main);
  color: var(--gold-400);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-target-save:hover {
  opacity: 0.9;
}

/* ============================================================================
   03. CHART AREA & 04. TOP 4 CAMPAIGNS (20px Header-to-Content Gap)
   ============================================================================ */
.mode-switch {
  display: inline-flex;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: var(--radius-control);
  gap: 4px;
}

.switch-btn {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.switch-btn.active {
  background: var(--surface-white);
  color: var(--text-main);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.chart-area {
  flex: 1;
  min-height: 0;
  margin-top: var(--header-to-body-gap);
  position: relative;
  width: 100%;
}

.top-campaigns-list {
  flex: 1;
  min-height: 0;
  margin-top: var(--header-to-body-gap);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.campaign-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-white);
  border-radius: var(--radius-inner);
  padding: 12px 16px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.campaign-item:hover {
  border-color: var(--gold-400);
  transform: translateY(-1px);
}

.campaign-item.selected {
  border-color: var(--gold-500);
  background: var(--gold-tint);
}

.campaign-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.campaign-name-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.campaign-rank-num {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.campaign-item:nth-child(1) .campaign-rank-num,
.campaign-item:nth-child(2) .campaign-rank-num,
.campaign-item:nth-child(3) .campaign-rank-num {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  color: #FFFFFF;
}

.campaign-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.campaign-val-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.camp-kpi-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--gold-100);
  color: var(--gold-800);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(245, 158, 11, 0.28);
  transition: all 0.15s ease;
}

.camp-kpi-badge:hover {
  background: var(--gold-500);
  color: #FFFFFF;
}

.camp-kpi-badge.achieved {
  background: #DCFCE7;
  color: #15803D;
  border-color: rgba(21, 128, 61, 0.25);
}

.camp-kpi-badge.empty {
  background: #F4F5F8;
  color: var(--text-muted);
  border-color: transparent;
  font-weight: 700;
}

.camp-kpi-badge.empty:hover {
  background: var(--gold-100);
  color: var(--gold-800);
}

.campaign-val {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.campaign-mini-track {
  width: 100%;
  height: 5px;
  background: var(--surface-soft);
  border-radius: 99px;
  overflow: hidden;
}

.campaign-mini-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 100%);
}

/* ============================================================================
   MODALS
   ============================================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(24, 24, 36, 0.4);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.pottel-modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 28px 60px -12px rgba(15, 23, 42, 0.2);
  overflow: hidden;
}

.pottel-modal.modal-kpi-parallel {
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

.pottel-modal.modal-kpi-parallel .modal-body {
  padding: 20px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kpi-section-block {
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 16px 18px;
  background: #FFFFFF;
}

.kpi-section-block.kpi-section-campaign {
  background: #FCFDFE;
  border-color: rgba(245, 158, 11, 0.28);
}

.kpi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.kpi-section-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--gold-700);
  text-transform: uppercase;
}

.kpi-section-badge.badge-camp {
  color: #B45309;
}

.kpi-section-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-clear-camp-kpi {
  border: 1px solid var(--border-subtle);
  background: #FFFFFF;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-clear-camp-kpi:hover {
  border-color: #EF4444;
  color: #DC2626;
  background: #FEF2F2;
}

.camp-selector-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.camp-selector-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
}

.clean-select.modal-camp-select {
  flex: 1;
  width: 100%;
  height: 38px;
  font-weight: 700;
}

.modal-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
  margin-top: 4px;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: var(--surface-soft);
  color: var(--text-sub);
  font-size: 15px;
  cursor: pointer;
}

.modal-body {
  padding: 24px 32px;
}

.kpi-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.kpi-input-card {
  background: var(--surface-soft);
  padding: 14px 16px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kpi-input-card.card-camp-input {
  background: #FFFDF7;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.kpi-input-card label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-big-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  border: 1.5px solid var(--border-subtle);
  background: var(--surface-white);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  font-variant-numeric: tabular-nums;
}

.modal-big-input::placeholder {
  font-size: 13px;
  font-weight: 500;
  color: #A1A1AA;
}

.modal-big-input:focus, .clean-input:focus {
  border-color: var(--gold-500);
}

.quick-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.preset-tag {
  border: 1px solid var(--border-subtle);
  background: var(--surface-white);
  color: var(--text-sub);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 4px;
  border-radius: 7px;
  text-align: center;
  cursor: pointer;
}

.preset-tag:hover {
  border-color: var(--gold-500);
  color: var(--gold-700);
  background: var(--gold-tint);
}

.modal-preview-bar {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--gold-tint);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.modal-preview-bar.preview-camp {
  background: #F4F5F9;
}

.modal-preview-bar strong {
  color: var(--gold-700);
  font-weight: 800;
}

.configured-camps-wrap {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.configured-camps-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.camp-kpi-chip {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: var(--surface-cream);
  color: var(--gold-800);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  cursor: pointer;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.15s ease;
}

.camp-kpi-chip:hover,
.camp-kpi-chip.active {
  background: var(--gold-500);
  color: #FFFFFF;
}

.modal-footer {
  padding: 16px 28px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.table-modal-scroll {
  max-height: 62vh;
  overflow: auto;
}

.clean-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clean-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-lavender);
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 14px 20px;
}

.clean-table th.num, .clean-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.clean-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--surface-soft);
}

.clean-table tbody tr:hover {
  background: var(--gold-tint);
}

/* Toast */
.pottel-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 600;
  background: var(--text-main);
  color: #FFFFFF;
  padding: 14px 22px;
  border-radius: var(--radius-inner);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  border-left: 4px solid var(--gold-400);
  transform: translateY(80px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pottel-toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Reduced Motion Preference (from frontend-checklist-global) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
