/* style.css - Mavima Premium Dark Glassmorphism Design System */

:root {
  --primary: #7c3aed; /* Violeta Eléctrico */
  --primary-hover: #6d28d9;
  --primary-glow: rgba(124, 58, 237, 0.45);
  
  --emerald: #10b981; /* Verde Esmeralda (Ganadores, Utilidad) */
  --emerald-glow: rgba(16, 185, 129, 0.25);
  
  --rose: #ef4444; /* Rojo Rosado (Rechazados, Devoluciones) */
  --rose-glow: rgba(239, 68, 68, 0.25);
  
  --amber: #f59e0b; /* Oro Suave (F29, Testables) */
  --amber-glow: rgba(245, 158, 11, 0.25);

  --bg-dark: #080b11;
  --bg-darker: #05070a;
  
  --bg-card: rgba(17, 24, 39, 0.65);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-card-hover: rgba(124, 58, 237, 0.25);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-gray: #6b7280;

  --radius-lg: 16px;
  --radius-md: 10px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset y Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Contenedor General SPA */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* 1. BARRA LATERAL (SIDEBAR) */
.sidebar {
  width: 280px;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-card);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 10;
}

.logo-area {
  position: relative;
  margin-bottom: 40px;
  padding-left: 10px;
}

.logo-glow {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 50px;
  height: 50px;
  background: var(--primary);
  filter: blur(35px);
  opacity: 0.6;
}

.logo-area h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 10px rgba(124, 58, 237, 0.3);
}

.logo-area .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

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

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: #fff;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.25);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.1);
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin-top: auto;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.pulse-dot.green {
  background-color: var(--emerald);
}

.pulse-dot.green::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: var(--emerald);
  animation: pulse 1.5s infinite;
  top: 0;
  left: 0;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

.status-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

.status-sub {
  font-size: 10px;
  color: var(--text-gray);
}

/* 2. CONTENIDO PRINCIPAL (MAIN CONTENT) */
.main-content {
  flex-grow: 1;
  margin-left: 280px;
  padding: 40px;
  max-width: 1300px;
}

/* Encabezado Superior */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

#page-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}

.header-date {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.ticker-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  display: flex;
  gap: 8px;
}

.ticker-label {
  color: var(--text-gray);
  font-weight: 600;
}

.ticker-value {
  color: #fff;
  font-weight: 700;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
}

.avatar {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

/* 3. DISEÑO DE SECCIONES (SPA TRANSITIONS) */
.content-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.content-section.active {
  display: block;
}

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

/* 4. TARJETAS GLASSMORPHIC */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

.glass-card:hover {
  border-color: var(--border-card-hover);
  box-shadow: 0 8px 32px 0 rgba(124, 58, 237, 0.08);
}

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

.card-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.subtitle-card {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* 5. METRICAS / KPIS (DASHBOARD) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.kpi-icon.purple {
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.kpi-icon.emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.kpi-icon.amber {
  background: rgba(245, 158, 11, 0.1);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.kpi-icon.rose {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.kpi-data h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  display: inline-block;
}

.kpi-trend.green { color: var(--emerald); }
.kpi-trend.yellow { color: var(--amber); }

/* GRID DEL DASHBOARD */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 25px;
}

.chart-container {
  min-height: 320px;
}

.custom-svg-chart {
  background: rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  padding: 15px;
  position: relative;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-gray);
  margin-top: 8px;
}

/* ALIMENTACIÓN DE LOGS IA */
.console-preview {
  display: flex;
  flex-direction: column;
}

.ai-event-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 230px;
  padding-right: 5px;
}

.log-entry {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-time {
  color: var(--text-gray);
  font-size: 10px;
}

/* 6. TABLAS PREMIUM */
.table-container {
  overflow-x: auto;
  margin-top: 15px;
}

.premium-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.premium-table th {
  padding: 14px 18px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-card);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.premium-table td {
  padding: 16px 18px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.premium-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* BADGES / ETIQUETAS */
.badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--emerald); border: 1px solid var(--emerald); }
.badge-warning { background: rgba(245, 158, 11, 0.1); color: var(--amber); border: 1px solid var(--amber); }
.badge-danger { background: rgba(239, 68, 68, 0.1); color: var(--rose); border: 1px solid var(--rose); }
.badge-purple { background: rgba(124, 58, 237, 0.1); color: var(--primary); border: 1px solid var(--primary); }

.badge.emerald { background: var(--emerald); color: #fff; }
.badge.purple { background: var(--primary); color: #fff; }

/* 7. FORMULARIOS, INPUTS Y CONTROLES */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

input, select, textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition-smooth);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

/* 8. BOTONES */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  border: none;
  font-family: inherit;
}

.w-full { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-secondary-sm {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-card);
}
.btn-secondary-sm:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}
.btn-emerald:hover {
  background: #059669;
  box-shadow: 0 4px 15px var(--emerald-glow);
}

