:root {
  --bg-page: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #263449;
  --bg-input: #0f172a;
  --border-color: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --green: #10b981;
  --green-bg: rgba(16, 185, 129, 0.14);
  --amber: #f59e0b;
  --amber-bg: rgba(245, 158, 11, 0.15);
  --red: #ef4444;
  --red-bg: rgba(239, 68, 68, 0.15);
  --purple: #8b5cf6;
  --target-red: #e11d48;
  --walmart-blue: #0284c7;
  --cvs-red: #dc2626;
  --walgreens-teal: #0d9488;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(30, 41, 59, 0.92);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.topbar h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-pro {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

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

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  color: #fff;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  transform: translateY(-1px);
}

.btn-secondary {
  background: linear-gradient(135deg, #059669, #047857);
}
.btn-secondary:hover {
  background: linear-gradient(135deg, #10b981, #059669);
}

.btn-outline {
  background: #1e293b;
  border-color: var(--border-color);
  color: #e2e8f0;
}
.btn-outline:hover {
  background: #334155;
}

.btn-danger-outline {
  background: transparent;
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.15);
}

.btn-link {
  background: none;
  border: none;
  color: #60a5fa;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 8px;
  border-radius: 6px;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* LAYOUT CONTAINER */
.container {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px 28px 60px;
}

/* KPI GRID */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.kpi-hot { border-left: 4px solid #ef4444; background: linear-gradient(135deg, rgba(239, 68, 68, 0.10), var(--bg-card)); }
.kpi-green { border-left: 4px solid var(--green); }
.kpi-blue { border-left: 4px solid var(--accent-primary); }
.kpi-amber { border-left: 4px solid var(--amber); }
.kpi-purple { border-left: 4px solid var(--purple); }

/* HUNTER BANNER (MOTOR CADA 30 MIN) */
.hunter-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 13px 18px;
  margin-bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hunter-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulseRed 1.8s infinite;
  flex-shrink: 0;
}

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

.hunter-title {
  font-size: 0.88rem;
  color: #f8fafc;
}

.hunter-sub {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.legend-hot { color: #f87171; font-weight: 700; }
.legend-warm { color: #fbbf24; font-weight: 700; }
.legend-cool { color: #34d399; font-weight: 700; }

.hunter-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.countdown-pill {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fca5a5;
}

.btn-hot {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.35);
}
.btn-hot:hover {
  background: linear-gradient(135deg, #f87171, #ef4444);
  transform: translateY(-1px);
}

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

.kpi-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.kpi-foot {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* STORE TABS */
.store-tabs-bar {
  margin-bottom: 16px;
}

.store-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.store-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: #cbd5e1;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}

.store-tab:hover {
  background: var(--bg-card-hover);
  color: #fff;
}

.store-tab.active {
  background: #2563eb;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
}

.tab-count {
  background: rgba(15, 23, 42, 0.45);
  padding: 1px 7px;
  border-radius: 99px;
  font-size: 0.75rem;
}

/* FILTERS PANEL */
.filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.filter-search {
  flex: 1;
  min-width: 240px;
}

.filter-small {
  width: 125px;
}

.filter-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="url"],
select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 0.85rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--accent-primary);
}

.filter-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding-bottom: 6px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.83rem;
  color: #e2e8f0 !important;
}

/* TABLE CARD */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.table-responsive {
  overflow-x: auto;
}

.arb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.arb-table th {
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
}

.arb-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.6);
  vertical-align: middle;
}

.arb-table tbody tr {
  transition: background 0.12s;
}

.arb-table tbody tr:hover {
  background: rgba(51, 65, 85, 0.35);
}

/* PRODUCT CELL */
.prod-cell {
  display: flex;
  gap: 16px;
  align-items: center;
}

.prod-thumb {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: #ffffff;
  object-fit: contain;
  padding: 6px;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  cursor: zoom-in;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  position: relative;
}

.prod-thumb:hover {
  transform: scale(1.75);
  z-index: 40;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  border-color: var(--accent-primary);
}

.drawer-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-prod-img {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  background: #ffffff;
  object-fit: contain;
  padding: 5px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
  cursor: zoom-in;
}

/* LIGHTBOX ZOOM DE IMAGEN */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  z-index: 250;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(5px);
  cursor: zoom-out;
}

