/* ════════════════════════════════════════════════════════════
   ALERTA PANCAKE — Premium Dark Corporate Theme (LOGIGHO)
   Fuente: Outfit & Inter | Paleta: Corporate Cyber Midnight
   ════════════════════════════════════════════════════════════ */

:root {
  --bg-base:          #07080b;
  --bg-gradient:      radial-gradient(circle at 50% -12%, #19122c 0%, #0a0c13 42%, #050608 100%);
  --bg-surface:       rgba(12, 14, 21, 0.82);
  --bg-elevated:      rgba(18, 21, 31, 0.90);
  --bg-card:          rgba(13, 16, 24, 0.78);
  --bg-card-hover:    rgba(22, 26, 38, 0.92);
  --border:           rgba(255, 255, 255, 0.07);
  --border-light:     rgba(255, 255, 255, 0.12);
  --border-glow:      rgba(56, 189, 248, 0.35);
  --border-neon-cyan: rgba(56, 189, 248, 0.5);
  --border-neon-violet: rgba(139, 92, 246, 0.5);

  --text-primary:     #ffffff;
  --text-secondary:   #cbd5e1;
  --text-muted:       #94a3b8;
  --text-dark:        #0f172a;

  --blue:             #0ea5e9; /* VORTEX Electric Cyan */
  --blue-glow:        rgba(14, 165, 233, 0.35);
  --blue-dark:        #0284c7;

  --cyan:             #38bdf8; /* VORTEX Bright Cyan */
  --cyan-glow:        rgba(56, 189, 248, 0.40);

  --green:            #10b981;
  --green-glow:       rgba(16, 185, 129, 0.35);

  --red:              #ff2a5f; /* Neon Electric Crimson */
  --red-glow:         rgba(255, 42, 95, 0.35);

  --orange:           #ff8c00;
  --orange-glow:      rgba(255, 140, 0, 0.35);

  --purple:           #8b5cf6; /* VORTEX Neon Violet */
  --purple-glow:      rgba(139, 92, 246, 0.40);

  --yellow:           #fbbf24;
  --yellow-glow:      rgba(251, 191, 36, 0.35);

  --sidebar-w:        260px;
  --radius:           16px;
  --radius-lg:        24px;
  --radius-sm:        12px;

  --transition:       all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow:           0 12px 40px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg:        0 25px 60px -15px rgba(0, 0, 0, 0.9);
  --shadow-neon:      0 0 25px rgba(56, 189, 248, 0.25);
  
  --font-headings:    'Outfit', 'Inter', system-ui, sans-serif;
  --font-body:        'Inter', system-ui, sans-serif;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── SIDEBAR (DARK GLASSMORPHISM) ──────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000 !important;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
  overflow: visible !important;
}

.sidebar.collapsed {
  width: 72px;
  overflow: visible !important;
}

.sidebar.collapsed .logo-desktop {
  display: none;
}
.sidebar.collapsed .logo-mobile {
  display: block;
}
.sidebar.collapsed .btn-toggle-sidebar {
  transform: rotate(180deg);
}
.sidebar.collapsed .nav-text {
  display: none;
}
.sidebar.collapsed .badge {
  display: none !important;
}
.sidebar.collapsed .sidebar-status {
  padding: 16px 0;
  justify-content: center;
}
.sidebar.collapsed .status-info {
  display: none;
}
.sidebar.collapsed .sidebar-nav {
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
}
.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}
.sidebar.collapsed .nav-icon {
  margin-right: 0;
}

.sidebar.collapsed .logo-desktop {
  display: none !important;
}

.sidebar.collapsed .logo-mobile {
  display: block !important;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 72px;
  position: relative;
  overflow: visible !important;
}

.brand-header-lockup {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  text-decoration: none !important;
}

.brand-icon-desktop {
  width: 38px !important;
  height: 38px !important;
  object-fit: contain !important;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.5)) !important;
  flex-shrink: 0 !important;
  transition: transform 0.2s ease !important;
}

.brand-title-desktop {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  letter-spacing: 3.5px !important;
  background: linear-gradient(135deg, #ffffff 40%, #7dd3fc 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  transform: translateY(1px) !important;
}

/* ⚡ BOTÓN COLAPSAR SIDEBAR — ESTILO CYBER OBSIDIAN / CIAN */
.btn-toggle-sidebar {
  position: fixed;
  left: calc(var(--sidebar-w) - 15px);
  top: 22px;
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #0e121d 0%, #161b29 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  font-size: 11px;
  font-weight: 900;
  transition: left 0.3s ease, transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3), 0 3px 8px rgba(0, 0, 0, 0.6);
}

.btn-toggle-sidebar.rotated {
  left: calc(72px - 15px);
  transform: rotate(180deg);
}

.btn-toggle-sidebar:hover {
  background: linear-gradient(135deg, #0284c7 0%, #8b5cf6 100%);
  color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.6), 0 4px 12px rgba(0,0,0,0.6);
}

.btn-toggle-sidebar.rotated:hover {
  transform: rotate(180deg) scale(1.15);
}

.logo-desktop {
  max-width: 170px;
  max-height: 55px;
  object-fit: contain;
  transition: var(--transition);
}

.logo-desktop:hover {
  transform: scale(1.02);
}

.logo-mobile {
  display: none;
  width: 42px;
  height: 42px;
  object-fit: contain;
  transition: var(--transition);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.sidebar-nav::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Brave */
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--blue-glow) 0%, rgba(234, 88, 12, 0.03) 100%);
  color: #ff7849; /* Vibrant brand orange */
  border-color: rgba(234, 88, 12, 0.25);
  box-shadow: inset 0 0 8px rgba(234, 88, 12, 0.1);
  font-weight: 600;
}

.nav-icon { 
  font-size: 18px; 
  transition: var(--transition);
}

.nav-item:hover .nav-icon {
  transform: scale(1.15);
}

.badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-family: var(--font-headings);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.sidebar-status {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: var(--transition);
}
.status-dot.online   { background: var(--green); box-shadow: 0 0 12px var(--green); }
.status-dot.loading  { background: var(--orange); animation: pulse 1s infinite; }
.status-dot.error    { background: var(--red); box-shadow: 0 0 12px var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.status-info { display: flex; flex-direction: column; }
.status-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.status-sub   { font-size: 11px; color: var(--text-secondary); }

/* ── MAIN CONTENT ─────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-sizing: border-box;
  overflow-x: hidden;
}

.main-content.collapsed,
.sidebar.collapsed + .main-content,
body:has(.sidebar.collapsed) .main-content {
  margin-left: 72px;
}

/* ── TOP HEADER (FROSTED GLASS) ────────────────────────────────── */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 10, 16, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.page-title {
  font-family: var(--font-headings);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}

.page-sub {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-top: 4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.sync-countdown {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
}
.sync-dot {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--blue);
  animation: beacon 2s infinite;
}

@keyframes beacon {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.3); }
}

.last-update {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.btn-refresh {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-headings);
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.3);
}
.btn-refresh:hover:not(:disabled) { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45);
}
.btn-refresh:active:not(:disabled) {
  transform: translateY(0);
}
.btn-refresh:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.refresh-icon {
  display: inline-block;
  transition: transform 0.6s;
}
.btn-refresh.loading .refresh-icon { animation: spin 1s linear infinite; }

/* ── ALERT BANNER ─────────────────────────────────────────────── */
.alert-banner {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(249, 115, 22, 0.08));
  border-bottom: 1px solid rgba(220, 38, 38, 0.25);
  padding: 14px 40px;
}

.alert-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.alert-banner-icon { font-size: 20px; }
.alert-banner-text { flex: 1; font-size: 13px; font-weight: 500; color: #fca5a5; }
.alert-banner-action {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-right: 8px;
}
.alert-banner-action:hover {
  background: rgba(255, 255, 255, 0.2);
}
.alert-banner-close {
  background: rgba(255,255,255,0.05); border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 14px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.alert-banner-close:hover { color: var(--text-primary); background: rgba(255,255,255,0.15); }

/* ── VIEWS ────────────────────────────────────────────────────── */
.view { padding: 32px 40px; flex: 1; }
.hidden { display: none !important; }

/* ── STATS GRID ───────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.cpr-stats-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 12px;
  margin-bottom: 20px;
}

.cpr-stats-grid .stat-card {
  padding: 14px 16px !important;
  gap: 12px !important;
  border-radius: 12px !important;
  min-width: 0 !important;
}

.cpr-stats-grid .stat-icon {
  width: 42px !important;
  height: 42px !important;
  font-size: 20px !important;
  flex-shrink: 0 !important;
}

.cpr-stats-grid .stat-value {
  font-size: clamp(16px, 1.35vw, 22px) !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

.cpr-stats-grid .stat-label {
  font-size: 10.5px !important;
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px !important;
}

@media (max-width: 1400px) {
  .cpr-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .cpr-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .cpr-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

.stat-card {
  background: linear-gradient(135deg, rgba(16, 19, 28, 0.75) 0%, rgba(12, 16, 33, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: var(--transition);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}
.stat-card:hover { 
  transform: translateY(-5px) scale(1.02); 
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 107, 0, 0.25);
  border-color: rgba(255, 107, 0, 0.4);
}

.stat-card--blue   { border-left: 4px solid var(--blue);   background: linear-gradient(135deg, rgba(255, 107, 0, 0.08), rgba(12, 16, 33, 0.85)); }
.stat-card--red    { border-left: 4px solid var(--red);    background: linear-gradient(135deg, rgba(255, 42, 95, 0.08), rgba(12, 16, 33, 0.85)); }
.stat-card--green  { border-left: 4px solid var(--green);  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(12, 16, 33, 0.85)); }
.stat-card--purple { border-left: 4px solid var(--cyan);   background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(12, 16, 33, 0.85)); }

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: var(--transition);
}
.stat-card--blue .stat-icon { background: rgba(234, 88, 12, 0.12); color: var(--blue); }
.stat-card--red .stat-icon { background: rgba(220, 38, 38, 0.12); color: var(--red); }
.stat-card--green .stat-icon { background: rgba(16, 185, 129, 0.12); color: var(--green); }
.stat-card--purple .stat-icon { background: rgba(30, 27, 75, 0.12); color: var(--purple); }

.stat-body { 
  display: flex; 
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
}
.stat-value-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  gap: 2px;
}
.stat-value { 
  font-family: var(--font-headings);
  font-size: clamp(18px, 1.8vw, 28px); 
  font-weight: 900; 
  letter-spacing: -0.5px; 
  color: var(--text-primary);
  line-height: 1.1;
  white-space: nowrap;
}
.stat-trend {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  margin-top: 2px;
  margin-bottom: 2px;
}
.stat-label { 
  font-size: 10px; 
  color: var(--text-secondary); 
  text-transform: uppercase; 
  letter-spacing: 1.2px; 
  font-weight: 600;
  margin-top: 2px; 
}

/* ── HOURLY ANALYTICS CARD ────────────────────────────────────── */
.hourly-analytics-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6);
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.hourly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.hourly-title {
  font-family: var(--font-headings);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.hourly-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.peak-badges-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.peak-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 107, 0, 0.15);
  color: var(--blue);
  border: 1px solid rgba(255, 107, 0, 0.3);
  white-space: nowrap;
}