.btn-purple {
  background: linear-gradient(135deg, #7c3aed, #4c1d95);
  color: #fff;
}
.btn-purple:hover {
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-danger-sm {
  padding: 6px 12px;
  font-size: 11px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--rose);
  border: 1px solid var(--rose);
}
.btn-danger-sm:hover {
  background: var(--rose);
  color: #fff;
}

.icon-sm { width: 16px; height: 16px; fill: currentColor; }

/* 9. PRODUCTOS GRID EN SECCION CATÁLOGO */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.product-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prod-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 15px;
}

.prod-score-badge {
  background: rgba(124, 58, 237, 0.15);
  color: #fff;
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 6px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.prod-score-badge.winner { border-color: var(--emerald); background: rgba(16, 185, 129, 0.15); color: #fff; }
.prod-score-badge.discarded { border-color: var(--rose); background: rgba(239, 68, 68, 0.15); color: #fff; }

.prod-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.prod-desc {
  font-size: 12px;
  color: var(--text-gray);
  line-height: 1.4;
  margin-bottom: 15px;
  flex-grow: 1;
}

.prod-metrics-box {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.prod-metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.prod-metric-label { color: var(--text-gray); }
.prod-metric-val { color: #fff; font-weight: 600; }
.prod-metric-val.margin-good { color: var(--emerald); }
.prod-metric-val.margin-bad { color: #f87171; }

.prod-card-actions {
  display: flex;
  gap: 10px;
}

/* 10. PROVEEDORES ESTRUCTURA */
.suppliers-layout {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 25px;
}

/* 11. ÓRDENES Y SANDBOX CHECKOUT */
.orders-layout {
  display: grid;
  grid-template-columns: 1.1fr 1.7fr;
  gap: 25px;
}

/* 12. CUMPLIMIENTO TRIBUTARIO (F29 DISEÑO SII) */
.tax-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 25px;
}

.f29-card {
  padding: 0;
  overflow: hidden;
  border-color: #2563eb; /* Azul Institucional SII */
}

.f29-header-sii {
  background: #1e3a8a; /* Azul SII */
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #f59e0b; /* Línea de bandera */
}

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

.sii-flag {
  width: 32px;
  height: 20px;
  background: linear-gradient(to bottom, #ef4444 33%, #fff 33%, #fff 66%, #2563eb 66%);
  border: 1px solid rgba(255,255,255,0.2);
}

.sii-brand h4 {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.sii-brand p {
  font-size: 10px;
  color: #93c5fd;
}

.tax-period {
  font-size: 13px;
  color: #fff;
}

.f29-body {
  padding: 24px;
}

.f29-section-title {
  background: rgba(30, 58, 138, 0.2);
  border-left: 4px solid #f59e0b;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  margin-top: 20px;
  margin-bottom: 12px;
}

.f29-row {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr 1.5fr;
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  align-items: center;
}

.f29-label { color: var(--text-muted); }
.f29-code { color: #f59e0b; font-family: monospace; font-weight: 700; text-align: center; }
.f29-value { color: var(--text-gray); font-size: 11px; text-align: center; }
.f29-amount { color: #fff; font-weight: 700; text-align: right; }

.highlight-purple {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 6px;
  margin-top: 8px;
}

.highlight-gold {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  margin-top: 15px;
}
.highlight-gold .f29-amount { color: var(--amber); font-size: 15px; }

.compliance-instructions {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-card);
  padding: 18px;
  border-radius: var(--radius-md);
  margin-bottom: 25px;
}

.compliance-instructions h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
}

.compliance-instructions ul {
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.block-link { text-decoration: none; text-align: center; }
.text-xs { font-size: 11px; }
.text-center { text-align: center; }
.text-gray { color: var(--text-gray); }

/* 13. AGENTES DE IA CONSOLA */
.agents-tabs-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.agents-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-card);
  color: var(--text-gray);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.agents-tab-btn:hover {
  border-color: rgba(124, 58, 237, 0.35);
  color: var(--text-light);
}

.agents-tab-btn.active {
  background: rgba(124, 58, 237, 0.18);
  border-color: var(--primary);
  color: #fff;
}

.agents-tab-panel {
  display: none;
}

.agents-tab-panel.active {
  display: block;
}

.agent-settings-card {
  max-width: 960px;
}

.agent-settings-status {
  margin: 12px 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.2);
  font-size: 13px;
  line-height: 1.5;
}

.agent-settings-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

.agent-settings-table .toggle-cell {
  text-align: center;
  width: 100px;
}

.agent-settings-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.agent-settings-table tr.agent-row-disabled {
  opacity: 0.55;
}

.agent-settings-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

#agent-settings-save-msg.success {
  color: #4ade80;
}

#agent-settings-save-msg.error {
  color: #f87171;
}

.agents-console-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 25px;
}

.agents-grid-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
}

.agent-selector-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-card);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-smooth);
}