.lightbox-img {
  max-width: min(560px, 90vw);
  max-height: 78vh;
  background: #ffffff;
  padding: 18px;
  border-radius: 16px;
  object-fit: contain;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
}

.lightbox-caption {
  margin-top: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: #f8fafc;
  text-align: center;
  max-width: 600px;
}

.prod-title-store {
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 3px;
  line-height: 1.3;
}

.prod-title-amz {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.prod-meta-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.73rem;
}

.meta-pill {
  background: rgba(15, 23, 42, 0.7);
  padding: 2px 7px;
  border-radius: 5px;
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
}

a.meta-pill:hover {
  border-color: #60a5fa;
  color: #60a5fa;
}

/* STORE BADGES */
.store-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.store-Target { background: var(--target-red); }
.store-Walmart { background: var(--walmart-blue); }
.store-CVS { background: var(--cvs-red); }
.store-Walgreens { background: var(--walgreens-teal); }

.promo-note {
  font-size: 0.75rem;
  color: #fbbf24;
  display: block;
}

/* PRICE & PROFIT CELLS */
.price-big {
  font-size: 1rem;
  font-weight: 700;
}

.price-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  display: block;
}

.dual-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.method-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  font-size: 0.79rem;
}

.method-row.winner {
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.method-row.loser-neg {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.profit-pos { color: #34d399; font-weight: 700; }
.profit-neg { color: #f87171; font-weight: 700; }

/* VIABILITY & HEAT THERMOMETER BADGES (ROJO HOT -> NARANJA ALTA -> VERDE MENOR) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 0.77rem;
  font-weight: 800;
}

.status-HOT {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.28), rgba(220, 38, 38, 0.18));
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.status-WARM {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.status-COOL {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-PURGE {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

tr.row-HOT {
  border-left: 4px solid #ef4444;
  background: rgba(239, 68, 68, 0.04);
}
tr.row-WARM {
  border-left: 4px solid #f59e0b;
}
tr.row-COOL {
  border-left: 4px solid #10b981;
}

.pack-badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.73rem;
  padding: 2px 7px;
  border-radius: 5px;
}
.pack-ok {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}
.pack-warn {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
  font-weight: 600;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0.35;
  transition: transform 0.15s, opacity 0.15s;
}
.star-btn:hover {
  opacity: 0.8;
  transform: scale(1.15);
}
.star-btn.active {
  opacity: 1;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

/* DRAWER LATERAL */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  z-index: 90;
  backdrop-filter: blur(3px);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 680px;
  max-width: 96vw;
  height: 100vh;
  background: #1e293b;
  border-left: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 35px rgba(0, 0, 0, 0.6);
}

.drawer-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0f172a;
}

.drawer-header h2 {
  font-size: 1.05rem;
  margin-top: 3px;
}

.drawer-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  background: #0f172a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-footer-right {
  display: flex;
  gap: 10px;
}

.warnings-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alert-item {
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.35;
}
.alert-warning {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
}
.alert-info {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #bfdbfe;
}

.winner-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(37, 99, 235, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.45);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.winner-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #6ee7b7;
  font-weight: 700;
}

.winner-metrics {
  display: flex;
  gap: 20px;
}
.winner-metrics div {
  display: flex;
  flex-direction: column;
}
.winner-metrics small {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.winner-metrics strong {
  font-size: 1.15rem;
}

.sim-section {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
}

.sim-section h4 {
  font-size: 0.84rem;
  color: #93c5fd;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.sim-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.sim-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-field label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.form-field small {
  font-size: 0.71rem;
  color: #64748b;
}

.pack-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pack-inputs input {
  width: 100%;
  text-align: center;
}

.readonly-highlight {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #34d399 !important;
  font-weight: 700;
}

.dual-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.method-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  padding: 12px;
}

.method-box.recommended {
  border-color: var(--green);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}

.method-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.tier-pill {
  font-size: 0.68rem;
  background: #1e293b;
  padding: 2px 7px;
  border-radius: 99px;
  color: #94a3b8;
}

.fee-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
}

.fee-list li {
  display: flex;
  justify-content: space-between;
}

.fee-list .neg {
  color: #fca5a5;
}

.fee-list .total-row {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
  font-size: 0.9rem;
}