.peak-badge--1 {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.hourly-bars-wrapper {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  padding-top: 20px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  box-sizing: border-box;
}

.hourly-bar-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.hourly-bar-col:hover .hourly-bar {
  filter: brightness(1.3);
  transform: scaleY(1.05);
}

.hourly-bar-col:hover .hourly-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-8px);
}

.hourly-bar {
  width: 100%;
  max-width: 14px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  transition: all 0.25s ease;
  min-height: 4px;
}

.hourly-bar--peak {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.hourly-bar--medium {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.hourly-bar--future {
  background: rgba(255, 255, 255, 0.08);
}

.hourly-bar-label {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.hourly-tooltip {
  position: absolute;
  top: -30px;
  background: #0f172a;
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 20;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ── FILTER BAR ───────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.search-input {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 11px 16px;
  font-size: 13.5px;
  font-family: var(--font-body);
  min-width: 250px;
  transition: var(--transition);
}
.search-input:focus { 
  outline: none; 
  border-color: var(--blue); 
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15); 
  background: rgba(18, 23, 41, 0.7);
}
.search-input::placeholder { color: var(--text-muted); }

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-headings);
}
.pill:hover      { border-color: rgba(255,255,255,0.2); color: var(--text-primary); }
.pill.active     { background: var(--blue); border-color: var(--blue); color: #fff; }
.pill--red.active    { background: var(--red);    border-color: var(--red);    color: #fff; }
.pill--green.active  { background: var(--green);  border-color: var(--green);  color: #fff; }
.pill--yellow.active { background: var(--yellow); border-color: var(--yellow); color: #fff; }

.account-select-filter {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  max-width: 220px;
}
.account-select-filter:hover {
  border-color: var(--blue);
}
.account-select-filter option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.btn-toggle-inactive {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-headings);
}
.btn-toggle-inactive:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* ── PAGES GRID ───────────────────────────────────────────────── */
.pages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

/* ── PAGE CARD (GLASS LOOK) ────────────────────────────────────── */
.page-card {
  background: linear-gradient(145deg, rgba(20, 26, 48, 0.75) 0%, rgba(10, 14, 28, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
}

/* Top indicator bar */
.page-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--border-light);
  transition: var(--transition);
}
.page-card.status-ok::before     { background: linear-gradient(90deg, #10b981, #06b6d4); box-shadow: 0 0 12px rgba(16, 185, 129, 0.8); }
.page-card.status-alert::before  { background: linear-gradient(90deg, #ff2a5f, #ff8c00); box-shadow: 0 0 12px rgba(255, 42, 95, 0.8); }
.page-card.status-silent::before { background: linear-gradient(90deg, #fbbf24, #f97316); box-shadow: 0 0 12px rgba(251, 191, 36, 0.8); }
.page-card.status-unknown::before { background: var(--text-muted); }

.page-card:hover { 
  transform: translateY(-6px) scale(1.015); 
  border-color: rgba(255, 107, 0, 0.4); 
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 107, 0, 0.2); 
}

/* Glow indicators based on status */
.page-card.status-alert:hover {
  box-shadow: 0 20px 45px -10px rgba(255, 42, 95, 0.25), 0 0 30px rgba(255, 42, 95, 0.35);
  border-color: rgba(255, 42, 95, 0.6);
}
.page-card.status-ok:hover {
  box-shadow: 0 20px 45px -10px rgba(16, 185, 129, 0.2), 0 0 30px rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
}
.page-card.status-ok:hover {
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

.page-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  width: 100%;
}

.page-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}
.page-avatar img { width: 100%; height: 100%; object-fit: cover; }

.page-title-box {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.page-name {
  font-family: var(--font-headings);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.page-account {
  font-size: 11px;
  color: #cbd5e1;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-badges-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  margin-left: auto;
  flex-shrink: 0;
}

.no-data {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  display: inline-block;
  letter-spacing: 0.2px;
}

.page-status-pill {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  white-space: nowrap;
}
.page-status-pill.ok      { background: var(--green-glow);  color: #34d399;  border: 1px solid rgba(16,185,129,0.3); }
.page-status-pill.alert   { background: var(--red-glow);    color: #f87171;    border: 1px solid rgba(220,38,38,0.3); }
.page-status-pill.silent  { background: var(--yellow-glow); color: #fbbf24; border: 1px solid rgba(234,179,8,0.3); }
.page-status-pill.unknown { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }

.page-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
}

.metric-item {
  text-align: center;
  min-width: 0;
  overflow: hidden;
}

.metric-value {
  font-family: var(--font-headings);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  letter-spacing: -0.4px;
}

.metric-label {
  font-size: 9.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  margin-top: 2px;
  white-space: nowrap;
}

.trend-up   { color: #f87171; font-size: 11px; font-weight: 600; }
.trend-down { color: #34d399; font-size: 11px; font-weight: 600; }
.trend-neutral { color: var(--text-muted); font-size: 11px; }

.page-card-footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.last-msg-label { font-size: 11.5px; color: #cbd5e1; }
.last-msg-value { font-size: 11.5px; font-weight: 700; color: #ff8a5c; }

.alert-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.alert-pill {
  padding: 3px 10px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.alert-pill.cpm  { background: var(--red-glow);    color: #f87171;    border: 1px solid rgba(220,38,38,0.25); }
.alert-pill.cpr  { background: var(--orange-glow); color: #fb923c; border: 1px solid rgba(249,115,22,0.25); }
.alert-pill.msgs { background: var(--yellow-glow); color: #fbbf24; border: 1px solid rgba(234,179,8,0.25); }

/* ── SECTION HEADERS ──────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-headings);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.section-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  max-width: 600px;
}

/* ── TABLES ────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
  box-shadow: var(--shadow);
}

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

.data-table thead {
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border);
}

.data-table thead th {
  background-color: #0f172a !important;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: inset 0 -2px 0 var(--border);
  padding: 14px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 20px;
  font-size: 13.5px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.loading-row { text-align: center; color: var(--text-muted); padding: 50px; font-size: 14px; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-family: var(--font-headings);
  font-size: 12px;
  font-weight: 800;
}
.rank-badge.gold   { background: rgba(234, 179, 8, 0.2); color: #fbbf24; border: 1px solid rgba(234, 179, 8, 0.3); }
.rank-badge.silver { background: rgba(156, 163, 175, 0.18); color: #d1d5db; border: 1px solid rgba(156, 163, 175, 0.2); }
.rank-badge.bronze { background: rgba(249, 115, 22, 0.18); color: #ff9f43; border: 1px solid rgba(249, 115, 22, 0.2); }
.rank-badge.normal { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }

.ad-name-cell { display: flex; align-items: center; gap: 12px; }

.status-active  { color: var(--green); font-weight: 700; font-size: 11.5px; }
.status-paused  { color: var(--yellow); font-weight: 750; font-size: 11.5px; }
.status-unknown { color: var(--text-muted); }

/* ── ALERTS LIST ──────────────────────────────────────────────── */
.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.alert-item {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: var(--transition);
}
.alert-item:hover { border-color: rgba(255, 255, 255, 0.1); }

.alert-item.high    { border-left: 4px solid var(--red);    background: linear-gradient(135deg, var(--bg-card), rgba(220, 38, 38, 0.02)); }
.alert-item.warning { border-left: 4px solid var(--yellow); background: linear-gradient(135deg, var(--bg-card), rgba(234, 179, 8, 0.02)); }

.alert-item-icon { font-size: 24px; flex-shrink: 0; }
.alert-item-body { flex: 1; }
.alert-item-title { font-family: var(--font-headings); font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.alert-item-detail { font-size: 13px; color: var(--text-secondary); }
.alert-item-time { font-size: 11.5px; color: var(--text-muted); margin-top: 8px; font-family: monospace; }

/* ── SETTINGS ─────────────────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 24px;
}

.settings-card {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.settings-card-title {
  font-family: var(--font-headings);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.settings-card-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 13.5px;
  font-family: var(--font-body);
  transition: var(--transition);
}
.form-input:focus { 
  outline: none; 
  border-color: var(--blue); 
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15); 
  background: rgba(0, 0, 0, 0.35);
}
.form-input::placeholder { color: var(--text-muted); }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; display: block; }

.input-with-badge {
  position: relative;
  display: flex;
  align-items: center;
}
.input-with-badge .form-input { padding-right: 54px; }
.input-badge {
  position: absolute;
  right: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.account-item {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
}

.account-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.account-item-label {
  font-family: var(--font-headings);
  font-size: 13px;
  font-weight: 700;
  color: #60a5fa;
}

.btn-remove {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.btn-remove:hover { background: var(--red-glow); }

.settings-guide {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.settings-guide strong { color: var(--text-primary); display: block; margin-bottom: 8px; }
.settings-guide ol { padding-left: 18px; }
.settings-guide code {
  background: #000;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11.5px;
  color: #93c5fd;
  font-family: monospace;
}

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  border: none;
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-headings);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-headings);
}
.btn-secondary:hover { 
  background: rgba(255, 255, 255, 0.08); 
  border-color: rgba(255, 255, 255, 0.2); 
  transform: translateY(-2px);
}
.btn-secondary:active { transform: translateY(0); }

/* ── MODAL ────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.hidden,
.update-modal-backdrop.hidden,
.custom-alert-backdrop.hidden,
.hidden {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}

.modal {
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(17, 24, 39, 0.95);
  z-index: 10;
}

.modal-title-group { display: flex; align-items: center; gap: 16px; }
.modal-avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  object-fit: cover;
}

.modal-title { font-family: var(--font-headings); font-size: 18px; font-weight: 800; }
.modal-sub   { font-size: 12.5px; color: var(--text-secondary); }

.modal-close {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red-glow); border-color: var(--red); color: #f87171; transform: rotate(90deg); }

.modal-body { padding: 32px; }

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.modal-metric {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.modal-metric-val  { font-family: var(--font-headings); font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.modal-metric-lbl  { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; margin-top: 6px; letter-spacing: 0.8px; font-weight: 600; }
.modal-metric-cmp  { font-size: 10.5px; margin-top: 8px; font-weight: 650; }

/* ── EMPTY STATE ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 40px;
  grid-column: 1 / -1;
}
.empty-icon  { font-size: 64px; margin-bottom: 20px; }
.empty-title { font-family: var(--font-headings); font-size: 18px; font-weight: 700; color: var(--text-secondary); margin-bottom: 10px; }
.empty-sub   { font-size: 13.5px; color: var(--text-muted); margin-bottom: 28px; }

/* ── TOAST ────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 85px;
  right: 24px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: rgba(25, 30, 48, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  min-width: 280px;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error   { border-left: 4px solid var(--red); }
.toast.info    { border-left: 4px solid var(--blue); }

@keyframes slideRight {
  from { opacity: 0; transform: translateX(40px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── TERMINAL LOG SCREEN (CLEAN GLASS FEED) ────────────────────────── */
#sheets-log-output {
  background: rgba(10, 15, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

/* ── RESPONSIVE ───────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .stats-grid { gap: 16px; }
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { width: 72px; }
  .logo-text, .nav-item span:not(.nav-icon), .sidebar-status .status-info { display:none; }
  .sidebar-logo { justify-content: center; padding: 24px 0; }
  .logo-desktop { display: none; }
  .logo-mobile { display: block; }
  .main-content { margin-left: 72px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .top-header { padding: 20px 24px; }
  .view { padding: 24px; }
  .modal-metrics-grid { grid-template-columns: repeat(2,1fr); }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item:hover { transform: none; }
}

/* ── SCROLLBAR ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

/* ── LOADING SKELETON ─────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

/* ── GLOBAL SYNC BANNER ───────────────────────────────────────── */
.global-sync-banner {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.global-sync-banner.hidden {
  display: none !important;
}

.global-sync-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-sync-banner .banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-sync-banner .pulse-indicator {
  font-size: 16px;
  display: inline-block;
  animation: pulse-icon 1.5s infinite ease-in-out;
}

.global-sync-banner .btn-banner-action {
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.global-sync-banner .btn-banner-action:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.global-sync-banner .btn-banner-close {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.8;
  transition: all 0.2s;
}

.global-sync-banner .btn-banner-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.15);
}

.global-sync-banner .banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.global-sync-banner .pulse-indicator {
  font-size: 16px;
  display: inline-block;
  animation: pulse-icon 1.5s infinite ease-in-out;
}

.global-sync-banner .btn-banner-action {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: var(--orange);
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-headings);
}

.global-sync-banner .btn-banner-action:hover {
  background: rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

.global-sync-banner .btn-banner-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  opacity: 0.7;
  transition: all 0.2s;
}

.global-sync-banner .btn-banner-close:hover {
  opacity: 1;
  color: #fff;
}

@keyframes pulse-icon {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* ── CUSTOM CHECKBOX ─────────────────────────────────────────── */
.custom-checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
  min-height: 20px;
}

.custom-checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.custom-checkbox-checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--border-light);
  border-radius: 4px;
  transition: all var(--transition);
}

.custom-checkbox-container:hover input ~ .custom-checkbox-checkmark {
  border-color: var(--orange);
  background-color: rgba(255, 255, 255, 0.08);
}

.custom-checkbox-container input:checked ~ .custom-checkbox-checkmark {
  background-color: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.4);
}

.custom-checkbox-checkmark::after {
  content: "";
  position: absolute;
  display: none;
}

.custom-checkbox-container input:checked ~ .custom-checkbox-checkmark::after {
  display: block;
}

.custom-checkbox-container .custom-checkbox-checkmark::after {
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox-label {
  padding-top: 1px;
}

/* ═══ VENTANA MODAL DE ACTUALIZACIÓN / NOVEDADES (RELEASE NOTES MODAL) ═══ */
.update-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeInModal 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.update-modal-backdrop.hidden {
  display: none !important;
}

.update-modal-card {
  background: rgba(14, 18, 33, 0.95);
  border: 1px solid rgba(249, 115, 22, 0.4);
  box-shadow: 0 0 50px rgba(234, 88, 12, 0.25), 0 25px 60px rgba(0, 0, 0, 0.9);
  border-radius: 20px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-family: var(--font-body);
  animation: slideUpModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.update-modal-header {
  padding: 20px 24px;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.15) 0%, rgba(30, 27, 75, 0.3) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.update-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.update-tag-pill {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff;
  font-family: var(--font-headings);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 9999px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
  text-transform: uppercase;
}

.update-date-label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

.update-modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}

.update-modal-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.update-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.update-hero-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(22, 28, 51, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 16px;
  border-radius: 14px;
}

.update-hero-icon {
  font-size: 32px;
  width: 54px;
  height: 54px;
  min-width: 54px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.update-hero-title {
  font-family: var(--font-headings);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.update-hero-sub {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
}

.update-section {
  background: rgba(18, 23, 41, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 16px;
}

.update-section-title {
  font-family: var(--font-headings);
  font-size: 14px;
  font-weight: 700;
  color: #fb923c;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.update-section-title .icon {
  font-size: 16px;
}

.update-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.update-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--orange);
  font-size: 12px;
}

.update-list strong {
  color: var(--text-primary);
}

.update-modal-footer {
  padding: 16px 24px;
  background: rgba(10, 13, 24, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.btn-update-confirm {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  border: none;
  font-family: var(--font-headings);
  font-size: 14px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.35);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-update-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(234, 88, 12, 0.5);
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.btn-update-badge-header {
  background: rgba(249, 115, 22, 0.12);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fb923c;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-headings);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-update-badge-header:hover {
  background: rgba(249, 115, 22, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ════════════════════════════════════════════════════════════
   1. GRÁFICO DE HORAS PICO DE CONVERSACIÓN (HEATMAP DE MENSAJES)
   ════════════════════════════════════════════════════════════ */
.hourly-analytics-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hourly-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.hourly-title {
  font-family: var(--font-headings);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.hourly-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.peak-badges-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.peak-badge {
  background: rgba(234, 88, 12, 0.15);
  border: 1px solid rgba(234, 88, 12, 0.35);
  color: #fb923c;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.15);
}

.peak-badge--1 {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(220, 38, 38, 0.25) 100%);
  border-color: #f97316;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

.hourly-bars-wrapper {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 140px;
  padding-top: 24px;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hourly-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
  cursor: pointer;
}

.hourly-bar-col:hover .hourly-bar {
  filter: brightness(1.25);
  transform: scaleY(1.05);
}

.hourly-bar-col:hover .hourly-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-8px);
}

.hourly-bar {
  width: 100%;
  max-width: 22px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #3b82f6 0%, rgba(59, 130, 246, 0.3) 100%);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  min-height: 4px;
}

.hourly-bar--peak {
  background: linear-gradient(180deg, #f97316 0%, #dc2626 100%);
  box-shadow: 0 0 12px rgba(249, 115, 22, 0.4);
}

.hourly-bar--future {
  background: rgba(255, 255, 255, 0.05) !important;
  box-shadow: none !important;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  opacity: 0.35;
}

.hourly-bar--medium {
  background: linear-gradient(180deg, #10b981 0%, rgba(16, 185, 129, 0.3) 100%);
}

.hourly-bar-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  font-weight: 600;
}

.hourly-tooltip {
  position: absolute;
  top: -32px;
  background: rgba(12, 14, 21, 0.95);
  border: 1px solid var(--border-light);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ════════════════════════════════════════════════════════════
   2. MATRIZ DE SALUD Y DIAGNÓSTICO DE TIENDAS (SEMÁFORO)
   ════════════════════════════════════════════════════════════ */
.store-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-sizing: border-box;
}

.health--star {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.health--stable {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.health--leak {
  background: rgba(249, 115, 22, 0.2);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.4);
}

.health--inactive {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.4);
}

/* ════════════════════════════════════════════════════════════
   3. SIMULADOR DE ESCALADO DE PRESUPUESTO
   ════════════════════════════════════════════════════════════ */
.sim-input-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.sim-input-box label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.sim-input-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sim-currency {
  font-size: 20px;
  font-weight: 800;
  color: #f97316;
}

.sim-input-group input {
  flex: 1;
  min-width: 200px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-headings);
}

.sim-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sim-summary-card {
  background: rgba(12, 14, 21, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.sim-summary-card .val {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  font-family: var(--font-headings);
}

.sim-summary-card .lbl {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   4. MODO COMPARATIVO (HOY VS 7D PROMEDIOS)
   ════════════════════════════════════════════════════════════ */
.compare-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

.compare-tag--up {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.compare-tag--down {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

.btn-sim-action {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-headings);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-sim-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.5);
}

.btn-compare-action {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-headings);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-compare-action.active {
  background: #3b82f6;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   📱 SISTEMA DE DISEÑO ULTRA-RESPONSIVO MULTIDISPOSITIVO (CELULAR, TABLET, PC, TV)
   ══════════════════════════════════════════════════════════════════════════ */

/* 1. DISPOSITIVOS ULTRA-GRANDES, PANTALLAS 4K Y ZOOM 50% (1600px+) */
@media (min-width: 1600px) {
  .app-header-inner {
    max-width: 100% !important;
  }
  .main-content {
    width: auto !important;
    max-width: none !important;
  }

  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (min-width: 1920px) {
  .app-header-inner {
    max-width: 100% !important;
  }
  .main-content {
    width: auto !important;
    max-width: none !important;
  }

  .pages-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* 2. LAPTOPS Y MONITORES MEDIANOS (993px - 1440px) */
@media (max-width: 1200px) {
  .pages-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3. TABLETS Y PANTALLAS MEDIANAS (769px - 992px) */
@media (max-width: 992px) {
  .app-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .header-actions {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .pages-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-pills-container {
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .update-modal-card {
    width: 92%;
    max-height: 90vh;
  }

  .simulator-modal-card {
    width: 94%;
    padding: 18px;
  }
}

/* 4. MÓVILES Y TELÉFONOS (320px - 768px) */
@media (max-width: 768px) {
  .app-header {
    padding: 12px 14px;
  }

  .brand-title {
    font-size: 16px;
  }

  .brand-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .btn-sim-action,
  .btn-compare-action,
  .btn-update-badge-header,
  .btn-refresh {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-value {
    font-size: 20px;
  }

  .stat-label {
    font-size: 10px;
  }

  /* Selector de Períodos desplazable al tacto */
  .time-selector-group {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: center;
  }

  .filter-pills {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .filter-pill {
    padding: 6px 12px;
    font-size: 11px;
    white-space: nowrap;
  }

  .pages-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .page-card {
    padding: 14px;
  }

  .page-name {
    font-size: 14px;
  }

  .metric-value {
    font-size: 15px;
  }

  .metric-label {
    font-size: 9px;
  }

  /* Horas Pico Gráfico táctil en celular */
  .hourly-card {
    padding: 14px;
  }

  .hourly-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .hourly-bars-wrapper {
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    min-width: 100%;
  }

  .hourly-bar-col {
    min-width: 22px;
  }

  .peak-badges-group {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  /* Tablas de Simulador y Ads en Celular */
  .sim-summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ads-table th,
  .ads-table td {
    padding: 8px 10px;
    font-size: 11px;
  }

  .sim-input-group {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .sim-input-group input {
    width: 100%;
  }
}

/* 5. TELÉFONOS PEQUEÑOS Y PANTALLAS ESTRECHAS (< 400px) */
@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .page-metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }

  .metric-value {
    font-size: 13px;
  }
}

@keyframes slideUpModal {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ BANNER DE SINCRONIZACIÓN DE GOOGLE SHEETS EN TIEMPO REAL ═══ */
.global-sync-banner {
  background: linear-gradient(90deg, #ea580c 0%, #c2410c 100%);
  color: #ffffff;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(234, 88, 12, 0.4);
  animation: slideDownBanner 0.4s ease;
  font-weight: 700;
  font-size: 14px;
}

.global-sync-banner.hidden {
  display: none !important;
}

.global-sync-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-sync-banner .pulse-indicator {
  font-size: 18px;
  animation: pulse 1.2s infinite;
}

.global-sync-banner .btn-banner-action {
  background: #ffffff !important;
  color: #ea580c !important;
  font-family: var(--font-headings);
  font-weight: 800 !important;
  font-size: 13px !important;
  padding: 8px 18px !important;
  border-radius: 20px !important;
  border: none !important;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.global-sync-banner .btn-banner-action:hover {
  background: #fff7ed !important;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  color: #c2410c !important;
}

@keyframes slideDownBanner {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── MODERN INTERACTIVE DATE PICKERS ───────────────────────── */
input[type="date"] {
  color-scheme: dark !important;
  cursor: pointer !important;
  background: rgba(19, 23, 34, 0.9) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  padding: 6px 12px !important;
  outline: none !important;
  transition: all 0.2s ease !important;
}

input[type="date"]:hover, input[type="date"]:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
  background: rgba(22, 25, 36, 0.9) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer !important;
  filter: invert(1) brightness(1.3) !important;
  opacity: 0.9 !important;
  padding: 2px !important;
  transition: transform 0.2s ease, opacity 0.2s ease !important;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1 !important;
  transform: scale(1.2) !important;
}

.date-picker-btn {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: #60a5fa;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.date-picker-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  color: #fff;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════
   🚀 V274 MODERN COMPONENTS & ENHANCEMENTS
   ══════════════════════════════════════════════════════════════ */

/* ── 1. SPOTLIGHT SEARCH (Ctrl + K) ── */
.btn-spotlight-trigger {
  background: rgba(22, 25, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
}
.btn-spotlight-trigger:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.4);
  color: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}
.kbd-badge {
  background: rgba(12, 14, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-family: monospace;
  color: #38bdf8;
  font-weight: 700;
}

.spotlight-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.75);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.spotlight-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.spotlight-card {
  width: 100%;
  max-width: 640px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(59, 130, 246, 0.2);
  overflow: hidden;
  animation: spotlightSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes spotlightSlide {
  from { opacity: 0; transform: translateY(-20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.spotlight-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 12px;
}
.spotlight-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  outline: none;
}
.spotlight-input::placeholder {
  color: #64748b;
}
.spotlight-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}
.spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #cbd5e1;
}
.spotlight-item:hover, .spotlight-item.selected {
  background: rgba(59, 130, 246, 0.15);
  color: #fff;
}
.spotlight-item-name {
  font-weight: 700;
  font-size: 14px;
}
.spotlight-item-meta {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  gap: 8px;
  align-items: center;
}
.spotlight-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(12, 14, 21, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: #64748b;
}

/* ── 2. SEMÁFORO DE SALUD DE CUENTAS ── */
.accounts-health-widget {
  background: rgba(22, 25, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.accounts-health-widget:hover {
  background: rgba(22, 25, 36, 0.95);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
.health-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 8px currentColor;
}
.health-dot.green {
  background: #22c55e;
  color: #22c55e;
}
.health-dot.yellow {
  background: #eab308;
  color: #eab308;
}
.health-dot.red {
  background: #ef4444;
  color: #ef4444;
  animation: pulse 1.2s infinite;
}
.health-label {
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

/* ── 3. CENTRO DE CONTROL DE SINCRONIZACIÓN EN VIVO (ULTRA-ESTÉTICO) ── */
.modern-terminal-card {
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.15);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 10px;
  transition: all 0.3s ease;
}
.terminal-macos-header {
  background: rgba(12, 14, 21, 0.9);
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.terminal-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s ease;
}
.terminal-dot:hover {
  transform: scale(1.25);
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title-text {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.5px;
}
.sync-live-badge {
  font-size: 10px;
  font-weight: 800;
  color: #34d399;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* STEPPER ELEVADO DE 5 PASOS */
.terminal-stepper-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  padding: 14px 20px;
  background: rgba(12, 14, 21, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 10px;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.stepper-step-body {
  display: flex;
  flex-direction: column;
}
.stepper-label {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
}
.stepper-sub {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}
.stepper-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  flex-shrink: 0;
}
.stepper-step.active {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.2) 0%, rgba(6, 182, 212, 0.1) 100%);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.25);
}
.stepper-step.active .stepper-label {
  color: #38bdf8;
}
.stepper-step.active .stepper-sub {
  color: #7dd3fc;
}
.stepper-step.active .stepper-step-num {
  background: #0284c7;
  color: #fff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.8);
}
.stepper-step.done {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.35);
}
.stepper-step.done .stepper-label {
  color: #4ade80;
}
.stepper-step.done .stepper-sub {
  color: #86efac;
}
.stepper-step.done .stepper-step-num {
  background: #16a34a;
  color: #fff;
}

/* HERO MONITOR DE PROGRESO */
.sync-hero-monitor {
  padding: 18px 24px;
  background: rgba(12, 14, 21, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.sync-hero-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sync-hero-title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
}
.sync-hero-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}
.sync-hero-pct {
  font-size: 26px;
  font-weight: 900;
  color: #38bdf8;
  font-family: monospace;
  letter-spacing: -0.5px;
}
.terminal-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.terminal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 50%, #10b981 100%);
  border-radius: 6px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.8);
}

/* FEED VISUAL DE ACTIVIDAD EN TIEMPO REAL */
.sync-live-feed-container {
  margin: 16px 20px 20px 20px;
  background: rgba(5, 10, 20, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.sync-feed-header {
  padding: 10px 16px;
  background: rgba(12, 14, 21, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sync-live-feed-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sync-feed-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* TARJETA VISUAL DE TIENDA EN EL FEED */
.sync-store-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 9px 14px;
  border-radius: 9px;
  transition: all 0.2s ease;
  animation: feedItemIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sync-store-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
}
.sync-store-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sync-store-index {
  font-size: 10px;
  font-weight: 800;
  color: #7dd3fc;
  background: rgba(2, 132, 199, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.sync-store-name {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
}
.sync-store-phone {
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
}
.sync-store-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sync-badge-spend {
  font-size: 11px;
  font-weight: 800;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
}
.sync-badge-msgs {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
}
.sync-badge-status {
  font-size: 10px;
  font-weight: 800;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
}

/* TARJETA DE HITO / CALLOUT */
.sync-callout-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 10px 14px;
  border-radius: 9px;
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 700;
  animation: feedItemIn 0.25s ease;
}

/* PÍLDORA INFORMATIVA DEL SISTEMA */
.sync-info-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 6px;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  animation: feedItemIn 0.2s ease;
}
.sync-info-icon {
  font-size: 13px;
  opacity: 0.8;
}
@keyframes feedItemIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 4. BOTÓN COPIAR ID EN CREATIVOS ── */
.btn-copy-id {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-copy-id:hover {
  background: rgba(59, 130, 246, 0.25);
  color: #fff;
  border-color: #3b82f6;
  transform: scale(1.05);
}
.ad-category-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── 5. CPR CRÍTICO (> $1.000 COP) ── */
.cpr-critical-high {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
  font-weight: 900 !important;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  animation: cprWarningPulse 2s infinite;
}
@keyframes cprWarningPulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ── 6. FLOATING SYNC PILL (REEMPLAZO ULTRA-MODERNO DEL BANNER NARANJA) ── */
.sync-floating-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: rgba(12, 14, 21, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.25);
  border-radius: 9999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  animation: floatPillIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.2s ease;
}
.sync-floating-pill:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.4);
}
.sync-pill-badge {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
}
@keyframes floatPillIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ═══ 7. CUSTOM AESTHETIC MODAL (REEMPLAZO ULTRA-MODERNO DE ALERT) ═══ */
.custom-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(10, 15, 30, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: customAlertFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.25s ease;
}
.custom-alert-backdrop.hidden {
  display: none !important;
}
.custom-alert-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, #131b2e 0%, #0b0f19 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.2);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: customAlertPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.custom-alert-card::before {
  content: '';
  position: absolute;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 100px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.custom-alert-icon-wrapper {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px auto;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(37, 99, 235, 0.1) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  animation: pulseGlow 2.5s infinite;
}
.custom-alert-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 8px 0;
  letter-spacing: -0.3px;
}
.custom-alert-message {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.55;
  margin: 0 0 22px 0;
  word-break: break-word;
}
.custom-alert-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.custom-alert-btn {
  padding: 11px 26px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.custom-alert-btn-confirm {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
  flex: 1;
}
.custom-alert-btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(37, 99, 235, 0.65);
  filter: brightness(1.1);
}
.custom-alert-btn-cancel {
  background: rgba(22, 25, 36, 0.8);
  color: #94a3b8;
  border: 1px solid #475569;
}
.custom-alert-btn-cancel:hover {
  background: #334155;
  color: #fff;
}
@keyframes customAlertFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes customAlertPopIn {
  from { opacity: 0; transform: scale(0.88) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(56, 189, 248, 0.25); }
  50% { transform: scale(1.05); box-shadow: 0 0 28px rgba(56, 189, 248, 0.45); }
}

/* ══════════════════════════════════════════════════════════════════════════
   📊 VISTA GENERAL & ANALYTICS EJECUTIVO (GLASSMORPHISM & APEXCHARTS COMPACT)
   ══════════════════════════════════════════════════════════════════════════ */

/* HERO FILTROS & TOOLBAR COMPACTO */
.analytics-hero-bar {
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.95) 0%, rgba(22, 25, 36, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.analytics-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* TERMÓMETRO DE METAS */
.goal-thermometer-card {
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.9) 0%, rgba(20, 30, 50, 0.9) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.goal-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.goal-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #06b6d4 50%, #38bdf8 100%);
  border-radius: 6px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

/* PODIO DE HONOR TOP 3 */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.podium-card {
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.podium-card:hover {
  transform: translateY(-2px);
}

.podium-card--gold {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.12) 0%, rgba(12, 14, 21, 0.95) 100%);
  border: 1px solid rgba(234, 179, 8, 0.45);
  box-shadow: 0 4px 16px rgba(234, 179, 8, 0.15);
}

.podium-card--silver {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.12) 0%, rgba(12, 14, 21, 0.95) 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 16px rgba(148, 163, 184, 0.1);
}

.podium-card--bronze {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.12) 0%, rgba(12, 14, 21, 0.95) 100%);
  border: 1px solid rgba(217, 119, 6, 0.35);
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1);
}

.podium-medal {
  font-size: 26px;
  line-height: 1;
}

.podium-details {
  flex: 1;
}

.podium-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 2px;
}

.podium-stats {
  font-size: 11px;
  color: #cbd5e1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* CARDS DE GRÁFICAS */
.charts-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.charts-grid-1col {
  margin-bottom: 14px;
}

.chart-box-card {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  position: relative;
}

.chart-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.chart-box-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-box-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

/* MATRIZ DE CUADRANTES */
.quadrant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.quadrant-box {
  border-radius: 10px;
  padding: 12px;
  background: rgba(12, 14, 21, 0.7);
  border: 1px solid #334155;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quadrant-box--stars {
  border-color: rgba(34, 197, 94, 0.35);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.quadrant-box--gems {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.06) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.quadrant-box--volume {
  border-color: rgba(234, 179, 8, 0.35);
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.06) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.quadrant-box--drain {
  border-color: rgba(239, 68, 68, 0.35);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.quadrant-title {
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quadrant-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow-y: auto;
}

.quadrant-item {
  font-size: 10px;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* CAJA DE DIAGNÓSTICO IA */
.ai-diagnosis-card {
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.75) 0%, rgba(12, 14, 21, 0.9) 100%);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
}

.ai-diagnosis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-pill-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 6px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  color: #e2e8f0;
}

/* ═══ MODAL CIRCULAR DE CARGA DE MÉTRICAS (GLASSMORPHISM PROGRESS) ═══ */
.analytics-progress-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.analytics-progress-modal-backdrop.active {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.analytics-progress-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 30px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 380px;
  width: 90%;
  transform: scale(0.92);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.analytics-progress-modal-backdrop.active .analytics-progress-card {
  transform: scale(1);
}

/* Círculo SVG animado */
.progress-circle-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 18px;
}

.progress-circle-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 8;
}

.progress-circle-bar {
  fill: none;
  stroke: url(#progressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 0.3s ease;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

.progress-circle-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.progress-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}

.progress-status-desc {
  font-size: 12px;
  color: #94a3b8;
}

/* KPI CARD 4-COLUMN HORIZONTAL GRID */
.stats-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
  width: 100%;
}

@media (max-width: 1100px) {
  .stats-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-grid-4col {
    grid-template-columns: 1fr;
  }
}

.stats-grid-4col .stat-card {
  padding: 14px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  box-sizing: border-box;
  width: 100%;
}

.stats-grid-4col .stat-value {
  font-size: 20px !important;
  font-weight: 900 !important;
  line-height: 1.2;
}

.stats-grid-4col .stat-label {
  font-size: 11px !important;
  font-weight: 700;
  color: #94a3b8;
}

.stats-grid-4col .stat-sublabel {
  font-size: 10px;
  color: #38bdf8;
  font-weight: 700;
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   ✨ ULTRA-AESTHETIC NEON LASER SKELETON LOADING SYSTEM
   ════════════════════════════════════════════════════════════ */

@keyframes electric-laser-sweep {
  0% {
    transform: translateX(-150%) skewX(-20deg);
  }
  100% {
    transform: translateX(250%) skewX(-20deg);
  }
}

@keyframes pulseAlert {
  0%, 100% {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.6);
  }
  50% {
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.55);
    border-color: #ef4444;
  }
}

/* ════════════════════════════════════════════════════════════
   ⏰ SECCIÓN HORA A HORA & 🔍 PRODUCTOS CROSS-TIENDAS (v423)
   ════════════════════════════════════════════════════════════ */

.hourly-perf-card {
  background: rgba(12, 14, 21, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.hourly-perf-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #ef4444 0%, #38bdf8 50%, #22c55e 100%);
}

.hourly-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hourly-badges-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hourly-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

/* 🔍 BUSCADOR DE PRODUCTOS CROSS-TIENDAS */
.product-cross-card {
  background: rgba(12, 14, 21, 0.75);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(10px);
  position: relative;
}

.product-cross-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #a855f7 0%, #06b6d4 100%);
}

.product-pills-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
  scrollbar-width: thin;
}

.product-pill-btn {
  background: rgba(22, 25, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.product-pill-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(56, 189, 248, 0.4);
  color: #fff;
  transform: translateY(-1px);
}

.product-pill-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}

.product-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.product-kpi-box {
  background: rgba(10, 15, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.product-stores-table-wrap {
  background: rgba(10, 15, 30, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 14px;
}

.product-ads-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ad-card-highlight {
  border-radius: 12px;
  padding: 14px;
  background: rgba(12, 14, 21, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ad-card-highlight.winner {
  border-color: rgba(34, 197, 94, 0.4);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08) 0%, rgba(12, 14, 21, 0.95) 100%);
}

.ad-card-highlight.leak {
  border-color: rgba(239, 68, 68, 0.4);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(12, 14, 21, 0.95) 100%);
}

/* ⚙️ AJUSTES EXECUTIVE (GLASSMORPHISM) */
.settings-glass-card {
  background: rgba(12, 14, 21, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  transition: all 0.25s ease !important;
}

.settings-glass-card:hover {
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6) !important;
}

/* ════════════════════════════════════════════════════════════
   ⚡ SUITE EJECUTIVA HORA A HORA MULTINACIONAL PRO (v436)
   ════════════════════════════════════════════════════════════ */
.executive-hourly-suite {
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.95) 0%, rgba(22, 25, 36, 0.8) 100%) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  border-radius: 18px !important;
  padding: 20px 22px !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(16px) !important;
  margin-bottom: 25px !important;
  position: relative;
  overflow: hidden;
}

.executive-hourly-suite::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4 0%, #3b82f6 35%, #ec4899 70%, #10b981 100%);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

/* ════════════════════════════════════════════════════════════
   🧠 ASISTENTE IA DE INSIGHTS & DIAGNÓSTICO (COMPACT CHIP STRIP)
   ════════════════════════════════════════════════════════════ */
.ai-compact-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(24, 18, 48, 0.75) 0%, rgba(12, 14, 21, 0.85) 100%);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  flex-wrap: wrap;
}

.ai-compact-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  padding: 4px 9px;
  border-radius: 8px;
  flex-shrink: 0;
}

.ai-sparkle {
  font-size: 14px;
}

.ai-tag-text {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #c084fc;
}

.ai-compact-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  color: #cbd5e1;
  white-space: nowrap;
}

.ai-chip--spend { border-left: 3px solid #f43f5e; }
.ai-chip--trafficker { border-left: 3px solid #38bdf8; }
.ai-chip--bpo { border-left: 3px solid #10b981; }

.ai-chip-icon { font-size: 13px; }
.ai-chip-label { font-weight: 700; color: #94a3b8; font-size: 11px; }
.ai-chip-val { font-weight: 800; color: #f8fafc; }
.ai-chip-sep { color: #475569; margin: 0 2px; }
.ai-chip-sub { color: #94a3b8; font-size: 11px; }

/* ════════════════════════════════════════════════════════════
   ⚡ CLEAN EXECUTIVE HOURLY SUITE (MINIMALISTA, DESCONGESTIONADO)
   ════════════════════════════════════════════════════════════ */
.hourly-clean-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.hourly-header-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.hourly-title-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hourly-title-icon {
  font-size: 18px;
}

.hourly-clean-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
}

.hourly-clean-sub {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

.hourly-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hourly-store-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(12, 14, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 4px 10px;
}

.hourly-filter-icon {
  font-size: 13px;
}

.hourly-clean-select {
  background: transparent;
  color: #38bdf8;
  border: none;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  max-width: 250px;
}

.hourly-clean-select option {
  background: #0f172a;
  color: #fff;
}

.btn-hourly-clean {
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-hourly-excel {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-hourly-excel:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.btn-hourly-refresh {
  background: rgba(22, 25, 36, 0.85);
  border: 1px solid #475569;
  color: #94a3b8;
  font-size: 14px;
  padding: 5px 10px;
}

.btn-hourly-refresh:hover {
  color: #38bdf8;
  border-color: #38bdf8;
}

/* Badge Live Pulse */
.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* 4-Card Clean Executive KPI Deck */
.clean-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

@media (max-width: 1024px) {
  .clean-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .clean-kpi-grid { grid-template-columns: 1fr; }
}

.clean-kpi-card {
  background: rgba(12, 14, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 98px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.clean-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.clean-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.kpi-border-cyan::before { background: #06b6d4; }
.kpi-border-magenta::before { background: #ec4899; }
.kpi-border-emerald::before { background: #10b981; }
.kpi-border-amber::before { background: #f59e0b; }

.clean-kpi-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.clean-kpi-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.clean-kpi-icon {
  font-size: 15px;
  opacity: 0.85;
}

.clean-kpi-val {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.15;
}

.clean-kpi-val-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-kpi-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 5px;
}

.clean-kpi-foot {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 6px;
  font-weight: 500;
}

.clean-kpi-dual-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.clean-kpi-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.sub-item-label {
  color: #94a3b8;
  font-size: 11px;
}

.sub-item-val {
  color: #f8fafc;
  font-size: 12px;
}

.text-cyan { color: #38bdf8 !important; }
.text-magenta { color: #f472b6 !important; }
.text-emerald { color: #34d399 !important; }
.text-amber { color: #fbbf24 !important; }

/* Chart Box Clean Header */
.hourly-chart-clean-box {
  background: rgba(12, 14, 21, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.hourly-chart-clean-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.hourly-chart-clean-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
}

.hourly-chart-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(12, 14, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 6px;
  border-radius: 8px;
}

.exec-mode-pill {
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exec-mode-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.exec-mode-pill.active {
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid #06b6d4;
  color: #38bdf8;
  font-weight: 800;
}

/* Telemetry Box Clean */
.hourly-telemetry-box {
  background: rgba(12, 14, 21, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.hourly-telemetry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.hourly-telemetry-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.hourly-telemetry-hint {
  font-size: 10.5px;
  color: #64748b;
}

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
}

@media (max-width: 900px) {
  .telemetry-strip { overflow-x: auto; display: flex; }
  .telemetry-cell { min-width: 45px; }
}

.telemetry-cell {
  background: rgba(22, 25, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 6px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.telemetry-cell:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.telemetry-cell-hour {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  font-family: monospace;
}

.telemetry-cell-val {
  font-size: 11px;
  font-weight: 900;
  color: #fff;
  margin: 2px 0;
}

.telemetry-cell-bar {
  height: 3px;
  border-radius: 2px;
  width: 80%;
  margin: 0 auto;
}

/* Collapsible Table Section */
.hourly-table-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-hourly-table-toggle {
  background: rgba(22, 25, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
}

.btn-hourly-table-toggle:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
}

.hourly-table-wrapper {
  background: rgba(12, 14, 21, 0.95);
  border: 1px solid #334155;
  border-radius: 12px;
  overflow-x: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  max-height: 480px;
  overflow-y: auto;
  animation: fadeIn 0.25s ease;
}

/* ════════════════════════════════════════════════════════════
   ✨ V439: SISTEMA DE DISEÑO MINIMALISTA EJECUTIVO (3 COLORES)
   ════════════════════════════════════════════════════════════ */

/* 1. Íconos de Línea Lucide Consistentes (2px de grosor, 16px/18px) */
.icon-lucide {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -2.5px;
  display: inline-block;
  flex-shrink: 0;
}

.icon-lucide-md {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
}

.icon-lucide-lg {
  width: 20px;
  height: 20px;
  stroke-width: 1.85px;
}

/* 2. Paleta Semántica a 3 Colores */
.c-focus { color: #0ea5e9 !important; }
.c-focus-light { color: #38bdf8 !important; }
.c-positive { color: #22c55e !important; }
.c-alert { color: #f97316 !important; }
.c-muted { color: #94a3b8 !important; }

/* 3. Tarjetas Neutras Uniformes (Elimina bordes de color independientes) */
.stat-card,
.clean-kpi-card,
.product-kpi-box,
.chart-box-card {
  background: rgba(12, 14, 21, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.2s ease !important;
}

.stat-card:hover,
.clean-kpi-card:hover,
.product-kpi-box:hover,
.chart-box-card:hover {
  border-color: rgba(255, 255, 255, 0.16) !important;
  transform: translateY(-1px);
}

/* Retira cualquier pseudoborde de color superior o izquierdo */
.clean-kpi-card::before,
.stat-card--red,
.stat-card--green,
.stat-card--blue,
.stat-card--purple,
.kpi-border-cyan::before,
.kpi-border-magenta::before,
.kpi-border-emerald::before,
.kpi-border-amber::before {
  border: none !important;
  background-image: none !important;
}
.clean-kpi-card::before { display: none !important; }

/* 4. Jerarquía Tipográfica Fija */
/* Nivel 1: Títulos de Sección */
.section-title,
.chart-box-title,
.hourly-clean-title,
.analytics-tab-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  letter-spacing: -0.2px;
}

/* Nivel 2: Valores de KPI */
.stat-value,
.clean-kpi-val,
.product-kpi-val {
  font-size: 24px !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: -0.4px;
  line-height: 1.15;
}

/* Nivel 3: Labels y Metadatos */
.stat-label,
.clean-kpi-title,
.product-kpi-label,
.control-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
}

.stat-sublabel,
.clean-kpi-foot,
.hourly-clean-sub {
  font-size: 11px !important;
  color: #64748b !important;
  font-weight: 500 !important;
}

/* 5. Espaciado Generoso entre Bloques */
.stats-grid-4col,
.goal-thermometer-card,
.ai-compact-strip,
.executive-hourly-suite,
.analytics-tabs-container,
.charts-grid-2col,
.product-cross-card {
  margin-bottom: 24px !important;
}

/* 6. Barra de Pestañas Moderna para Secciones Secundarias */
.analytics-tabs-container {
  margin-top: 10px;
}

.analytics-tabs-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  flex-wrap: wrap;
}

.analytics-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 14, 21, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.analytics-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.15);
}

.analytics-tab-btn.active {
  background: rgba(14, 165, 233, 0.12);
  border-color: #0ea5e9;
  color: #38bdf8;
}

.analytics-tab-pane {
  display: none;
  animation: fadeIn 0.25s ease;
}

.analytics-tab-pane.active {
  display: block;
}

/* 7. Estados Vacíos Discretos */
.empty-state-discreet {
  text-align: center;
  font-size: 11.5px;
  color: #64748b;
  padding: 22px 14px;
  font-weight: 500;
}

/* 8. Insignias y Pills Limpias (Sin morados ni magentas) */
.clean-tag-focus {
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.clean-tag-positive {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

.clean-tag-alert {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 🏪 SELECTOR INTELIGENTE CON BUSCADOR DE TIENDAS (MONITOR HORA A HORA)      */
/* ══════════════════════════════════════════════════════════════════════════ */
.hourly-store-picker-custom {
  position: relative;
  display: inline-block;
  min-width: 280px;
  max-width: 440px;
}

.hourly-store-trigger-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(12, 14, 21, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.hourly-store-trigger-btn:hover {
  background: rgba(22, 25, 36, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
}

.hourly-store-trigger-btn.active {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.store-trigger-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.store-trigger-text {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f8fafc;
}

.store-trigger-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}

.store-trigger-arrow {
  font-size: 11px;
  color: #94a3b8;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.hourly-store-trigger-btn.active .store-trigger-arrow {
  transform: rotate(180deg);
  color: #38bdf8;
}

/* Panel Flotante Popover */
.store-dropdown-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 380px;
  max-width: 90vw;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 20px rgba(14, 165, 233, 0.12);
  z-index: 10005;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.store-dropdown-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(12, 14, 21, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.store-dropdown-search-wrap .search-icon {
  font-size: 13px;
  color: #94a3b8;
  margin-right: 8px;
}

.store-dropdown-search-input {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 6px 10px;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s ease;
}

.store-dropdown-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.search-clear-btn {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 6px;
  position: absolute;
  right: 18px;
}

.search-clear-btn:hover {
  color: #f1f5f9;
}

/* Pestañas rápidas de filtro */
.store-dropdown-quick-filters {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(22, 25, 36, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-filter-btn {
  flex: 1;
  background: rgba(12, 14, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.quick-filter-btn:hover {
  background: rgba(22, 25, 36, 0.9);
  color: #f1f5f9;
}

.quick-filter-btn.active {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4);
}

.quick-filter-btn.filter-oscar.active {
  background: #16a34a;
  border-color: #22c55e;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

.quick-filter-btn.filter-julio.active {
  background: #2563eb;
  border-color: #60a5fa;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* Opciones Consolidadas Fijadas */
.store-dropdown-pinned-options {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 21, 0.85);
}

.store-dropdown-divider {
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #64748b;
  background: rgba(22, 25, 36, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Lista de Tiendas con Scroll */
.store-dropdown-list {
  max-height: 270px;
  overflow-y: auto;
  padding: 4px 0;
}

.store-dropdown-list::-webkit-scrollbar {
  width: 5px;
}

.store-dropdown-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Elemento individual de tienda */
.store-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}

.store-dropdown-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-left-color: #38bdf8;
}

.store-dropdown-item.active {
  background: rgba(56, 189, 248, 0.14);
  border-left-color: #38bdf8;
}

.store-dropdown-item .item-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.store-dropdown-item .item-info {
  flex: 1;
  min-width: 0;
}

.store-dropdown-item .item-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.store-dropdown-item.active .item-name {
  color: #38bdf8;
}

.store-dropdown-item .item-sub {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 1px;
}

.store-dropdown-item .item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.store-dropdown-item .meta-tag {
  font-size: 10px;
  color: #94a3b8;
}

.store-dropdown-item .meta-cat {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  color: #cbd5e1;
  font-weight: 600;
}

.store-dropdown-item .item-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.item-check {
  color: #38bdf8;
  font-weight: 900;
  font-size: 13px;
}

/* Insignias de Traffickers */
.item-badge-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-all {
  background: rgba(99, 102, 241, 0.2);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.badge-oscar {
  background: rgba(34, 197, 94, 0.18);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.badge-julio {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}

.store-dropdown-empty {
  padding: 22px 14px;
  text-align: center;
  color: #64748b;
  font-size: 11.5px;
}

.store-dropdown-empty span {
  font-size: 20px;
  display: block;
  margin-bottom: 4px;
}

/* ── COMPARADOR Y MODOS DE VISTA CPR ── */
.cpr-tab-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 12.5px;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cpr-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.cpr-tab-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
}

.cpr-comparison-card {
  background: rgba(12, 14, 21, 0.65);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.cpr-comparison-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 📌 FILA RESALTADA CON CLIC (PIN / HIGHLIGHT) */
tr.row-pinned-highlight {
  background: rgba(30, 58, 138, 0.35) !important;
  box-shadow: inset 0 2px 0 #38bdf8, inset 0 -2px 0 #38bdf8 !important;
}

tr.row-pinned-highlight td:first-child {
  border-left: 3px solid #38bdf8 !important;
}

tr.row-pinned-highlight td {
  color: #fff !important;
  font-weight: 750 !important;
}

/* 🌳 VISTA JERÁRQUICA EN ÁRBOL (BPO > PRODUCTO > TIENDA) */
.tree-node-bpo {
  background: rgba(22, 25, 36, 0.85);
  font-weight: 800;
  border-bottom: 2px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
  user-select: none;
}

.tree-node-bpo:hover {
  background: rgba(51, 65, 85, 0.85);
}

.tree-node-prod {
  background: rgba(12, 14, 21, 0.6);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  user-select: none;
}

.tree-node-prod:hover {
  background: rgba(22, 25, 36, 0.6);
}

.tree-node-store {
  background: transparent;
  transition: background 0.15s ease;
}

.tree-node-store:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tree-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #38bdf8;
  font-weight: 900;
  font-size: 13px;
  margin-right: 8px;
  transition: transform 0.15s ease;
}

/* 📈 TABLA Y BADGES DE TENDENCIA DÍA A DÍA */
.tendencia-badge-up-good {
  color: #22c55e;
  font-weight: 800;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tendencia-badge-up-bad {
  color: #ef4444;
  font-weight: 800;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tendencia-badge-down-good {
  color: #22c55e;
  font-weight: 800;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tendencia-badge-down-bad {
  color: #ef4444;
  font-weight: 800;
  font-size: 10.5px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.tendencia-badge-eq {
  color: #94a3b8;
  font-weight: 700;
  font-size: 10px;
}

/* 🛡️ AUDITORÍA & CRUCES CARDS */
.audit-card {
  background: rgba(12, 14, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.audit-card-danger {
  border-left: 4px solid #ef4444;
}

.audit-card-warning {
  border-left: 4px solid #f59e0b;
}

.audit-card-success {
  border-left: 4px solid #22c55e;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 👑 RADAR DE CREATIVOS: GANADORES VS QUEMADOS                              */
/* ══════════════════════════════════════════════════════════════════════════ */

.radar-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.radar-kpi-card {
  background: rgba(12, 14, 21, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.radar-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.3);
}

.radar-kpi-icon {
  font-size: 26px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-kpi-info {
  display: flex;
  flex-direction: column;
}

.radar-kpi-val {
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.radar-kpi-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.radar-kpi-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.radar-toolbar {
  background: rgba(12, 14, 21, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.radar-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

.radar-ad-card {
  background: rgba(12, 14, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
}

.radar-ad-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.radar-card-winner {
  border-top: 4px solid #22c55e;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08) 0%, rgba(12, 14, 21, 0.9) 35%);
}

.radar-card-burned {
  border-top: 4px solid #ef4444;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(12, 14, 21, 0.9) 35%);
}

.radar-card-at-risk {
  border-top: 4px solid #f59e0b;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(12, 14, 21, 0.9) 35%);
}

.radar-card-stable {
  border-top: 4px solid #38bdf8;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(12, 14, 21, 0.9) 35%);
}

.radar-card-learning {
  border-top: 4px solid #94a3b8;
  background: linear-gradient(180deg, rgba(148, 163, 184, 0.05) 0%, rgba(12, 14, 21, 0.9) 35%);
}

.radar-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.radar-store-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.radar-store-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.radar-store-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.radar-badge-winner {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.radar-badge-burned {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.radar-badge-at-risk {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.radar-badge-stable {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 800;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.radar-badge-learning {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.radar-ad-body {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 10px 12px;
}

.radar-ad-name {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.radar-campaign-name {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.radar-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.radar-metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 4px;
}

.radar-metric-val {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.radar-metric-lbl {
  font-size: 9.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.radar-action-box {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
}

.radar-btn-copy {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.radar-btn-copy:hover {
  background: #38bdf8;
  color: #0f172a;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ⚡ BARRA DE COMANDO EJECUTIVA UNIFICADA (CLEAN EXECUTIVE COMMAND BAR)     */
/* ══════════════════════════════════════════════════════════════════════════ */

.cpr-unified-command-bar {
  background: rgba(12, 14, 21, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 14px 22px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1000;
}

.cpr-command-level-1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cpr-command-level-2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cpr-selector-label {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-right: 6px;
}

.cpr-view-selector-wrapper {
  display: flex;
  align-items: center;
}

.cpr-smart-select {
  background: rgba(22, 25, 36, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  min-width: 280px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.cpr-smart-select:hover,
.cpr-smart-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  background: #1e293b;
}

/* Redesigned Modern Segmented Period Control (No dark ugly box) */
.cpr-period-pills-group {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.cpr-period-pills {
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cpr-period-pills .pill {
  background: transparent !important;
  color: #94a3b8 !important;
  border: 1px solid transparent !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 6px 12px !important;
  border-radius: 7px !important;
  cursor: pointer !important;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: none !important;
}

.cpr-period-pills .pill:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.cpr-period-pills .pill.active {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45) !important;
}

.cpr-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Custom pills */
.pill-cyan {
  background: rgba(14, 165, 233, 0.18) !important;
  border: 1px solid rgba(14, 165, 233, 0.4) !important;
  color: #38bdf8 !important;
  font-weight: 800 !important;
}
.pill-cyan:hover {
  background: rgba(14, 165, 233, 0.35) !important;
  color: #fff !important;
}

.pill-blue {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: none !important;
}

.pill-emerald {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #fff !important;
  font-weight: 800 !important;
  border: none !important;
}

.pill-purple {
  background: rgba(168, 85, 247, 0.2) !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  color: #c084fc !important;
  font-weight: 800 !important;
}
.pill-purple:hover {
  background: rgba(168, 85, 247, 0.35) !important;
  color: #fff !important;
}

.pill-warning {
  background: rgba(245, 158, 11, 0.2) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fbbf24 !important;
  font-weight: 800 !important;
}

.pill-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  white-space: nowrap;
}

/* Dropdown Menu System (Complete fix for z-index, table overlap and clipping) */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1e293b !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 25px rgba(56, 189, 248, 0.2) !important;
  min-width: 270px !important;
  width: max-content !important;
  z-index: 9999999 !important;
  padding: 8px !important;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.15s ease;
}

.dropdown-menu a {
  color: #f1f5f9 !important;
  text-decoration: none;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 10px 14px !important;
  border-radius: 9px !important;
  transition: all 0.15s ease;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  white-space: nowrap !important;
  border: 1px solid transparent;
}

.dropdown-menu a:hover {
  background: rgba(56, 189, 248, 0.18) !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  transform: translateX(3px);
}

/* Popover de Fecha Personalizada */
.cpr-date-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #1e293b !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95) !important;
  padding: 14px 16px;
  z-index: 9999999 !important;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
}

.cpr-search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.cpr-search-icon {
  position: absolute;
  left: 12px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

.cpr-search-box .search-input {
  width: 100%;
  padding-left: 32px;
  padding-right: 28px;
  font-size: 12.5px;
  border-radius: 9px;
  box-sizing: border-box;
}

.cpr-search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.cpr-search-clear:hover {
  color: #fff;
}

.cpr-toggles-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Table Last Column Padding (Never crash into right border) */
.data-table th:last-child,
.data-table td:last-child {
  padding-right: 22px !important;
}

/* Stat Cards & KPI Grid Enhanced Sizing */
.cpr-stats-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 12px !important;
  margin-bottom: 18px !important;
  width: 100% !important;
}

.cpr-stats-grid .stat-card {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-sizing: border-box !important;
}

.cpr-stats-grid .stat-icon {
  width: 38px !important;
  height: 38px !important;
  font-size: 18px !important;
  flex-shrink: 0 !important;
}

.cpr-stats-grid .stat-body {
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}

.cpr-stats-grid .stat-value-container {
  display: flex !important;
  align-items: baseline !important;
  gap: 6px !important;
  flex-wrap: wrap !important;
  margin-bottom: 2px !important;
}

.cpr-stats-grid .stat-value {
  font-size: clamp(14px, 1.15vw, 18px) !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
  line-height: 1.1 !important;
}

.cpr-stats-grid .stat-body .badge {
  font-size: 9.5px !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.cpr-stats-grid .stat-label {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

/* 💳 Estilos de la tarjeta Wallet Pancake USD y alerta en rojo */
.stat-card--wallet {
  transition: all 0.25s ease;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(12, 14, 21, 0.85) 100%) !important;
}

.stat-card--wallet:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.6) !important;
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.2) !important;
}

.stat-card--wallet-danger {
  border: 2px solid #ef4444 !important;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(127, 29, 29, 0.6) 100%) !important;
  animation: walletDangerPulse 1.8s infinite ease-in-out !important;
}

@keyframes walletDangerPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@media (max-width: 1550px) {
  .cpr-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1200px) {
  .cpr-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 768px) {
  .cpr-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 480px) {
  .cpr-stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Radar Badges for 30D / 40+ Days Active Creatives */
.radar-badge-days-active {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.radar-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 🚀 MÓDULO INTELIGENCIA: PROYECCIÓN 23:59 (PACING) & DUELO DE TRAFFICKERS   */
/* ══════════════════════════════════════════════════════════════════════════ */

.intelligence-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

@media (max-width: 1024px) {
  .intelligence-grid-2col {
    grid-template-columns: 1fr;
  }
}

.intel-suite-card {
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.88) 0%, rgba(20, 30, 50, 0.92) 100%);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.intel-suite-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #38bdf8, transparent);
}

.intel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 10px;
}

.intel-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.intel-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.intel-title-text h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.intel-title-text p {
  margin: 2px 0 0 0;
  font-size: 11px;
  color: #94a3b8;
}

/* Micro-KPIs Grid for Projection */
.pacing-kpis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 600px) {
  .pacing-kpis-grid {
    grid-template-columns: 1fr;
  }
}

.pacing-kpi-box {
  background: rgba(12, 14, 21, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.pacing-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pacing-kpi-val {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
}

.pacing-kpi-sub {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* Barra de Pacing & Ritmo */
.pacing-track-wrap {
  background: rgba(12, 14, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: auto;
}

.pacing-track-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 6px;
}

.pacing-progress-bar-bg {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.pacing-progress-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}

/* 👥 DUELO TRAFFICKERS: Cara a Cara */
.duel-versus-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 12px;
}

@media (max-width: 580px) {
  .duel-versus-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.duel-side-card {
  background: rgba(12, 14, 21, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px;
  position: relative;
  transition: all 0.25s ease;
}

.duel-side-card.leader-active {
  border-color: rgba(250, 204, 21, 0.4);
  background: linear-gradient(135deg, rgba(22, 25, 36, 0.85) 0%, rgba(12, 14, 21, 0.95) 100%);
  box-shadow: 0 4px 15px rgba(234, 179, 8, 0.12);
}

.duel-person-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.duel-person-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.duel-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.duel-stat-label {
  color: #94a3b8;
  font-weight: 600;
}

.duel-stat-val {
  font-weight: 800;
  color: #f1f5f9;
}

.duel-vs-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.duel-vs-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #94a3b8;
}

/* Split Dominance Bar */
.duel-dominance-bar {
  display: flex;
  height: 8px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  margin-top: 6px;
}

.duel-bar-oscar {
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.6s ease;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 🧠 COPILOT IA DE NEGOCIOS (CLAUDE 5.5) - DRAWER & BOTÓN FLOTANTE           */
/* ══════════════════════════════════════════════════════════════════════════ */

.btn-ai-header {
  background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.4);
  padding: 6px 13px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
  transition: all 0.25s ease;
}

.btn-ai-header:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
  border-color: rgba(167, 139, 250, 0.7);
}

.btn-floating-ai {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99990;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 18px;
  border-radius: 30px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-floating-ai:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.65);
}

.ai-drawer-overlay {
  display: none !important;
  pointer-events: none !important;
}

.ai-drawer-container {
  position: fixed;
  top: 0;
  right: -550px;
  width: 500px;
  max-width: 95vw;
  height: 100vh;
  background: #0b1120;
  border-left: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: -15px 0 50px rgba(0, 0, 0, 0.75);
  z-index: 99990;
  display: flex;
  flex-direction: column;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s ease, height 0.25s ease, border-radius 0.25s ease;
}

.ai-drawer-container.active {
  right: 0;
}

/* 🗗 MODO MINI-PESTAÑA FLOTANTE (PIP) - Permite mirar las otras tiendas mientras responde */
.ai-drawer-container.mini-mode {
  top: auto;
  bottom: 24px;
  right: -550px;
  width: 440px;
  max-width: 92vw;
  height: 540px;
  max-height: 80vh;
  border-radius: 16px;
  border: 1px solid rgba(139, 92, 246, 0.5);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.85), 0 0 25px rgba(124, 58, 237, 0.25);
}

.ai-drawer-container.mini-mode.active {
  right: 24px;
}

.ai-header-btn-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c4b5fd;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-header-btn-action:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #fff;
  border-color: #a78bfa;
}

.btn-floating-ai.thinking {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
  animation: aiPulse 1.5s infinite alternate;
}

.btn-floating-ai.has-new-reply {
  background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.7);
  animation: aiBounce 1s infinite alternate;
}

@keyframes aiPulse {
  from { transform: scale(1); box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4); }
  to { transform: scale(1.05); box-shadow: 0 15px 35px rgba(236, 72, 153, 0.7); }
}

@keyframes aiBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.ai-drawer-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(12, 14, 21, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ai-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-drawer-title h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-drawer-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.ai-drawer-close:hover {
  color: #fff;
}

.ai-drawer-subbar {
  padding: 10px 18px;
  background: rgba(12, 14, 21, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-store-selector {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.ai-quick-prompts-bar {
  padding: 10px 18px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: none;
}

.ai-quick-prompts-bar::-webkit-scrollbar {
  display: none;
}

.ai-chip-btn {
  white-space: nowrap;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chip-btn:hover {
  background: rgba(139, 92, 246, 0.25);
  color: #fff;
  border-color: rgba(139, 92, 246, 0.5);
}

.ai-messages-list {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ai-msg {
  display: flex;
  flex-direction: column;
  max-width: 90%;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-word;
}

.ai-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.ai-msg-assistant {
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.ai-msg-assistant strong {
  color: #fff;
}

.ai-msg-assistant ul, .ai-msg-assistant ol {
  margin: 6px 0;
  padding-left: 18px;
}

.ai-msg-assistant li {
  margin-bottom: 4px;
}

.ai-msg-assistant h4 {
  margin: 10px 0 4px 0;
  color: #38bdf8;
  font-size: 13px;
}

.ai-typing-indicator {
  display: none;
  align-self: flex-start;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: #c4b5fd;
  align-items: center;
  gap: 8px;
}

.ai-input-bar {
  padding: 14px 18px;
  background: rgba(12, 14, 21, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-input-field {
  flex: 1;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  outline: none;
  resize: none;
  max-height: 90px;
  font-family: inherit;
}

.ai-input-field:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.ai-btn-send {
  background: linear-gradient(135deg, #7c3aed, #3b82f6);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.ai-btn-send:hover {
  transform: scale(1.05);
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 📈 SUITE DE EVOLUCIÓN HISTÓRICA & COMPARADOR DE TIENDAS (PRO ANALYTICS)     */
/* ══════════════════════════════════════════════════════════════════════════ */
.trends-hero-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.95) 0%, rgba(22, 25, 36, 0.9) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
}

/* ══════════════════════════════════════════════════════════════════════════
   BARRA INTELIGENTE DE COMPARACIÓN POR PRODUCTO & BUSCADOR CHIMBA
   ══════════════════════════════════════════════════════════════════════════ */
.trends-product-match-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(12, 14, 21, 0.95) 0%, rgba(22, 25, 36, 0.85) 100%);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  padding: 12px 18px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.trends-match-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trends-match-bar-icon {
  font-size: 22px;
}

.trends-match-bar-title {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.3px;
}

.trends-match-bar-sub {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

.trends-category-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.trends-cat-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.trends-cat-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  transform: translateY(-1px);
}

.trends-cat-chip.active {
  background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.4);
}

.btn-auto-match-duel {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  color: #fff;
  border: none;
  font-size: 11.5px;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35);
  white-space: nowrap;
}

.btn-auto-match-duel:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.5);
}

.trends-stores-selector-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.trends-store-box {
  flex: 1;
  min-width: 280px;
  background: rgba(12, 14, 21, 0.85);
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
}

.trends-store-box.store-a {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.trends-store-box.store-b {
  border-color: rgba(192, 132, 252, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08) 0%, rgba(12, 14, 21, 0.9) 100%);
}

.btn-swap-stores {
  background: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
  color: #fff;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.4);
  flex-shrink: 0;
}

.btn-swap-stores:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

/* CUSTOM SEARCHABLE DROPDOWN TRIGGER & POPOVER */
.trends-custom-select-trigger {
  width: 100%;
  background: rgba(22, 25, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.trends-store-box.store-a .trends-custom-select-trigger:hover,
.trends-store-box.store-a .trends-custom-select-trigger.active {
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  background: rgba(22, 25, 36, 0.98);
}

.trends-store-box.store-b .trends-custom-select-trigger:hover,
.trends-store-box.store-b .trends-custom-select-trigger.active {
  border-color: #c084fc;
  box-shadow: 0 0 15px rgba(192, 132, 252, 0.25);
  background: rgba(22, 25, 36, 0.98);
}

.trends-trigger-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.trends-trigger-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trends-trigger-sub {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trends-trigger-arrow {
  font-size: 10px;
  color: #94a3b8;
  transition: transform 0.2s ease;
}

.trends-custom-select-trigger.active .trends-trigger-arrow {
  transform: rotate(180deg);
  color: #38bdf8;
}

.trends-store-box.store-b .trends-custom-select-trigger.active .trends-trigger-arrow {
  color: #c084fc;
}

/* POPOVER FLOTANTE */
.trends-custom-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 9999;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.trends-custom-dropdown.hidden {
  display: none !important;
}

.trends-dropdown-search-wrap {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.trends-dropdown-search-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s;
}

.trends-dropdown-search-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.trends-store-box.store-b .trends-dropdown-search-input:focus {
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(192, 132, 252, 0.2);
}

.trends-dropdown-count {
  font-size: 10.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.trends-dropdown-quick-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.trends-mini-chip {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.trends-mini-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.trends-mini-chip.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.trends-store-box.store-b .trends-mini-chip.active {
  background: rgba(192, 132, 252, 0.2);
  border-color: #c084fc;
  color: #c084fc;
}

.trends-dropdown-list {
  max-height: 270px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trends-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}

.trends-dropdown-item:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateX(2px);
}

.trends-dropdown-item.selected {
  background: rgba(56, 189, 248, 0.18);
  border-color: #38bdf8;
}

.trends-store-box.store-b .trends-dropdown-item:hover {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.3);
}

.trends-store-box.store-b .trends-dropdown-item.selected {
  background: rgba(192, 132, 252, 0.18);
  border-color: #c084fc;
}

.trends-item-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
}

.trends-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 10.5px;
}

.trends-tag-product {
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 9.5px;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.trends-tag-traf {
  color: #cbd5e1;
  font-weight: 600;
}

.trends-tag-phone {
  color: #64748b;
  font-family: monospace;
}

.trends-item-check {
  color: #22c55e;
  font-weight: 900;
  font-size: 14px;
}

.trends-empty-results {
  padding: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.duel-kpis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.duel-kpi-card {
  background: rgba(12, 14, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.duel-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.18);
}

.duel-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 800;
  text-transform: uppercase;
  min-height: 22px;
}

.duel-kpi-header > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.duel-kpi-values-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.duel-kpi-val-a {
  font-size: 14.5px;
  font-weight: 900;
  color: #38bdf8;
  font-family: 'Outfit', -apple-system, sans-serif;
  white-space: nowrap;
}

.duel-kpi-val-b {
  font-size: 14.5px;
  font-weight: 900;
  color: #c084fc;
  font-family: 'Outfit', -apple-system, sans-serif;
  white-space: nowrap;
}

.duel-kpi-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 145px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  line-height: 1.3;
}

.trends-chart-box {
  background: rgba(12, 14, 21, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.35);
}

.trends-table-wrap {
  background: #090e1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* 🎯 ESTILOS PARA EL RADAR DE CREATIVOS & DUELO DE ANUNCIOS */
.radar-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.radar-summary-card {
  border-radius: 12px;
  padding: 14px 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.radar-summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.radar-ad-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.radar-ad-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.badge-burned {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-day2 {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-day1 {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-at-risk {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-winner {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-stable {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-learning {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-weight: 800;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* 💎 BPO COMMAND CENTER — CARDS AUDITORÍA & LOGÍSTICA (ULTRA-MODERN REDESIGN) */
/* ══════════════════════════════════════════════════════════════════════════ */

.bpo-auditoria-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
  align-items: stretch;
}

@media (max-width: 1280px) {
  .bpo-auditoria-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}

.bpo-audit-card {
  background: linear-gradient(180deg, rgba(22, 32, 53, 0.75) 0%, rgba(13, 20, 36, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.bpo-audit-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 14px 40px -5px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Top Accent Line */
.bpo-audit-card.card-antifraud {
  border-top: 3px solid #f43f5e;
}
.bpo-audit-card.card-logistics {
  border-top: 3px solid #0284c7;
}
.bpo-audit-card.card-ghost {
  border-top: 3px solid #8b5cf6;
}

.bpo-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bpo-audit-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bpo-audit-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.bpo-audit-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.bpo-audit-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 480px;
  padding-right: 4px;
}

/* Scrollbars */
.bpo-audit-body::-webkit-scrollbar,
.bpo-custom-scroll::-webkit-scrollbar {
  width: 5px;
}
.bpo-audit-body::-webkit-scrollbar-track,
.bpo-custom-scroll::-webkit-scrollbar-track {
  background: rgba(12, 14, 21, 0.4);
  border-radius: 4px;
}
.bpo-audit-body::-webkit-scrollbar-thumb,
.bpo-custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}
.bpo-audit-body::-webkit-scrollbar-thumb:hover,
.bpo-custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

/* Botones & Badges de Cabecera */
.btn-bpo-wa {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}
.btn-bpo-wa:hover {
  background: rgba(34, 197, 94, 0.24);
  border-color: #22c55e;
  transform: translateY(-1px);
}

.badge-bpo-cod {
  font-size: 10.5px;
  color: #fb7185;
  font-weight: 800;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.28);
  padding: 4px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-bpo-header {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-bpo-header.sky {
  color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.badge-bpo-header.purple {
  color: #c084fc;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Buscador Anti-Fraude */
.bpo-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: center;
}

.bpo-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.bpo-search-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  color: #64748b;
  pointer-events: none;
}

.bpo-search-input-wrap input {
  width: 100%;
  background: rgba(12, 14, 21, 0.65);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 12px 8px 30px;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.bpo-search-input-wrap input:focus {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
  background: rgba(12, 14, 21, 0.9);
}

.btn-bpo-verify {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-bpo-verify:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.45);
}

.btn-bpo-icon {
  background: rgba(22, 25, 36, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #38bdf8;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-bpo-icon:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

/* Segmented Tabs */
.bpo-segmented-tabs {
  display: flex;
  background: rgba(12, 14, 21, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 12px;
}

.bpo-tab-btn {
  flex: 1;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  padding: 6px 6px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.bpo-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.bpo-tab-btn.active {
  background: #1e293b;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.bpo-tab-btn.active.tab-critical {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.bpo-tab-btn.active.tab-single {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.bpo-tab-btn.active.tab-curious {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* Tarjeta Cliente Sospechoso */
.bpo-customer-card {
  background: rgba(12, 14, 21, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 9px;
  transition: all 0.2s ease;
}
.bpo-customer-card:hover {
  background: rgba(22, 25, 36, 0.6);
  border-color: rgba(255, 255, 255, 0.14);
}
.bpo-customer-card.card-duplicate {
  border-left: 3px solid #f43f5e;
  background: linear-gradient(90deg, rgba(244, 63, 94, 0.07) 0%, rgba(12, 14, 21, 0.5) 100%);
}
.bpo-customer-card.card-single-order {
  border-left: 3px solid #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.06) 0%, rgba(12, 14, 21, 0.5) 100%);
}
.bpo-customer-card.card-inquiry-only {
  border-left: 3px solid #64748b;
}

.bpo-tag-store-order {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
}
.bpo-tag-store-inquiry {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: #93c5fd;
  padding: 1px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
}

.btn-bpo-action-copy {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(225, 29, 72, 0.25);
  transition: all 0.2s ease;
}
.btn-bpo-action-copy:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  transform: translateY(-1px);
}

.btn-bpo-action-audit {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-bpo-action-audit:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Card 2: Transportadoras & Logística */
.bpo-carrier-card {
  background: rgba(12, 14, 21, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.bpo-carrier-card:hover {
  background: rgba(22, 25, 36, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.bpo-carrier-bar {
  height: 6px;
  border-radius: 9999px;
  background: rgba(244, 63, 94, 0.35);
  overflow: hidden;
  display: flex;
  margin: 6px 0;
}
.bpo-carrier-bar-fill-green {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  border-radius: 9999px;
}
.bpo-carrier-bar-fill-red {
  height: 100%;
  background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.bpo-motivo-chip {
  background: rgba(22, 25, 36, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 10px;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bpo-city-card {
  background: rgba(12, 14, 21, 0.55);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-left: 3px solid #f43f5e;
  border-radius: 8px;
  padding: 6px 10px;
}

.btn-bpo-danger-full {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border: 1px solid rgba(244, 63, 94, 0.35);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
  transition: all 0.2s ease;
}
.btn-bpo-danger-full:hover {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(225, 29, 72, 0.35);
}

/* Card 3: Ventas Fantasma */
.bpo-ghost-card {
  background: rgba(12, 14, 21, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 11px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}
.bpo-ghost-card:hover {
  background: rgba(22, 25, 36, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-bpo-ghost-claim {
  background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
  transition: all 0.2s ease;
}
.btn-bpo-ghost-claim:hover {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  transform: translateY(-1px);
}

.bpo-audit-tip-box {
  background: rgba(139, 92, 246, 0.08);
  border: 1px dashed rgba(139, 92, 246, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* 📥 Botones de Acción Anti-Fraude & Excel */
.btn-bpo-excel {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
  transition: all 0.2s ease;
}
.btn-bpo-excel:hover {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
}

.btn-bpo-deep {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #fff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  padding: 5px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
  transition: all 0.2s ease;
}
.btn-bpo-deep:hover {
  background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.35);
}

/* Pestaña Serial Returners */
.bpo-tab-btn.active.tab-serial {
  background: rgba(168, 85, 247, 0.22);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

/* Tarjeta Serial Returner */
.bpo-customer-card.card-serial {
  border-left: 3px solid #a855f7;
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.1) 0%, rgba(12, 14, 21, 0.55) 100%);
}

/* Dropzone de Guías Logísticas */
.bpo-guias-dropzone {
  border: 2px dashed rgba(99, 102, 241, 0.4);
  background: rgba(12, 14, 21, 0.6);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.bpo-guias-dropzone:hover,
.bpo-guias-dropzone.dragover {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
}

/* Barra de progreso de escaneo profundo */
.bpo-progress-bar-wrap {
  background: rgba(12, 14, 21, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  position: relative;
}
.bpo-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4f46e5 0%, #06b6d4 50%, #10b981 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
  background-size: 30px 30px;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  animation: bpoStripes 1s linear infinite;
}

@keyframes bpoStripes {
  from { background-position: 0 0; }
  to { background-position: 30px 0; }
}