.agent-selector-btn:hover {
  background: rgba(124, 58, 237, 0.05);
  border-color: rgba(124, 58, 237, 0.2);
}

.agent-selector-btn.active {
  background: rgba(124, 58, 237, 0.15);
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.agent-btn-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}

.agent-btn-role {
  font-size: 10px;
  color: var(--text-gray);
  margin-top: 2px;
}

/* TERMINAL DE AGENTE */
.agent-terminal-card {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.terminal-header {
  background: #0b0f17;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-card);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ef4444; }
.terminal-dot.yellow { background: #f59e0b; }
.terminal-dot.green { background: #10b981; }

.terminal-title {
  color: var(--text-muted);
  font-size: 12px;
  font-family: monospace;
  margin-left: 10px;
  font-weight: 700;
}

.terminal-prompt-box {
  background: rgba(15, 23, 42, 0.5);
  border-bottom: 1px solid var(--border-card);
  padding: 18px 24px;
}

.terminal-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 15px;
}

.terminal-meta p strong {
  color: #fff;
}

.terminal-console-body {
  background: #030712;
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  max-height: 320px;
}

.terminal-console-body pre {
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  color: #a78bfa;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* 14. MODALES */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  justify-content: center;
  align-items: center;
  animation: modalFadeIn 0.3s ease;
}

.modal.active { display: flex; }

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

.modal-content {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  border-color: rgba(124, 58, 237, 0.3);
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalSlideUp {
  from { transform: translateY(30px); }
  to { transform: translateY(0); }
}

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

.modal-header h3 {
  font-size: 20px;
  color: #fff;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover { color: #fff; }

.modal-body {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
}

.copy-box textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  border-color: var(--border-card);
  resize: none;
  margin-top: 8px;
}

.hashtags-box {
  margin-top: 15px;
}

.hashtags-box h4, .copy-box h4, .hooks-box h4 {
  font-size: 14px;
  color: #fff;
  margin-bottom: 8px;
}

#modal-ai-hashtags {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.hooks-box { margin-top: 15px; }

#modal-ai-hooks {
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid, .suppliers-layout, .orders-layout, .tax-layout, .agents-console-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 80px;
    padding: 20px 10px;
  }
  .sidebar h1, .sidebar p, .sidebar .pulse-dot + div {
    display: none;
  }
  .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .nav-item span { display: none; }
  .main-content {
    margin-left: 80px;
    padding: 20px;
  }
}

/* ========================================================
   SISTEMA DE LOGIN GLASSMORPHIC PREMIUM (SEGURIDAD Y UI)
   ======================================================== */

.app-container.blurred {
  filter: blur(25px);
  pointer-events: none;
  user-select: none;
  transition: filter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 10, 0.45);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.login-card {
  width: 90%;
  max-width: 420px;
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(124, 58, 237, 0.3) !important;
  background: rgba(17, 24, 39, 0.85);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45), 0 0 30px rgba(124, 58, 237, 0.25);
  position: relative;
  overflow: hidden;
  animation: loginSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.login-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.login-logo-area {
  position: relative;
  margin-bottom: 25px;
  text-align: center;
}

.login-logo-area h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 15px rgba(124, 58, 237, 0.4);
}

.login-logo-area .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 5px;
}

.login-desc {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 30px;
}

/* Ocultar/Mostrar Contraseña */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper input {
  padding-right: 45px;
}

.btn-icon {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
  padding: 6px;
  border-radius: 50%;
}

.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* Caja de Mensaje de Error */
.error-msg-box {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f87171;
  font-size: 13px;
  animation: errorFadeIn 0.3s ease forwards;
}

.error-icon {
  font-size: 16px;
}

/* Botón de Cerrar Sesión Estilo Premium */
.btn-logout:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

/* Animaciones y Transiciones */
@keyframes loginSlideUp {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.login-card.shake {
  animation: shake 0.4s ease-in-out;
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45), 0 0 30px rgba(239, 68, 68, 0.2);
}

/* Spinner de carga */
.loader-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========================================================
   MERCADO PAGO INTEGRACIÓN - ESTILOS DE CHECKOUT REAL
   ======================================================== */

.mp-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-gray);
  font-size: 12px;
}

.mp-divider::before,
.mp-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-card);
}

.btn-mp {
  background: #009EE3;
  color: #fff;
  font-weight: 700;
  gap: 10px;
  border: none;
}

.btn-mp:hover {
  background: #007EB8;
  box-shadow: 0 4px 20px rgba(0, 158, 227, 0.3);
  transform: translateY(-1px);
}

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

.payment-banner {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: errorFadeIn 0.4s ease forwards;
}

.payment-banner.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--emerald);
}

.payment-banner.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.payment-banner.pending {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--amber);
}