.full-input {
  width: 100%;
  margin-top: 6px;
}

/* MODALS */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 520px;
  max-width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-large {
  width: 720px;
}

.modal-header {
  padding: 15px 20px;
  background: #0f172a;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 18px 20px;
}

.modal-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.modal-footer {
  padding: 13px 20px;
  background: #0f172a;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.url-extractor-bar {
  display: flex;
  gap: 8px;
}
.url-extractor-bar input {
  flex: 1;
}

.status-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 0.83rem;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #10b981;
  color: #06281e;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 200;
  font-size: 0.86rem;
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 36px !important;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .sim-grid-3, .dual-comparison-grid, .sim-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ========================================================================= */
/* EXPERTO IA DE MERCADO & DIMENSIONAMIENTO DE LOTE (10 vs 100 UNIDADES)     */
/* ========================================================================= */

.ai-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-scale-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 800;
  width: fit-content;
  letter-spacing: 0.01em;
}

.ai-tier-ESCALA_MASIVA {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.28), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(167, 139, 250, 0.65);
  color: #e9d5ff;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.25);
}

.ai-tier-LOTE_MEDIO {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #bfdbfe;
}

.ai-tier-LOTE_LIMITADO {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
}

.ai-tier-NO_COMPRAR {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
}

.ai-expert-panel {
  background: linear-gradient(145deg, rgba(30, 27, 75, 0.65), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 12px;
  padding: 15px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.ai-expert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-chip {
  display: inline-block;
  font-size: 0.69rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.2);
  padding: 3px 9px;
  border-radius: 99px;
  margin-bottom: 5px;
}

.ai-expert-header h4 {
  font-size: 0.93rem;
  color: #f8fafc;
  line-height: 1.35;
}

.ai-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ai-kpi-box {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-kpi-box.highlight {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(167, 139, 250, 0.55);
}

.ai-kpi-box small {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
}

.ai-kpi-box strong {
  font-size: 1.12rem;
  color: #f8fafc;
}

.ai-kpi-box span {
  font-size: 0.72rem;
  color: #cbd5e1;
}

.ai-history-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.28);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.77rem;
  color: #e2e8f0;
}

.ai-reasons-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.4;
}

.ai-reasons-list li.ai-warn-bullet {
  color: #fde68a;
  font-weight: 600;
}

.ai-deep-actions {
  display: flex;
  justify-content: flex-end;
}

.ai-deep-report {
  background: #0f172a;
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 9px;
  padding: 14px 16px;
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e2e8f0;
}

.ai-deep-report h3 {
  font-size: 0.88rem;
  color: #c4b5fd;
  margin: 10px 0 5px 0;
}

.ai-deep-report h3:first-child {
  margin-top: 0;
}

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

/* ========================================================================= */
/* GUÍAS OPERATIVAS FBA & FBM + MODO RUTA DE COMPRAS                         */
/* ========================================================================= */

.btn-guide-fba {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.28);
}
.btn-guide-fba:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-guide-fbm {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.28);
}
.btn-guide-fbm:hover {
  background: linear-gradient(135deg, #047857, #065f46);
}

.btn-guide-route {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.45);
}
.btn-guide-route:hover {
  background: linear-gradient(135deg, #b45309, #92400e);
}

.business-modes-banner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.bmode-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

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

.bmode-fba {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(59, 130, 246, 0.45);
}
.bmode-fba:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.22);
}

.bmode-fbm {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(16, 185, 129, 0.45);
}
.bmode-fbm:hover {
  border-color: #34d399;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.22);
}

.bmode-icon {
  font-size: 2rem;
  line-height: 1;
  background: rgba(15, 23, 42, 0.75);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.bmode-info {
  flex: 1;
}

.bmode-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}

.bmode-title-row strong {
  font-size: 0.96rem;
  color: #f8fafc;
}

.bmode-cta {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fbbf24;
}

.bmode-info p {
  margin: 0;
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.42;
}

/* Modal XL para Guías FBA / FBM / Ruta */
.modal-guide-xl {
  width: 1020px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.guide-header-fba {
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
}
.guide-header-fbm {
  background: linear-gradient(135deg, #064e3b, #0f172a);
}
.guide-header-route {
  background: linear-gradient(135deg, #78350f, #0f172a);
}

.guide-pill-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fbbf24;
  margin-bottom: 3px;
}

.guide-body {
  overflow-y: auto;
  flex: 1;
  padding: 18px 22px;
}

.guide-progress-bar-wrap {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 16px;
}

.guide-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 7px;
  color: #e2e8f0;
}

.guide-progress-track {
  height: 9px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.guide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.guide-fill-fbm {
  background: linear-gradient(90deg, #10b981, #fbbf24);
}

.guide-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.guide-section-card {
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 11px;
  padding: 16px;
}

.guide-sec-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.step-num {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

.step-num-fbm {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.guide-sec-head h4 {
  margin: 0;
  font-size: 0.94rem;
  color: #f8fafc;
}

.guide-sec-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.guide-sec-desc a,
.check-item a {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: none;
}
.guide-sec-desc a:hover,
.check-item a:hover {
  text-decoration: underline;
}

.checklist-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 9px 11px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.42;
  color: #e2e8f0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check-item:hover {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(96, 165, 250, 0.4);
}

.check-item input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #10b981;
  cursor: pointer;
}

.fba-workflow-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.wf-step {
  display: flex;
  gap: 12px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 12px;
  border-radius: 9px;
}

.wf-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wf-num-fbm {
  background: #059669;
}

.wf-step strong {
  display: block;
  font-size: 0.84rem;
  color: #f8fafc;
  margin-bottom: 4px;
}

.wf-step p {
  margin: 0;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.fbm-tip-callout {
  margin-top: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 9px;
  padding: 11px 13px;
  font-size: 0.79rem;
  color: #d1fae5;
}

.fbm-tip-callout ul {
  margin: 6px 0 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Guía Personalizada de Empaque dentro del Cajón Lateral */
.prep-custom-card {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 11px;
  padding: 14px 16px;
}

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

.prep-custom-header h4 {
  margin: 0;
  color: #38bdf8;
}

.prep-custom-btns {
  display: flex;
  gap: 6px;
}

.prep-custom-body {
  font-size: 0.81rem;
  color: #e2e8f0;
  line-height: 1.48;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prep-step-item {
  background: rgba(15, 23, 42, 0.7);
  border-left: 3px solid #38bdf8;
  padding: 8px 11px;
  border-radius: 6px;
}

.prep-step-item.warn {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

/* Modo Ruta de Compras por Tienda */
.route-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

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

.shopping-route-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.route-store-block {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  overflow: hidden;
}

.route-store-header {
  padding: 12px 16px;
  background: rgba(30, 41, 59, 0.9);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.route-store-list {
  display: flex;
  flex-direction: column;
  divide-y: 1px solid var(--border-color);
}

.route-item-row {
  display: grid;
  grid-template-columns: 70px 1.6fr 1fr 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.route-item-row:last-child {
  border-bottom: none;
}

.route-item-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 4px;
}

@media (max-width: 900px) {
  .business-modes-banner,
  .guide-grid-2,
  .fba-workflow-steps {
    grid-template-columns: 1fr;
  }
  .route-item-row {
    grid-template-columns: 60px 1fr;
  }
}

/* ========================================================================= */
/* RADAR DE PRODUCTOS TRENDING EN AMAZON VS TIENDAS                          */
/* ========================================================================= */

.guide-header-trending {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.28), rgba(245, 158, 11, 0.16));
  border-bottom: 1px solid rgba(239, 68, 68, 0.45);
}

.trending-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
}

.trending-controls-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.trending-filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.trending-status-banner {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.trending-status-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 8px;
}

.trending-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  overflow: hidden;
}

.trending-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
  transition: width 0.35s ease;
}

.trending-radar-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trending-item-card {
  display: grid;
  grid-template-columns: 78px 1.6fr 1.2fr 1.2fr 1.1fr;
  gap: 14px;
  align-items: center;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 14px 16px;
}

.trending-item-card.trending-profitable {
  border-left: 4px solid #10b981;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.08), rgba(15, 23, 42, 0.88));
}

.trending-item-card.trending-discarded {
  border-left: 4px solid #64748b;
  opacity: 0.88;
}

.trending-vel-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  margin-bottom: 5px;
}

@media (max-width: 900px) {
  .trending-item-card {
    grid-template-columns: 1fr;
  }
}
