/* ============================================================
   BARI PANEL · assets/css/style.css
   Sistema de diseño corporativo: navy + gris + blanco
   ============================================================ */

:root {
  --navy: #0b2545;
  --navy-dark: #061834;
  --navy-soft: #1d3557;
  --navy-light: #e8eef7;
  --navy-accent: #3a6ea5;
  --navy-pale: #7fb3e0;
  --whatsapp: #25d366;
  --whatsapp-dark: #128c7e;

  --bg: #ffffff;
  --bg-panel: #f7f8fa;
  --bg-subtle: #fbfbfc;
  --border: #e4e7ec;
  --border-strong: #cbd2d9;

  --text: #0b1929;
  --text-secondary: #3e4c59;
  --text-dim: #7b8794;
  --text-muted: #9aa5b1;

  --danger: #c0392b;
  --danger-light: #fdf0ef;
  --success: #1e7e34;
  --success-light: #e8f5ea;
  --warning: #b7791f;
  --warning-light: #fff7e6;
}

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

body {
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--navy-accent); text-decoration: none; }
a:hover { color: var(--navy); }

/* ============ LOGIN ============ */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: var(--bg-panel); position: relative;
}
.login-screen::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(11,37,69,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(11,37,69,0.03) 1px, transparent 1px);
  background-size: 32px 32px; pointer-events: none;
}
.login-card {
  width: 100%; max-width: 440px; background: var(--bg); border: 1px solid var(--border);
  padding: 48px 40px; position: relative; z-index: 1;
  box-shadow: 0 4px 24px rgba(11,25,41,0.06);
}
.login-card::before { content: ''; position: absolute; top: 0; left: 0; width: 60px; height: 3px; background: var(--navy); }
.login-brand { font-family: 'IBM Plex Serif', serif; font-size: 32px; font-weight: 700; letter-spacing: -0.5px; color: var(--navy); line-height: 1; }
.login-brand span { color: var(--navy-accent); }
.login-sub { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 2px; margin: 6px 0 40px; }
.login-sub .restrict { color: var(--danger); font-weight: 600; }
.login-title { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.login-hint { margin-top: 24px; padding: 12px 14px; background: var(--navy-light); border-left: 3px solid var(--navy); font-size: 12px; color: var(--text-secondary); font-family: 'IBM Plex Mono', monospace; line-height: 1.6; }
.login-hint strong { color: var(--navy); font-weight: 600; }
.login-error { margin-bottom: 16px; padding: 12px 14px; background: var(--danger-light); border-left: 3px solid var(--danger); font-size: 13px; color: var(--danger); font-family: 'IBM Plex Mono', monospace; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim);
  margin-bottom: 8px; font-weight: 500;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong);
  padding: 11px 14px; color: var(--text); font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px; transition: all 0.15s; border-radius: 2px;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,37,69,0.08);
}
.form-input:read-only { background: var(--bg-subtle); color: var(--text-secondary); cursor: default; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  font-family: 'IBM Plex Mono', monospace; font-size: 11px; text-transform: uppercase;
  letter-spacing: 1px; cursor: pointer; transition: all 0.15s;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--navy);
  font-weight: 600; border-radius: 2px; text-decoration: none;
}
.btn:hover { border-color: var(--navy); background: var(--navy-light); color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-navy:hover { background: var(--navy-dark); border-color: var(--navy-dark); color: #fff; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; border-color: var(--whatsapp); }
.btn-whatsapp:hover { background: var(--whatsapp-dark); border-color: var(--whatsapp-dark); color: #fff; }

.btn-email {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--navy);
}
.btn-email:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-email:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-block { width: 100%; justify-content: center; padding: 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 6px 10px; font-size: 10px; }
.btn-icon {
  background: transparent; border: 1px solid var(--border-strong); color: var(--text-dim);
  width: 28px; height: 28px; font-family: 'IBM Plex Mono', monospace; font-size: 12px;
  cursor: pointer; transition: all 0.15s; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { border-color: var(--navy); color: var(--navy); background: var(--navy-light); }
.btn-icon.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* ============ APP LAYOUT ============ */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--navy); padding: 24px 0; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; color: #fff;
}
.sidebar-brand { padding: 0 24px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 16px; }
.sidebar-brand-name { font-family: 'IBM Plex Serif', serif; font-size: 22px; font-weight: 700; letter-spacing: -0.3px; color: #fff; }
.sidebar-brand-name span { color: var(--navy-pale); }
.sidebar-brand-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: rgba(255,255,255,0.6); text-transform: uppercase; letter-spacing: 2px; margin-top: 4px; }
.nav-group-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 2px; padding: 16px 24px 8px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  color: rgba(255,255,255,0.75); font-size: 14px; cursor: pointer;
  border-left: 3px solid transparent; transition: all 0.15s; text-decoration: none;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; border-left-color: var(--navy-pale); background: rgba(127,179,224,0.12); font-weight: 600; }
.nav-icon { font-family: 'IBM Plex Mono', monospace; font-size: 11px; opacity: 0.6; min-width: 24px; }

.sidebar-footer { padding: 16px 24px; border-top: 1px solid rgba(255,255,255,0.1); margin-top: auto; }
.sidebar-footer-fixed { position: absolute; bottom: 0; left: 0; right: 0; background: var(--navy); }
.user-card { margin-bottom: 12px; }
.user-card .name { font-size: 13px; font-weight: 600; color: #fff; }
.user-card .role { font-family: 'IBM Plex Mono', monospace; font-size: 10px; color: var(--navy-pale); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px; }
.btn-logout {
  width: 100%; background: transparent; border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8); padding: 8px 12px; font-family: 'IBM Plex Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer;
  transition: all 0.2s; border-radius: 2px; text-decoration: none; display: block; text-align: center;
}
.btn-logout:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.4); color: #fff; }

.main { padding: 28px 32px; max-width: 1500px; background: var(--bg); min-height: 100vh; }
.main-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 16px; }
.main-title { font-family: 'IBM Plex Serif', serif; font-size: 32px; font-weight: 600; letter-spacing: -1px; line-height: 1.05; color: var(--navy); }
.main-title small { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; color: var(--navy-accent); text-transform: uppercase; letter-spacing: 3px; margin-bottom: 8px; }
.header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ STATS ============ */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stats-grid-6 { grid-template-columns: repeat(6, 1fr); gap: 12px; }
.stat-card { background: var(--bg); border: 1px solid var(--border); padding: 18px; position: relative; border-radius: 2px; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 24px; height: 2px; background: var(--navy); }
.stat-card.stat-success::before { background: #16a34a; width: 32px; }
.stat-card.stat-warn::before { background: #d97706; width: 32px; }
.stat-card.stat-success .stat-value { color: #16a34a; }
.stat-card.stat-warn .stat-value { color: #d97706; }
.stat-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 6px; font-weight: 500; }
.stat-value { font-family: 'IBM Plex Serif', serif; font-size: 28px; font-weight: 700; letter-spacing: -0.8px; line-height: 1; color: var(--navy); }
.stat-meta { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.stat-meta.positive { color: var(--success); }
.stat-meta.warning { color: var(--warning); }
.stat-meta.danger { color: var(--danger); }

/* ============ META BANNER (Motivador mensual) ============ */
.meta-banner {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 50%, #2a5298 100%);
  color: #fff;
  padding: 24px 28px;
  border-radius: 12px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 37, 69, 0.15);
}

.meta-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.meta-banner.completado {
  background: linear-gradient(135deg, #047857 0%, #16a34a 50%, #22c55e 100%);
  animation: bannerCelebrate 2s ease-in-out;
}

@keyframes bannerCelebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}

.meta-banner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.meta-banner-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  opacity: 0.9;
  text-transform: uppercase;
}

.meta-banner-icon {
  font-size: 18px;
}

.meta-banner-trofeo {
  font-size: 32px;
  animation: trophyBounce 1.5s ease-in-out infinite;
}

@keyframes trophyBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-5deg); }
  75% { transform: translateY(-4px) rotate(5deg); }
}

.meta-banner-numbers {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.meta-banner-cobrado {
  font-family: 'IBM Plex Serif', serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.meta-banner-total {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  opacity: 0.7;
}

.meta-banner-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.meta-banner-track {
  flex: 1;
  height: 12px;
  background: rgba(255,255,255,0.15);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}

.meta-banner-fill {
  height: 100%;
  border-radius: 100px;
  position: relative;
  overflow: hidden;
  transition: width 1.5s cubic-bezier(0.4, 0.0, 0.2, 1);
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.meta-banner-fill.low {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.meta-banner-fill.mid {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.meta-banner-fill.high {
  background: linear-gradient(90deg, #06b6d4 0%, #10b981 100%);
}

.meta-banner-fill.complete {
  background: linear-gradient(90deg, #10b981 0%, #fbbf24 50%, #f59e0b 100%);
}

.meta-banner-shine {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.5) 50%,
    rgba(255,255,255,0) 100%);
  animation: metaShine 2.5s linear infinite;
}

@keyframes metaShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.meta-banner-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  min-width: 60px;
  text-align: right;
}

.meta-banner-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.meta-banner-falta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.meta-banner-falta-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.8;
}

.meta-banner-falta-monto {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fbbf24;
}

.meta-banner.completado .meta-banner-falta-monto {
  color: #fef9c3;
}

.meta-banner-mensaje {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.95;
  font-style: italic;
}

/* Mobile / responsive del meta banner y stats-6 */
@media (max-width: 1100px) {
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .meta-banner { padding: 18px 20px; }
  .meta-banner-cobrado { font-size: 28px; }
  .meta-banner-total { font-size: 14px; }
  .meta-banner-pct { font-size: 16px; min-width: 50px; }
  .meta-banner-footer { flex-direction: column; align-items: flex-start; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
}

/* ============ TABLES ============ */
.data-table-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: 2px; overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-dim);
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-subtle); font-weight: 500;
}
.data-table thead th.num { text-align: right; }
.data-table thead th.center { text-align: center; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.data-table tbody tr:hover { background: var(--navy-light); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 12px 14px; vertical-align: middle; font-size: 13px; }
.data-table tbody td.num { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.data-table tbody td.center { text-align: center; }

.clave-cell { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text-dim); font-weight: 500; }
.tipo-tag { display: inline-block; padding: 2px 7px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; background: var(--navy-light); color: var(--navy); border-radius: 2px; font-weight: 600; }
.prod-name { font-weight: 600; color: var(--navy); font-size: 13px; }
.prod-attrs { font-size: 10px; color: var(--text-dim); margin-top: 2px; font-family: 'IBM Plex Mono', monospace; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============ CONTROLS ============ */
.controls-bar { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.search-box { flex: 1; min-width: 240px; position: relative; }
.search-box input {
  width: 100%; background: var(--bg); border: 1px solid var(--border-strong);
  padding: 9px 14px 9px 38px; color: var(--text); font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px; border-radius: 2px;
}
.search-box input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,37,69,0.08); }
.search-box::before { content: '⌕'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 16px; }

.chip {
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--text-secondary);
  padding: 9px 14px; font-family: 'IBM Plex Mono', monospace; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.15s;
  border-radius: 2px; font-weight: 500;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,25,41,0.6); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; z-index: 100;
  padding: 40px 20px; overflow-y: auto;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg); width: 100%; max-width: 820px; border-radius: 4px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4); animation: modalIn 0.25s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-header { background: var(--navy); color: #fff; padding: 20px 28px; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-family: 'IBM Plex Serif', serif; font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.modal-header h2 small { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 10px; font-weight: 500; color: var(--navy-pale); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 4px; }
.modal-close {
  background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff;
  width: 32px; height: 32px; cursor: pointer; border-radius: 2px; font-size: 16px; transition: all 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.5); }
.modal-body { padding: 28px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal-footer {
  padding: 18px 28px; background: var(--bg-subtle); border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

.modal-section { margin-bottom: 24px; }
.modal-section-title {
  font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase;
  letter-spacing: 2px; color: var(--navy-accent); margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row.full { grid-template-columns: 1fr; }

/* ============ TOAST ============ */
.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--bg);
  border: 1px solid var(--success); border-left-width: 3px; padding: 12px 18px;
  font-size: 13px; z-index: 200;
  opacity: 0; visibility: hidden; transform: translateY(20px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  max-width: 340px;
  box-shadow: 0 4px 16px rgba(11,25,41,0.08); border-radius: 2px; color: var(--text);
  pointer-events: none;
}
.toast.show {
  opacity: 1; visibility: visible; transform: translateY(0);
  pointer-events: auto;
}
.toast.error { border-color: var(--danger); }
.toast small { display: block; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; font-size: 10px; margin-top: 2px; text-transform: uppercase; letter-spacing: 1px; }

/* ============ SISTEMA DE NAVEGACIÓN ENTRE PÁGINAS ============ */
.page {
  display: none;
  animation: fadeInPage 0.25s ease-out;
}
.page.active {
  display: block;
}
@keyframes fadeInPage {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===========================================================
   POP-UPS DEL VENDEDOR (notificaciones de aprobación/rechazo)
   =========================================================== */
#vendedorNotifContainer,
#adminNotifContainer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
  max-width: 380px;
  pointer-events: none;
}

.vendedor-popup {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(11, 25, 41, 0.2);
  width: 380px;
  max-width: calc(100vw - 40px);
  overflow: hidden;
  pointer-events: auto;
  animation: vpopSlideIn 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.vendedor-popup.aprobado {
  border-top: 4px solid #16a34a;
}

.vendedor-popup.rechazado {
  border-top: 4px solid #c0392b;
}

.vendedor-popup.cerrando {
  animation: vpopSlideOut 0.3s ease-in forwards;
}

@keyframes vpopSlideIn {
  from {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

@keyframes vpopSlideOut {
  to {
    transform: translateX(120%) scale(0.95);
    opacity: 0;
  }
}

.vendedor-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #fafbfc;
  border-left: 4px solid #0b2545;
  border-bottom: 1px solid #f0f2f5;
}

.vendedor-popup-icon {
  width: 38px;
  height: 38px;
  background: #16a34a;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  animation: vpopIconPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vpopIconPop {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.vendedor-popup-title-block {
  flex: 1;
  min-width: 0;
}

.vendedor-popup-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
}

.vendedor-popup-titulo {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  line-height: 1.3;
}

.vendedor-popup-close {
  background: transparent;
  border: none;
  color: #98a2b3;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s;
}

.vendedor-popup-close:hover {
  background: rgba(0, 0, 0, 0.06);
}

.vendedor-popup-body {
  padding: 14px 18px;
}

.vendedor-popup-folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: #6c757d;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.vendedor-popup-cliente {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 600;
  color: #1a2942;
  margin-bottom: 8px;
}

.vendedor-popup-monto {
  font-family: 'IBM Plex Serif', serif;
  font-size: 24px;
  font-weight: 700;
  color: #0b2545;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.vendedor-popup-monto.success {
  color: #16a34a;
}

.vendedor-popup-motivo {
  background: #fef2f2;
  border-left: 3px solid #c0392b;
  padding: 10px 12px;
  margin-top: 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #8b2820;
  line-height: 1.5;
}

.vendedor-popup-motivo strong {
  color: #c0392b;
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.vendedor-popup-actions {
  display: flex;
  gap: 8px;
  padding: 0 18px 16px;
}

.vendedor-popup-btn {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e4e7ec;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  transition: all 0.15s;
}

.vendedor-popup-btn:hover {
  background: #f7f8fa;
  border-color: #c0c8d0;
}

.vendedor-popup-btn.primary {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border-color: #0b2545;
  flex: 2;
}

.vendedor-popup-btn.primary:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.25);
}

.vendedor-popup.rechazado .vendedor-popup-btn.primary {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  border-color: #c0392b;
}

.vendedor-popup.rechazado .vendedor-popup-btn.primary:hover {
  background: linear-gradient(135deg, #a02818 0%, #c0392b 100%);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

/* Mobile */
@media (max-width: 768px) {
  #vendedorNotifContainer,
  #adminNotifContainer {
    bottom: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .vendedor-popup {
    width: 100%;
  }
}

/* ===========================================================
   NEURAL DASHBOARD · RESUMEN DE VENTAS · IA 2050
   =========================================================== */

/* Item del menú con efecto glow */
.nav-item.nav-item-neural {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
  border-left: 2px solid #8b5cf6;
  position: relative;
}
.nav-item.nav-item-neural::after {
  content: '';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #8b5cf6;
  box-shadow: 0 0 8px #8b5cf6;
  animation: neuralPulse 2s ease-in-out infinite;
}
.nav-item.nav-item-neural:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
}
.nav-item.nav-item-neural .nav-icon {
  color: #8b5cf6;
}

@keyframes neuralPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px #8b5cf6; }
  50% { opacity: 0.5; box-shadow: 0 0 16px #8b5cf6, 0 0 4px #8b5cf6; }
}

/* Página completa con fondo cyber */
.neural-page {
  background: linear-gradient(180deg, #0a0e1a 0%, #0b1929 50%, #0d1f3a 100%);
  color: #e4e7ec;
  padding: 0 !important;
  margin: -32px;
  margin-top: -24px;
  min-height: calc(100vh - 0px);
  position: relative;
  overflow: hidden;
}

.neural-page.active {
  display: block !important;
}

/* Fondo decorativo: grid cyberpunk */
.neural-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.neural-bg-glow {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.neural-page > *:not(.neural-bg-grid):not(.neural-bg-glow) {
  position: relative;
  z-index: 1;
}

/* Header */
.neural-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
  background: linear-gradient(90deg, rgba(11, 25, 41, 0.8) 0%, rgba(13, 31, 58, 0.8) 100%);
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
  gap: 16px;
}

.neural-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: #8b5cf6;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.neural-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.neural-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.neural-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: neuralPulse 1.5s ease-in-out infinite;
}
.neural-status-text {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #10b981;
  text-transform: uppercase;
}

.neural-timestamp {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(228, 231, 236, 0.5);
  text-align: right;
}

/* HERO METRICS GRID */
.neural-hero-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding: 24px 36px;
}

.neural-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s;
}

.neural-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.15);
}

.neural-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-color, #8b5cf6);
  opacity: 0.8;
}

.neural-card-primary { --card-color: #8b5cf6; }
.neural-card-cyan { --card-color: #06b6d4; }
.neural-card-orange { --card-color: #f59e0b; }
.neural-card-green { --card-color: #10b981; }
.neural-card-violet { --card-color: #a855f7; }
.neural-card-mint { --card-color: #14b8a6; }

.neural-card-icon {
  font-size: 14px;
  color: var(--card-color);
  margin-bottom: 4px;
  text-shadow: 0 0 12px var(--card-color);
}

.neural-card-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  color: rgba(228, 231, 236, 0.6);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.neural-card-value {
  font-family: 'IBM Plex Serif', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  text-shadow: 0 0 20px var(--card-color);
}

.neural-card-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(228, 231, 236, 0.5);
}

.neural-card-bar {
  margin-top: 10px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
}
.neural-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #06b6d4 0%, #8b5cf6 100%);
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.neural-card-bar-fill.orange {
  background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

/* SECCIONES */
.neural-section {
  padding: 24px 36px;
  border-top: 1px solid rgba(139, 92, 246, 0.1);
}

.neural-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(228, 231, 236, 0.8);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.neural-section-bar {
  width: 32px;
  height: 2px;
  background: linear-gradient(90deg, #8b5cf6 0%, transparent 100%);
}

/* COMPARATIVA */
.neural-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.neural-compare-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 20px;
}

.neural-compare-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(228, 231, 236, 0.5);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.neural-compare-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.neural-compare-row.current {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
  margin-top: 4px;
}

.neural-compare-old {
  font-size: 12px;
  color: rgba(228, 231, 236, 0.5);
}
.neural-compare-old-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: rgba(228, 231, 236, 0.7);
}

.neural-compare-new {
  font-size: 12px;
  color: rgba(228, 231, 236, 0.8);
  font-weight: 600;
}
.neural-compare-new-val {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.neural-compare-change {
  margin-top: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  background: rgba(255,255,255,0.05);
}
.neural-compare-change.up {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.neural-compare-change.down {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* PODIO 3D */
.neural-podio-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 16px;
  align-items: end;
  padding: 20px 0;
}

.neural-podio-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  transition: all 0.3s;
}

.neural-podio-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 12px 24px rgba(139, 92, 246, 0.2);
}

.neural-podio-card.pos-primero {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.15) 0%, rgba(251, 191, 36, 0.05) 100%);
  border-color: rgba(251, 191, 36, 0.4);
  padding-top: 32px;
  padding-bottom: 32px;
}

.neural-podio-card.pos-segundo {
  background: linear-gradient(180deg, rgba(156, 163, 175, 0.12) 0%, rgba(156, 163, 175, 0.04) 100%);
  border-color: rgba(156, 163, 175, 0.4);
}

.neural-podio-card.pos-tercero {
  background: linear-gradient(180deg, rgba(217, 119, 6, 0.12) 0%, rgba(217, 119, 6, 0.04) 100%);
  border-color: rgba(217, 119, 6, 0.4);
}

.neural-podio-medal {
  font-size: 36px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.neural-podio-card.pos-primero .neural-podio-medal {
  font-size: 48px;
  animation: trophyFloat 2.5s ease-in-out infinite;
}

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

.neural-podio-nombre {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 6px;
}

.neural-podio-monto {
  font-family: 'IBM Plex Serif', serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.neural-podio-card.pos-primero .neural-podio-monto {
  font-size: 26px;
  text-shadow: 0 0 24px rgba(251, 191, 36, 0.6);
}

.neural-podio-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(228, 231, 236, 0.5);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.neural-podio-bar {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
}
.neural-podio-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #06b6d4 100%);
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.neural-podio-card.pos-primero .neural-podio-bar-fill {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.neural-podio-loading {
  text-align: center;
  padding: 40px;
  color: rgba(228, 231, 236, 0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

/* HEATMAP */
.neural-heatmap-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
}
.neural-heatmap {
  display: grid;
  grid-template-columns: repeat(31, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.neural-heatmap-cell {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s;
}
.neural-heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.neural-heatmap-cell.lvl0 { background: rgba(255,255,255,0.04); }
.neural-heatmap-cell.lvl1 { background: rgba(99, 102, 241, 0.3); }
.neural-heatmap-cell.lvl2 { background: rgba(99, 102, 241, 0.55); }
.neural-heatmap-cell.lvl3 { background: rgba(139, 92, 246, 0.75); }
.neural-heatmap-cell.lvl4 {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
}
.neural-heatmap-cell.futuro {
  opacity: 0.3;
  border: 1px dashed rgba(255,255,255,0.1);
}
.neural-heatmap-cell-num {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
.neural-heatmap-cell.lvl3 .neural-heatmap-cell-num,
.neural-heatmap-cell.lvl4 .neural-heatmap-cell-num {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.neural-heatmap-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(228, 231, 236, 0.6);
}
.neural-heatmap-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.neural-heatmap-cell-mini {
  width: 12px; height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.neural-heatmap-cell-mini.lvl0 { background: rgba(255,255,255,0.08); }
.neural-heatmap-cell-mini.lvl1 { background: rgba(99, 102, 241, 0.3); }
.neural-heatmap-cell-mini.lvl2 { background: rgba(99, 102, 241, 0.55); }
.neural-heatmap-cell-mini.lvl3 { background: rgba(139, 92, 246, 0.75); }
.neural-heatmap-cell-mini.lvl4 { background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); }

/* PREDICCIÓN IA */
.neural-prediction {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06) 0%, rgba(236, 72, 153, 0.04) 100%);
  border-top: 1px solid rgba(236, 72, 153, 0.2);
  border-bottom: 1px solid rgba(236, 72, 153, 0.2);
}
.neural-prediction-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.neural-prediction-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  position: relative;
}
.neural-prediction-card::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #ec4899, transparent);
}
.neural-prediction-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: rgba(228, 231, 236, 0.6);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.neural-prediction-value {
  font-family: 'IBM Plex Serif', serif;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  letter-spacing: -1px;
}
.neural-prediction-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: rgba(228, 231, 236, 0.5);
}
.neural-prediction-bar {
  margin-top: 10px;
  height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
}
.neural-prediction-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6 0%, #ec4899 100%);
  border-radius: 100px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

/* TOP CLIENTES Y PRODUCTOS - lado a lado */
.neural-double-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.neural-double-grid > .neural-section {
  border-left: 1px solid rgba(139, 92, 246, 0.1);
}
.neural-double-grid > .neural-section:first-child {
  border-left: none;
}

.neural-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.neural-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 14px 18px;
  transition: all 0.2s;
}
.neural-list-item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(139, 92, 246, 0.3);
}
.neural-list-rank {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #8b5cf6;
  min-width: 32px;
  text-shadow: 0 0 12px #8b5cf6;
}
.neural-list-content {
  flex: 1;
  min-width: 0;
}
.neural-list-titulo {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.neural-list-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(228, 231, 236, 0.5);
}
.neural-list-monto {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 700;
  color: #06b6d4;
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
  white-space: nowrap;
}

/* EMPRESAS */
.neural-empresas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.neural-empresa-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 4px solid var(--empresa-color, #8b5cf6);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s;
}
.neural-empresa-card:hover {
  transform: translateX(4px);
  border-left-width: 6px;
}
.neural-empresa-header {
  margin-bottom: 16px;
}
.neural-empresa-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--empresa-color, #8b5cf6);
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 700;
}
.neural-empresa-nombre {
  font-family: 'IBM Plex Serif', serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.neural-empresa-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.neural-empresa-stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: rgba(228, 231, 236, 0.5);
  margin-bottom: 4px;
  text-transform: uppercase;
}
.neural-empresa-stat-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.neural-empresa-stat-value.success {
  color: #10b981;
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .neural-hero-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .neural-page { margin: -16px; }
  .neural-header { padding: 18px 20px; }
  .neural-title { font-size: 22px; }
  .neural-section { padding: 18px 20px; }
  .neural-hero-grid { grid-template-columns: repeat(2, 1fr); padding: 18px 20px; }
  .neural-card-value { font-size: 18px; }
  .neural-podio-row { grid-template-columns: 1fr; }
  .neural-prediction-grid { grid-template-columns: 1fr; }
  .neural-compare-grid { grid-template-columns: 1fr; }
  .neural-double-grid { grid-template-columns: 1fr; }
  .neural-double-grid > .neural-section { border-left: none; border-top: 1px solid rgba(139, 92, 246, 0.1); }
  .neural-heatmap { grid-template-columns: repeat(7, 1fr); }
  .neural-prediction-value { font-size: 22px; }
}

/* ===========================================================
   STATUS CARDS - System Status moderno con barra de progreso
   =========================================================== */
.status-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 12px;
}

.status-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(11, 25, 41, 0.04);
}

.status-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 25, 41, 0.08);
}

/* Header */
.status-card-header {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto;
  gap: 20px;
  padding: 18px 22px;
  align-items: start;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.status-card-empresa-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  margin-bottom: 4px;
}

.status-card-folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 2px;
}

.status-card-fecha {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #98a2b3;
}

.status-card-cliente {
  font-family: 'IBM Plex Serif', serif;
  font-weight: 600;
  font-size: 17px;
  color: #1a2942;
  margin-bottom: 4px;
}

.status-card-contacto {
  font-size: 12px;
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  margin-bottom: 4px;
}

.status-vendedor {
  font-size: 11px;
  color: #0b2545;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
}

.status-card-total-block {
  text-align: right;
}

.status-card-total {
  font-family: 'IBM Plex Serif', serif;
  font-size: 22px;
  font-weight: 700;
  color: #0b2545;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.status-badge.pendiente {
  background: #fff3cd;
  color: #856404;
}

.status-badge.anticipo {
  background: #cce5ff;
  color: #004085;
}

.status-badge.pagada {
  background: #d4edda;
  color: #155724;
}

/* Barra de progreso */
.status-progress-wrap {
  padding: 14px 22px 16px;
  background: #fafbfc;
  border-top: 1px solid #f0f2f5;
  border-bottom: 1px solid #f0f2f5;
}

.status-progress-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 8px;
}

.status-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 100px;
  transition: width 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
  overflow: hidden;
}

.status-progress-fill.pendiente {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

.status-progress-fill.anticipo {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.status-progress-fill.pagada {
  background: linear-gradient(90deg, #3b82f6 0%, #10b981 100%);
}

/* Brillo deslizante en barras activas */
.status-progress-shine {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.5) 50%,
    rgba(255,255,255,0) 100%);
  animation: progressShine 2s linear infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.status-progress-fill.pagada .status-progress-shine {
  animation: none; /* Pagada ya no necesita brillo */
}

.status-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
}

.status-progress-pct {
  font-weight: 700;
  color: #0b2545;
  font-size: 12px;
}

/* Aprobaciones (badges verdes) */
.status-aprobaciones {
  padding: 14px 22px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-aprobacion-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}

.status-aprobacion-badge.autorizado {
  background: #d4edda;
  color: #155724;
}

.status-aprobacion-badge.pendiente {
  background: #fff3cd;
  color: #856404;
  animation: subtlePulse 2.5s ease-in-out infinite;
}

.status-aprobacion-badge.rechazado {
  background: #f8d7da;
  color: #721c24;
}

@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Mini chips de comprobantes */
.status-chips-row {
  padding: 12px 22px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-chip-comprobante {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.5px;
  transition: all 0.15s;
}

.status-chip-comprobante.anticipo {
  background: #e0e7ff;
  color: #3730a3;
}

.status-chip-comprobante.saldo {
  background: #fce7f3;
  color: #9d174d;
}

.status-chip-comprobante:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Acciones */
.status-card-actions {
  display: flex;
  gap: 8px;
  padding: 16px 22px 18px;
  flex-wrap: wrap;
}

.status-btn {
  flex: 1;
  min-width: 120px;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
}

.status-btn:hover {
  background: #f7f8fa;
  border-color: #c0c8d0;
  transform: translateY(-1px);
}

.status-btn.primary {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border-color: #0b2545;
}

.status-btn.primary:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.3);
}

/* Mobile */
@media (max-width: 768px) {
  .status-card-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .status-card-total-block {
    text-align: left;
  }

  .status-card-actions {
    flex-direction: column;
  }

  .status-btn {
    flex: none;
    width: 100%;
  }

  .status-card-folio {
    font-size: 13px;
  }

  .status-card-cliente {
    font-size: 16px;
  }
}

/* ===========================================================
   MÓDULO DE GESTIÓN DE PAGOS
   =========================================================== */

/* Resumen cliente + total */
.pago-resumen {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  background: #f7f8fa;
  padding: 18px 22px;
  border-radius: 8px;
  margin-bottom: 22px;
}
.pago-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}
.pago-cliente-nombre {
  font-family: 'IBM Plex Serif', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}
.pago-cliente-meta {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
}
.pago-total {
  font-family: 'IBM Plex Serif', serif;
  font-size: 26px;
  font-weight: 700;
  color: #d97706;
  letter-spacing: -0.5px;
}
.pago-pdf-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--navy);
  text-decoration: none;
  font-weight: 600;
}
.pago-pdf-link:hover { text-decoration: underline; }

/* Sección título */
.pago-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 18px 0 10px;
}

/* Cards de estado de pago */
.pago-estados {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.pago-estados-2 {
  grid-template-columns: repeat(2, 1fr);
}
.pago-estado-card {
  background: #fff;
  border: 2px solid #e4e7ec;
  border-radius: 8px;
  padding: 16px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.pago-estado-card:hover {
  border-color: #c0c8d0;
  transform: translateY(-1px);
}
.pago-estado-card.selected {
  background: #fff5e6;
  border-color: #d97706;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}
.pago-estado-card.selected.pagada {
  background: #d4edda;
  border-color: #28a745;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.15);
}
.pago-estado-card.selected.pendiente {
  background: #fff3cd;
  border-color: #f0c674;
}
.pago-estado-icon {
  font-size: 24px;
  margin-bottom: 6px;
}
.pago-estado-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 2px;
}
.pago-estado-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* Bloques de datos */
.pago-bloque {
  background: #f0f6ff;
  border: 1px solid #c0d5f0;
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 16px;
}
.pago-bloque.pago-bloque-pagada {
  background: #d4edda;
  border-color: #b5dcc1;
}
.pago-bloque.pago-bloque-plano {
  background: #d4edda;
  border-color: #b5dcc1;
}
.pago-bloque-titulo {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #0066cc;
  margin-bottom: 12px;
}
.pago-bloque-pagada .pago-bloque-titulo {
  color: #155724;
}
.pago-bloque-plano .pago-bloque-titulo {
  color: #155724;
}
.pago-bloque-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Saldo pendiente */
.pago-saldo {
  padding: 12px 14px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  font-family: 'IBM Plex Serif', serif;
  font-size: 18px;
  font-weight: 700;
  color: #d97706;
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Archivo cargado */
.pago-archivo-cargado {
  background: #fff;
  border: 1px solid #c0d5f0;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pago-archivo-cargado.verificado {
  background: #f0fdf4;
  border-color: #86efac;
}
.pago-archivo-cargado.autorizado {
  background: #f0fdf4;
  border-color: #16a34a;
  border-width: 2px;
}
.pago-archivo-cargado.rechazado {
  background: #fef2f2;
  border-color: #c0392b;
  border-width: 2px;
}
.pago-archivo-cargado.pendiente {
  background: #fffaf0;
  border-color: #d97706;
}
.pago-archivo-icon {
  width: 36px; height: 36px;
  background: #0066cc;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.pago-archivo-cargado.verificado .pago-archivo-icon,
.pago-archivo-cargado.autorizado .pago-archivo-icon {
  background: #16a34a;
}
.pago-archivo-cargado.rechazado .pago-archivo-icon {
  background: #c0392b;
}
.pago-archivo-cargado.pendiente .pago-archivo-icon {
  background: #d97706;
}
.pago-archivo-rechazado {
  font-size: 11px;
  color: #c0392b;
  font-weight: 700;
}
.pago-archivo-pendiente {
  font-size: 11px;
  color: #d97706;
  font-weight: 600;
}
.pago-motivo-rechazo {
  background: #fef2f2;
  border-left: 4px solid #c0392b;
  padding: 12px 14px;
  margin: 8px 0;
  border-radius: 4px;
  font-size: 13px;
  color: #8b2820;
}
.pago-motivo-rechazo strong {
  color: #c0392b;
  display: inline-block;
  margin-right: 6px;
}
.pago-archivo-bloqueado {
  background: #f0fdf4;
  border: 2px solid #16a34a;
  padding: 12px 16px;
  margin-top: 10px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 13px;
  color: #155724;
}
.pago-archivo-info {
  flex: 1;
  min-width: 0;
}
.pago-archivo-nombre {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.pago-archivo-verif {
  font-size: 11px;
  color: #16a34a;
  font-weight: 600;
}
.pago-archivo-pendiente {
  font-size: 11px;
  color: #d97706;
}
.pago-archivo-acciones {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pago-btn-ver {
  color: #0066cc;
  font-weight: 600;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background 0.15s;
}
.pago-btn-ver:hover { background: #e0eeff; }
.pago-btn-eliminar {
  background: #fee2e2;
  border: none;
  color: #c0392b;
  width: 30px; height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.pago-btn-eliminar:hover { background: #fecaca; }

/* Botón upload */
.pago-upload-btn {
  display: block;
  background: #0b1929;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px 20px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  margin-top: 10px;
  transition: background 0.15s;
}
.pago-upload-btn:hover { background: #1a2942; }
.pago-upload-btn.tiene { background: transparent; color: #0b1929; border: 2px dashed #c0c8d0; }
.pago-upload-btn.tiene:hover { background: #f7f8fa; border-color: #0b1929; }

.pago-verif-acciones {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

/* Mobile */
@media (max-width: 768px) {
  .pago-resumen {
    grid-template-columns: 1fr;
  }
  .pago-resumen > div:last-child {
    text-align: left !important;
  }
  .pago-estados {
    grid-template-columns: 1fr;
  }
  .pago-bloque {
    padding: 14px 16px;
  }
}

/* ============ UTILITIES ============ */
.utility-cell { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 2px; display: inline-block; min-width: 62px; text-align: center; }
.utility-low { background: var(--danger-light); color: var(--danger); }
.utility-med { background: var(--warning-light); color: var(--warning); }
.utility-high { background: var(--success-light); color: var(--success); }
.utility-zero { background: var(--bg-subtle); color: var(--text-muted); }

.badge { display: inline-block; padding: 3px 8px; font-family: 'IBM Plex Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; border-radius: 2px; font-weight: 600; }
.badge-publico { background: var(--bg-subtle); color: var(--text-secondary); border: 1px solid var(--border); }
.badge-constructor { background: var(--success-light); color: var(--success); }
.badge-emitida { background: var(--navy-light); color: var(--navy); }
.badge-borrador { background: #f0f0f0; color: #666; border: 1px dashed #999; }
.badge-enviada { background: #d1ecf1; color: #0c5460; }
.badge-aceptada { background: var(--success-light); color: var(--success); }
.badge-pagada { background: #d4edda; color: #155724; font-weight: 700; }
.badge-entregada { background: #0b2545; color: #fff; font-weight: 700; }
.badge-rechazada { background: var(--danger-light); color: var(--danger); }
.badge-cancelada { background: #6c757d; color: #fff; }

/* ============ WORKFLOW ESTADOS ============ */
.estado-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.estado-quick-btn {
  padding: 4px 10px;
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}
.estado-quick-btn:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.estado-quick-btn.success { color: var(--success); border-color: var(--success); }
.estado-quick-btn.success:hover { background: var(--success); color: #fff; }
.estado-quick-btn.danger { color: var(--danger); border-color: var(--danger); }
.estado-quick-btn.danger:hover { background: var(--danger); color: #fff; }

.estado-modal-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.estado-option {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: var(--bg);
}
.estado-option:hover {
  border-color: var(--navy);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(11,25,41,0.08);
}
.estado-option.selected {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.estado-option-icon {
  font-size: 22px;
  margin-bottom: 6px;
  display: block;
}
.estado-option-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.badge-vencida { background: var(--bg-subtle); color: var(--text-muted); }

.empty-state { text-align: center; padding: 80px 20px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; font-size: 13px; }
.placeholder-box { padding: 28px; color: var(--text-dim); font-family: 'IBM Plex Mono', monospace; font-size: 13px; line-height: 1.6; }

/* ===========================================================
   ============ DISEÑO RESPONSIVO ============
   Desktop: ≥901px → sidebar lateral + tablas
   Mobile:  ≤900px → sidebar deslizable + cards
   =========================================================== */

/* ============ DESKTOP (por defecto, no requiere media) ============ */
.mobile-header { display: none; }
.product-cards-mobile { display: none; }
.cotizaciones-cards-mobile { display: none; }
.sidebar-backdrop { display: none; }
.fab { display: none; }

/* ============ MOBILE (≤900px) ============ */
@media (max-width: 900px) {

  /* CRÍTICO: prevenir overflow horizontal en TODA la página */
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* APP: una sola columna, sidebar como overlay */
  .app {
    grid-template-columns: 1fr;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* SIDEBAR: oculto por defecto, deslizable */
  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    overflow-y: auto;
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Backdrop del sidebar abierto */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 25, 41, 0.55);
    z-index: 999;
  }
  .sidebar-backdrop.show {
    display: block;
  }

  /* MAIN: ocupa todo el ancho */
  .main {
    padding: 0 14px 100px 14px;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* MOBILE HEADER fijo */
  .mobile-header {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navy);
    color: #fff;
    padding: 12px 14px;
    align-items: center;
    gap: 14px;
    margin: 0 -14px 16px -14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  .mobile-burger {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 6px 10px;
    line-height: 1;
    border-radius: 4px;
  }
  .mobile-burger:active {
    background: rgba(255,255,255,0.15);
  }
  .mobile-title {
    font-family: 'IBM Plex Serif', serif;
    font-size: 18px;
    font-weight: 600;
    flex: 1;
  }
  .mobile-title small {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 400;
  }

  /* Header principal compacto */
  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  .main-title { font-size: 22px; }
  .main-title small { font-size: 10px; letter-spacing: 2px; }

  /* Botones de header de ancho completo */
  .header-actions { width: 100%; }
  .header-actions .btn { width: 100%; padding: 14px; font-size: 13px; }

  /* Pricing rule más compacto */
  .pricing-rule {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 14px;
    font-size: 12px;
  }
  .pricing-rule .icon { width: 30px; height: 30px; flex-shrink: 0; }

  /* Grid de stats: 2 columnas */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 12px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10px; }

  /* Forms en una columna */
  .form-row { grid-template-columns: 1fr; gap: 10px; }

  /* Controls bar vertical */
  .controls-bar {
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .search-box {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .search-box input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    box-sizing: border-box;
  }

  /* Chips horizontales con scroll — limitados al ancho del contenedor */
  .chips-mobile {
    display: flex !important;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    flex-wrap: nowrap !important;
    scrollbar-width: none;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .chips-mobile::-webkit-scrollbar { display: none; }
  .chips-mobile .chip {
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* ============ OCULTAR TABLAS, MOSTRAR CARDS ============ */
  .product-table { display: none !important; }
  .product-cards-mobile { display: flex !important; flex-direction: column; gap: 10px; }

  .data-table { display: none !important; }
  .cotizaciones-cards-mobile { display: flex !important; flex-direction: column; gap: 10px; }

  /* ============ TARJETAS DE PRODUCTO ============ */
  .product-card-mobile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }
  .product-card-mobile:active {
    transform: scale(0.98);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
  }
  .pcm-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 4px;
    word-wrap: break-word;
  }
  .pcm-clave {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
  }
  .pcm-attrs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
  }
  .pcm-attrs .attr-tag {
    font-size: 9px;
    padding: 2px 6px;
  }
  .pcm-precios {
    display: flex;
    gap: 12px;
    padding: 8px 10px;
    background: var(--bg-subtle);
    border-radius: 4px;
    border-left: 3px solid var(--navy);
    box-sizing: border-box;
    width: 100%;
  }
  .pcm-precio-block {
    flex: 1;
    min-width: 0;
  }
  .pcm-precio-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pcm-precio-val {
    font-family: 'IBM Plex Serif', serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: -0.3px;
  }
  .pcm-precio-block.constructor .pcm-precio-val {
    color: var(--success);
  }
  .pcm-action {
    width: 100%;
    padding: 12px;
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 4px;
    min-height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .pcm-action:active { background: var(--navy-accent); }

  /* Container de tarjetas debe respetar el ancho */
  .product-cards-mobile {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* CATEGORY HEADER móvil */
  .category-block { margin-bottom: 24px; }
  .category-name { font-size: 18px; }
  .category-count { font-size: 10px; }

  /* ============ CARDS COTIZACIONES ============ */
  .coc-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    border-left: 3px solid var(--navy);
  }
  .coc-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
  }
  .coc-folio {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: var(--navy);
    font-weight: 700;
  }
  .coc-fecha {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: var(--text-dim);
  }
  .coc-cliente {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
  }
  .coc-meta {
    font-size: 11px;
    color: var(--text-dim);
    font-family: 'IBM Plex Mono', monospace;
    margin-bottom: 10px;
  }
  .coc-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .coc-total {
    font-family: 'IBM Plex Serif', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
  }
  .coc-actions { display: flex; gap: 6px; }
  .coc-actions .btn-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  /* ============ MODAL FULL-SCREEN MÓVIL ============ */
  .modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  .modal {
    max-width: 100% !important;
    width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
  }
  .modal-header {
    padding: 14px 16px;
    flex-shrink: 0;
  }
  .modal-header h2 { font-size: 16px; }
  .modal-header h2 small { font-size: 9px; }
  .modal-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
  }
  .modal-footer {
    flex-direction: column-reverse !important;
    gap: 8px;
    padding: 12px 16px !important;
    flex-shrink: 0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  }
  .modal-footer .btn {
    width: 100%;
    padding: 14px;
    font-size: 13px;
    min-height: 44px;
  }

  /* SELECTOR DE EMPRESA en móvil */
  .empresa-selector {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .empresa-card { padding: 18px !important; }
  .empresa-card .empresa-name { font-size: 18px !important; }

  /* COTIZADOR ITEMS */
  .cot-item { padding: 12px; margin-bottom: 10px; }
  .cot-item-row { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* SELECTOR DE PRODUCTOS */
  .selector-list { max-height: calc(100vh - 200px) !important; }
  .selector-item {
    flex-direction: column;
    gap: 6px;
    padding: 14px;
  }
  .selector-item > div:last-child { text-align: left !important; font-size: 11px; }

  /* TOAST en móvil arriba del FAB */
  .toast {
    bottom: 90px !important;
    left: 14px !important;
    right: 14px !important;
    width: auto !important;
  }

  /* Botones más grandes para touch */
  .btn { min-height: 44px; }
  .form-input, .form-select { min-height: 44px; padding: 12px 14px; font-size: 14px; }

  /* FAB visible en móvil */
  .fab {
    display: flex !important;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 90;
    background: var(--navy);
    color: #fff;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(11, 37, 69, 0.4);
    transition: all 0.2s;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
  }
  .fab:active {
    transform: scale(0.92);
    box-shadow: 0 2px 8px rgba(11, 37, 69, 0.5);
  }
}

/* ============ Pantallas muy pequeñas (≤380px) ============ */
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-title { font-size: 18px; }
  .pcm-precios { gap: 8px; }
  .pcm-precio-val { font-size: 13px; }
}

/* ===========================================================
   PWA BANNERS (notificaciones e instalación)
   =========================================================== */

.bari-pwa-banner,
.bari-pwa-install-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  max-width: 480px;
  width: calc(100% - 40px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(11, 25, 41, 0.25);
  z-index: 9998;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
  border: 1px solid #e4e7ec;
}

.bari-pwa-banner.visible,
.bari-pwa-install-banner.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.bari-pwa-banner-content,
.bari-pwa-install-content {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.bari-pwa-banner-icon,
.bari-pwa-install-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.bari-pwa-banner-text,
.bari-pwa-install-text {
  flex: 1;
  min-width: 0;
}

.bari-pwa-banner-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 2px;
}

.bari-pwa-banner-msg,
.bari-pwa-install-text span {
  font-size: 12px;
  color: #6c757d;
  line-height: 1.4;
  display: block;
}

.bari-pwa-install-text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 2px;
}

.bari-pwa-banner-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.bari-pwa-btn-primary {
  padding: 8px 14px;
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s;
}

.bari-pwa-btn-primary:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  transform: translateY(-1px);
}

.bari-pwa-btn-secondary {
  padding: 8px 14px;
  background: transparent;
  color: #6c757d;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
}

.bari-pwa-btn-secondary:hover {
  color: #0b2545;
}

.bari-pwa-install-close {
  background: transparent;
  border: none;
  color: #98a2b3;
  cursor: pointer;
  width: 24px;
  height: 24px;
  font-size: 14px;
  border-radius: 4px;
}

.bari-pwa-install-close:hover {
  background: #f0f2f5;
  color: #0b2545;
}

.bari-pwa-banner.working .bari-pwa-banner-actions {
  opacity: 0.5;
  pointer-events: none;
}

.bari-pwa-banner.success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
}

.bari-pwa-banner.success .bari-pwa-banner-title {
  color: #fff;
}

.bari-pwa-banner.success .bari-pwa-banner-msg {
  color: rgba(255, 255, 255, 0.85);
}

@media (max-width: 480px) {
  .bari-pwa-banner-content,
  .bari-pwa-install-content {
    flex-wrap: wrap;
    gap: 10px;
  }
  .bari-pwa-banner-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* ===========================================================
   PWA BANNERS · Instalación y Notificaciones
   =========================================================== */
.pwa-install-banner,
.pwa-notif-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(11, 37, 69, 0.35);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9998;
  max-width: 480px;
  width: calc(100vw - 40px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'IBM Plex Sans', sans-serif;
}

.pwa-install-banner.show,
.pwa-notif-banner.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-notif-banner {
  background: linear-gradient(135deg, #047857 0%, #16a34a 100%);
  bottom: 90px; /* arriba del de instalación si los dos están visibles */
}

.pwa-install-icon,
.pwa-notif-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.pwa-install-content,
.pwa-notif-content {
  flex: 1;
  min-width: 0;
}

.pwa-install-title,
.pwa-notif-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2px;
}

.pwa-install-desc,
.pwa-notif-desc {
  font-size: 12px;
  opacity: 0.85;
}

.pwa-install-btn,
.pwa-notif-btn {
  background: #fff;
  color: #0b2545;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.pwa-notif-btn { color: #047857; }

.pwa-install-btn:hover,
.pwa-notif-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.pwa-install-close,
.pwa-notif-close {
  background: transparent;
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
  flex-shrink: 0;
}

.pwa-install-close:hover,
.pwa-notif-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.15);
}

/* Modal iOS */
.pwa-ios-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pwaFadeIn 0.3s;
}

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

.pwa-ios-modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  font-family: 'IBM Plex Sans', sans-serif;
}

.pwa-ios-modal-content h3 {
  margin: 0 0 12px;
  color: #0b2545;
}

.pwa-ios-modal-content p {
  margin: 0 0 8px;
  color: #555;
}

.pwa-ios-modal-content ol {
  padding-left: 22px;
  color: #333;
  line-height: 1.7;
  margin: 12px 0 18px;
}

.pwa-ios-modal-content button {
  width: 100%;
  background: #0b2545;
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

/* Toast PWA */
.pwa-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-120%);
  background: #16a34a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  z-index: 10001;
  font-weight: 600;
  font-size: 14px;
  transition: transform 0.3s ease;
  font-family: 'IBM Plex Sans', sans-serif;
}

.pwa-toast.show {
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 600px) {
  .pwa-install-banner,
  .pwa-notif-banner {
    bottom: 10px;
    width: calc(100vw - 20px);
    padding: 12px 14px;
  }
  .pwa-notif-banner { bottom: 80px; }
}

/* ===========================================================
   POP-UPS ADMIN (variantes nueva-cot y pagado-completo)
   =========================================================== */

/* Variant: Nueva cotización (azul-verde con efecto especial) */
.admin-popup.nueva-cot {
  border-top: 4px solid #3b82f6;
  background: linear-gradient(180deg, #fff 0%, #f0f8ff 100%);
}

.admin-popup.nueva-cot .vendedor-popup-icon {
  animation: nuevaCotPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
}

@keyframes nuevaCotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0); }
}

/* Variant: Pagado al 100% (verde-dorado celebratorio) */
.admin-popup.pagado-completo {
  border-top: 4px solid #16a34a;
  background: linear-gradient(180deg, #fff 0%, #f0fff4 50%, #fffbeb 100%);
  position: relative;
  overflow: hidden;
}

.admin-popup.pagado-completo::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #16a34a, #22c55e, #fbbf24, #f59e0b, #16a34a);
  background-size: 200% 100%;
  animation: pagadoShimmer 2s linear infinite;
}

@keyframes pagadoShimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

.admin-popup.pagado-completo .vendedor-popup-monto {
  font-size: 28px;
  background: linear-gradient(135deg, #16a34a 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
}

/* Bloque de info enriquecida */
.admin-popup-info {
  background: #f7f8fa;
  padding: 10px 12px;
  border-radius: 6px;
  margin-top: 8px;
  margin-bottom: 10px;
  border-left: 3px solid #e4e7ec;
}

.admin-popup.nueva-cot .admin-popup-info {
  border-left-color: #3b82f6;
}

.admin-popup-info-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 2px;
}

.admin-popup-info-row:last-child {
  margin-bottom: 0;
}

.admin-popup-info-label {
  font-family: 'IBM Plex Mono', monospace;
  color: #6c757d;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 70px;
}

.admin-popup-info-value {
  font-weight: 600;
  color: #1a2942;
  flex: 1;
  word-break: break-word;
}

/* Barra de progreso del pop-up */
.admin-popup-progress {
  margin: 10px 0 6px;
}

.admin-popup-progress-track {
  height: 6px;
  background: #e4e7ec;
  border-radius: 100px;
  overflow: hidden;
}

.admin-popup-progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-popup-progress-fill.partial {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.admin-popup-progress-fill.complete {
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 50%, #fbbf24 100%);
  animation: completeFlash 1.2s ease-in-out;
}

@keyframes completeFlash {
  0% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
  50% { box-shadow: 0 0 12px rgba(34, 197, 94, 0.6); }
  100% { box-shadow: 0 0 0 rgba(34, 197, 94, 0); }
}

.admin-popup-progress-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  text-align: right;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* Desglose anticipo + liquidación */
.admin-popup-desglose {
  background: #f0fff4;
  border-left: 3px solid #16a34a;
  padding: 8px 12px;
  border-radius: 4px;
  margin-top: 8px;
  font-size: 12px;
}

.admin-popup-desglose-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}

.admin-popup-desglose-row span:first-child {
  color: #16a34a;
  font-weight: 600;
}

.admin-popup-desglose-row span:last-child {
  font-family: 'IBM Plex Mono', monospace;
  color: #1a2942;
  font-weight: 600;
}

/* ===========================================================
   ADMIN MOBILE: Hamburguesa + Cards productos + Modal edición
   =========================================================== */

/* Helper visibility */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* ============ MOBILE HEADER ============ */
.mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0b2545;
  color: #fff;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.mobile-menu-btn {
  background: transparent;
  border: none;
  width: 34px;
  height: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s;
  margin: 0 auto;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-header-title {
  flex: 1;
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-logout-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
}

.mobile-logout-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ============ SIDEBAR BACKDROP ============ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* ============ CARDS DE PRODUCTOS MOBILE ============ */
.productos-cards-mobile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2px;
}

.prod-card-mobile {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(11, 25, 41, 0.04);
  position: relative;
  overflow: hidden;
}

.prod-card-mobile::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #0b2545 0%, #1a3a6b 100%);
}

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

.prod-card-clave {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #0b2545;
  letter-spacing: 1px;
  background: #f0f2f5;
  padding: 3px 8px;
  border-radius: 4px;
}

.prod-card-tipo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #6c757d;
  background: #fff7e6;
  padding: 3px 8px;
  border-radius: 100px;
  border: 1px solid #b7791f;
  color: #855411;
}

.prod-card-titulo {
  font-family: 'IBM Plex Serif', serif;
  font-size: 15px;
  font-weight: 600;
  color: #0b1929;
  line-height: 1.35;
  margin-bottom: 6px;
}

.prod-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.prod-card-meta span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  background: #f7f8fa;
  padding: 2px 7px;
  border-radius: 3px;
}

.prod-card-precios {
  background: #fafbfc;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
}

.prod-card-precio-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #eef0f3;
}

.prod-card-precio-row:last-child {
  border-bottom: none;
}

.prod-card-precio-row.costo {
  background: #fff7e6;
  margin: -8px -12px 4px;
  padding: 6px 12px;
  border-bottom: 1px solid #f0d8a3;
}

.prod-card-precio-row.publico {
  font-weight: 600;
}

.prod-card-precio-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.prod-card-precio-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
}

.prod-card-precio-row.publico .prod-card-precio-val {
  color: #0b2545;
  font-size: 16px;
}

.prod-card-precio-row.costo .prod-card-precio-val {
  color: #855411;
}

.prod-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.prod-card-margen {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.prod-card-margen-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prod-card-margen-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #0b2545;
}

.prod-card-margen-val.positive { color: #16a34a; }
.prod-card-margen-val.warning { color: #d97706; }
.prod-card-margen-val.danger { color: #c0392b; }

.prod-card-btn-editar {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.prod-card-btn-editar:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.2);
}

.prod-card-btn-editar:active {
  transform: translateY(0);
}

/* ============ MODAL DE EDICIÓN MOBILE ============ */
.mobile-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
}

.mobile-modal.active {
  visibility: visible;
  pointer-events: auto;
}

.mobile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.6);
  opacity: 0;
  transition: opacity 0.3s;
}

.mobile-modal.active .mobile-modal-backdrop {
  opacity: 1;
}

.mobile-modal-content {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-modal.active .mobile-modal-content {
  transform: translateY(0);
}

.mobile-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef0f3;
}

.mobile-modal-title-block {
  flex: 1;
  min-width: 0;
}

.mobile-modal-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #6c757d;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.mobile-modal-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 17px;
  font-weight: 700;
  color: #0b1929;
  line-height: 1.3;
}

.mobile-modal-close {
  width: 32px;
  height: 32px;
  background: #f0f2f5;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  color: #6c757d;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-modal-close:hover {
  background: #e4e7ec;
  color: #0b2545;
}

.mobile-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.mobile-modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #fafbfc;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 11px;
}

.mobile-modal-meta-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.mobile-modal-meta-grid span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mobile-modal-meta-grid strong {
  color: #0b2545;
  font-size: 13px;
  font-weight: 700;
}

.mobile-form-group {
  margin-bottom: 14px;
}

.mobile-form-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #6c757d;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.mobile-form-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #e4e7ec;
  border-radius: 8px;
  transition: border-color 0.15s;
}

.mobile-form-input-wrap:focus-within {
  border-color: #0b2545;
}

.mobile-form-prefix {
  padding: 0 12px;
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 16px;
}

.mobile-form-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 12px 14px 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  color: #0b2545;
  background: transparent;
  width: 100%;
  -moz-appearance: textfield;
}

.mobile-form-input-wrap input::-webkit-outer-spin-button,
.mobile-form-input-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mobile-margen-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: #f0f8ff;
  border-left: 3px solid #3b82f6;
  border-radius: 6px;
  margin-top: 6px;
}

.mobile-margen-preview span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mobile-margen-preview strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: #0b2545;
}

.mobile-margen-preview strong.positive { color: #16a34a; }
.mobile-margen-preview strong.warning { color: #d97706; }
.mobile-margen-preview strong.danger { color: #c0392b; }

.mobile-modal-actions {
  display: flex;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

.mobile-btn-secondary,
.mobile-btn-primary {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mobile-btn-secondary {
  background: #fff;
  color: #6c757d;
  border: 1px solid #e4e7ec;
}

.mobile-btn-secondary:hover {
  background: #f7f8fa;
  border-color: #c0c8d0;
}

.mobile-btn-primary {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  flex: 2;
}

.mobile-btn-primary:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
}

.mobile-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============ RESPONSIVE BREAKPOINTS ============ */
@media (max-width: 900px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }

  .mobile-header { display: flex; }

  .app {
    display: block !important;
  }

  .sidebar {
    position: fixed !important;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main {
    padding: 16px 14px !important;
    margin-left: 0 !important;
  }

  .main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .main-title {
    font-size: 22px;
  }

  .main-title small {
    font-size: 10px;
  }

  .header-actions {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }

  .header-actions .btn {
    flex: 1;
    min-width: 130px;
  }

  /* Tablas con scroll horizontal */
  .data-table-wrap:not(.desktop-only) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Filtros más compactos */
  .filters {
    flex-wrap: wrap;
  }

  .filter-input,
  .filter-select {
    flex: 1;
    min-width: 130px;
  }

  /* Stats grid: 2 columnas en mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

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

  /* Modales */
  .modal-overlay .modal {
    margin: 0;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh;
    border-radius: 0;
  }
}

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

  .main {
    padding: 12px 10px !important;
  }

  .main-title {
    font-size: 19px;
  }
}

/* ===========================================================
   FICHAS TÉCNICAS - Cards admin + Popup vendedor
   =========================================================== */

/* ============ ADMIN: Listado de fichas ============ */
.fichas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.ficha-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 16px;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
}

.ficha-card:hover {
  border-color: #c0c8d0;
  box-shadow: 0 4px 14px rgba(11, 25, 41, 0.06);
}

.ficha-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #0b2545 0%, #1a3a6b 100%);
}

.ficha-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.ficha-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.ficha-card-info {
  flex: 1;
  min-width: 0;
}

.ficha-card-titulo {
  font-family: 'IBM Plex Serif', serif;
  font-size: 15px;
  font-weight: 700;
  color: #0b2545;
  line-height: 1.3;
  margin-bottom: 6px;
}

.ficha-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ficha-empresa-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 100px;
}

.ficha-nivel {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: #f0f2f5;
  color: #6c757d;
}

.ficha-nivel.producto {
  background: #fff7e6;
  color: #855411;
  border: 1px solid #f0d8a3;
}

.ficha-nivel.subcategoria {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.ficha-nivel.categoria {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.ficha-card-desc {
  font-size: 13px;
  color: #6c757d;
  line-height: 1.5;
  padding: 10px 12px;
  background: #fafbfc;
  border-radius: 6px;
  margin-bottom: 10px;
  font-style: italic;
}

.ficha-card-footer {
  border-top: 1px solid #f0f2f5;
  padding-top: 10px;
}

.ficha-card-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

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

.ficha-btn {
  flex: 1;
  min-width: 90px;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #e4e7ec;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  color: #495057;
  transition: all 0.15s;
}

.ficha-btn:hover {
  border-color: #0b2545;
  color: #0b2545;
  background: #f7f8fa;
}

.ficha-btn.ver {
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border-color: #0b2545;
}

.ficha-btn.ver:hover {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  color: #fff;
}

.ficha-btn.descargar {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.ficha-btn.descargar:hover {
  background: #15803d;
  color: #fff;
  border-color: #15803d;
}

.ficha-btn.copiar:hover {
  background: #fff7e6;
  color: #855411;
  border-color: #b7791f;
}

.ficha-btn.eliminar:hover {
  background: #fdf0ef;
  color: #c0392b;
  border-color: #c0392b;
}

@media (max-width: 768px) {
  .fichas-grid {
    grid-template-columns: 1fr;
  }
}

/* ============ Botón "Ficha Técnica" en lista de precios vendedor ============ */
.pcm-actions-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.pcm-action {
  flex: 1;
  padding: 11px 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.pcm-action:hover, .pcm-action:active {
  background: linear-gradient(135deg, #061834 0%, #0f2950 100%);
  transform: translateY(-1px);
}

.pcm-action.ficha {
  background: #fff;
  color: #0b2545;
  border: 1.5px solid #0b2545;
}

.pcm-action.ficha:hover {
  background: #f7f8fa;
}

.btn-ficha {
  background: #fff;
  color: #0b2545;
  border: 1.5px solid #0b2545;
  font-weight: 600;
}

.btn-ficha:hover {
  background: #f7f8fa;
  border-color: #061834;
  color: #061834;
}

/* ============ POPUP DE FICHA TÉCNICA (vendedor) ============ */
.ficha-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  padding: 20px;
}

.ficha-popup-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.ficha-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.65);
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}

.ficha-popup-overlay.active .ficha-popup-backdrop {
  opacity: 1;
}

.ficha-popup-content {
  position: relative;
  background: #fff;
  border-radius: 16px;
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.ficha-popup-overlay.active .ficha-popup-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.ficha-popup-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 18px;
  background: linear-gradient(135deg, #0b2545 0%, #1a3a6b 100%);
  color: #fff;
  position: relative;
}

.ficha-popup-header-icon {
  font-size: 38px;
  flex-shrink: 0;
}

.ficha-popup-header-block {
  flex: 1;
  min-width: 0;
}

.ficha-popup-header-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.ficha-popup-header-titulo {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
}

.ficha-popup-header-clave {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  opacity: 0.75;
  letter-spacing: 1px;
}

.ficha-popup-close {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ficha-popup-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ficha-popup-body {
  padding: 22px;
}

.ficha-popup-info {
  background: #fafbfc;
  border-left: 3px solid #0b2545;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 18px;
}

.ficha-popup-info-titulo {
  font-family: 'IBM Plex Serif', serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 4px;
}

.ficha-popup-info-desc {
  font-size: 12px;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 6px;
}

.ficha-popup-info-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 0.5px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ficha-popup-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ficha-popup-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid #e4e7ec;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: #0b2545;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.ficha-popup-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(11, 37, 69, 0.1);
}

.ficha-popup-btn-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.ficha-popup-btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.ficha-popup-btn-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
}

.ficha-popup-btn-text small {
  font-size: 11px;
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
}

.ficha-popup-btn.descargar {
  border-color: #16a34a;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
}

.ficha-popup-btn.descargar strong,
.ficha-popup-btn.descargar small {
  color: #fff;
}

.ficha-popup-btn.descargar small {
  color: rgba(255, 255, 255, 0.85);
}

.ficha-popup-btn.descargar:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

.ficha-popup-btn.whatsapp {
  border-color: #25D366;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.ficha-popup-btn.whatsapp strong,
.ficha-popup-btn.whatsapp small {
  color: #fff;
}

.ficha-popup-btn.whatsapp small {
  color: rgba(255, 255, 255, 0.9);
}

.ficha-popup-btn.whatsapp:hover {
  background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
}

.ficha-popup-empty {
  text-align: center;
  padding: 40px 20px;
}

@media (max-width: 480px) {
  .ficha-popup-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .ficha-popup-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
  }
}

/* ===========================================================
   SUBCATEGORÍAS - Listado agrupado por empresa/categoría
   =========================================================== */

.subcat-group {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(11, 25, 41, 0.04);
}

.subcat-group-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
  border-left: 4px solid #0b2545;
}

.subcat-group-empresa {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #6c757d;
  padding: 3px 10px;
  background: #fff;
  border-radius: 100px;
  border: 1px solid #e4e7ec;
}

.subcat-group-categoria {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 700;
  color: #0b2545;
  flex: 1;
}

.subcat-group-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
  background: #fff;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid #e4e7ec;
}

.subcat-items {
  padding: 8px 12px;
}

.subcat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid #f7f8fa;
  transition: background 0.15s;
}

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

.subcat-item:hover {
  background: #fafbfc;
}

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

.subcat-item-nombre {
  font-size: 14px;
  font-weight: 600;
  color: #0b2545;
  margin-bottom: 2px;
}

.subcat-item-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 0.5px;
}

.subcat-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-icon-sm {
  width: 32px;
  height: 32px;
  border: 1px solid #e4e7ec;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-sm:hover {
  background: #fafbfc;
  border-color: #0b2545;
  transform: translateY(-1px);
}

.btn-icon-sm.danger:hover {
  background: #fdf0ef;
  border-color: #c0392b;
  color: #c0392b;
}

@media (max-width: 600px) {
  .subcat-group-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px;
  }

  .subcat-group-empresa {
    order: 1;
    flex-shrink: 0;
  }

  .subcat-group-count {
    order: 2;
    flex-shrink: 0;
    font-size: 10px;
  }

  .subcat-group-categoria {
    order: 3;
    width: 100%;
    font-size: 14px;
  }

  .subcat-item {
    padding: 12px 8px;
  }
}

/* ===========================================================
   AUTORIZACIÓN DE PRECIO (vendedor)
   =========================================================== */

.status-btn.autorizacion {
  background: linear-gradient(135deg, #b7791f 0%, #d97706 100%);
  color: #fff;
  border-color: #b7791f;
}

.status-btn.autorizacion:hover {
  background: linear-gradient(135deg, #92580f 0%, #b7791f 100%);
  border-color: #92580f;
}

/* Modal de solicitud */
.aut-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  padding: 20px;
}

.aut-modal-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.aut-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.65);
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(4px);
}

.aut-modal-overlay.active .aut-modal-backdrop {
  opacity: 1;
}

.aut-modal-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.aut-modal-overlay.active .aut-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.aut-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  background: linear-gradient(135deg, #b7791f 0%, #d97706 100%);
  color: #fff;
}

.aut-modal-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.aut-modal-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 3px;
}

.aut-modal-folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  opacity: 0.85;
  letter-spacing: 1px;
}

.aut-modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}

.aut-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

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

.aut-cliente-info {
  background: #f7f8fa;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.aut-cliente-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 0;
}

.aut-cliente-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aut-cliente-row strong {
  color: #0b1929;
  font-weight: 700;
}

.aut-instructions {
  background: #fff7e6;
  border-left: 3px solid #b7791f;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  color: #855411;
  margin-bottom: 14px;
}

.aut-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aut-item {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.15s;
}

.aut-item:hover {
  border-color: #b7791f;
}

.aut-item-info {
  margin-bottom: 10px;
}

.aut-item-name {
  font-family: 'IBM Plex Serif', serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b1929;
  line-height: 1.3;
  margin-bottom: 3px;
}

.aut-item-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 0.5px;
}

.aut-item-prices {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aut-price-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.aut-price-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.aut-price-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #6c757d;
  padding: 8px 10px;
  background: #f7f8fa;
  border-radius: 6px;
  text-align: center;
}

.aut-price-arrow {
  font-size: 18px;
  color: #b7791f;
  flex-shrink: 0;
}

.aut-price-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #b7791f;
  border-radius: 6px;
  padding: 0 8px;
}

.aut-price-input-wrap span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  margin-right: 4px;
}

.aut-price-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 8px 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  background: transparent;
  width: 100%;
  text-align: right;
}

.aut-price-input::-webkit-outer-spin-button,
.aut-price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.aut-motivo-block {
  margin-top: 18px;
}

.aut-motivo-block label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #6c757d;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.aut-motivo-block textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
}

.aut-motivo-block textarea:focus {
  border-color: #b7791f;
}

.aut-totals {
  margin-top: 18px;
  padding: 14px;
  background: #fafbfc;
  border-radius: 8px;
}

.aut-totals-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.aut-totals-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.aut-totals-row strong {
  color: #0b1929;
  font-weight: 700;
}

.aut-totals-row.destacado {
  border-top: 1px solid #e4e7ec;
  margin-top: 8px;
  padding-top: 10px;
}

.aut-totals-row.destacado strong {
  color: #b7791f;
  font-size: 15px;
}

.aut-modal-footer {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

.aut-btn {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.aut-btn-secondary {
  background: #fff;
  color: #6c757d;
  border: 1px solid #e4e7ec;
}

.aut-btn-secondary:hover {
  background: #f7f8fa;
}

.aut-btn-primary {
  background: linear-gradient(135deg, #b7791f 0%, #d97706 100%);
  color: #fff;
  flex: 2;
}

.aut-btn-primary:hover {
  background: linear-gradient(135deg, #92580f 0%, #b7791f 100%);
}

.aut-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pop-up de respuesta del admin */
.pop-aut {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  animation: popAutIn 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.pop-aut-card {
  background: #fff;
  width: 320px;
  border-radius: 12px;
  border-left: 4px solid #16a34a;
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  position: relative;
}

.pop-aut-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  background: #f0f2f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  color: #6c757d;
}

.pop-aut-close:hover {
  background: #e4e7ec;
}

.pop-aut-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.pop-aut-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 15px;
  font-weight: 700;
  color: #0b1929;
  margin-bottom: 3px;
}

.pop-aut-folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.pop-aut-msg {
  margin-bottom: 12px;
}

.pop-aut-actions {
  display: flex;
  gap: 6px;
}

.pop-aut-btn {
  flex: 1;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pop-aut-btn.aplicar {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
}

.pop-aut-btn.aplicar:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
}

@media (max-width: 600px) {
  .aut-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .aut-modal-card {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 95vh;
  }
  .aut-item-prices {
    flex-direction: column;
    align-items: stretch;
  }
  .aut-price-arrow {
    transform: rotate(90deg);
    text-align: center;
    margin: 4px 0;
  }
  .pop-aut {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
  .pop-aut-card {
    width: 100%;
  }
}

/* ===========================================================
   AUTORIZACIONES DE PRECIO (admin)
   =========================================================== */

/* Badge en menú */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: #c0392b;
  color: #fff;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2);
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(192, 57, 43, 0); }
}

.nav-item-aut .nav-icon {
  background: linear-gradient(135deg, #b7791f 0%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards de solicitudes */
.aut-admin-card {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: all 0.15s;
}

.aut-admin-card:hover {
  border-color: #b7791f;
  box-shadow: 0 4px 14px rgba(11, 25, 41, 0.06);
}

.aut-admin-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
  flex-wrap: wrap;
}

.aut-admin-card-empresa {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.aut-admin-card-folio {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0b2545;
  flex: 1;
}

.aut-admin-card-fecha {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
}

.aut-admin-card-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 100px;
}

.aut-admin-card-body {
  padding: 16px 18px;
}

.aut-admin-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.aut-admin-card-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.aut-admin-card-value {
  font-size: 14px;
  font-weight: 600;
  color: #0b1929;
}

.aut-admin-card-motivo {
  font-style: italic;
  font-size: 13px;
  color: #6c757d;
  background: #f7f8fa;
  padding: 10px 14px;
  border-left: 3px solid #b7791f;
  border-radius: 4px;
  margin-bottom: 14px;
}

.aut-admin-card-totales {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(135deg, #fff7e6 0%, #fef3c7 100%);
  border-radius: 8px;
}

.aut-totales-block {
  flex: 1;
}

.aut-totales-block span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.aut-totales-block strong {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: #0b2545;
}

.aut-totales-block.destacado strong {
  color: #b7791f;
}

.aut-totales-block.descuento strong {
  color: #c0392b;
}

.aut-totales-arrow {
  font-size: 22px;
  color: #b7791f;
  font-weight: 700;
}

.aut-admin-card-actions {
  padding: 12px 18px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

/* Modal de revisión */
.aut-rev-info {
  background: #f7f8fa;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.aut-rev-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.aut-rev-info-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aut-rev-info-row strong {
  color: #0b1929;
  font-weight: 700;
}

.aut-rev-motivo {
  background: #fff7e6;
  border-left: 3px solid #b7791f;
  padding: 12px 14px;
  border-radius: 4px;
  margin-bottom: 14px;
}

.aut-rev-motivo-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #855411;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.aut-rev-motivo-text {
  font-size: 13px;
  color: #5a3608;
  font-style: italic;
}

.aut-rev-items-header {
  display: grid;
  grid-template-columns: 2.5fr 0.7fr 1fr 1fr 1.3fr;
  gap: 8px;
  padding: 10px 14px;
  background: #0b2545;
  color: #fff;
  border-radius: 8px 8px 0 0;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.aut-rev-items-header .num {
  text-align: right;
}

.aut-rev-items {
  border: 1px solid #e4e7ec;
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-bottom: 14px;
}

.aut-rev-item {
  display: grid;
  grid-template-columns: 2.5fr 0.7fr 1fr 1fr 1.3fr;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #f0f2f5;
  align-items: center;
  font-size: 13px;
}

.aut-rev-item:last-child {
  border-bottom: none;
}

.aut-rev-item .num {
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
}

.aut-rev-item-name {
  font-weight: 600;
  color: #0b1929;
}

.aut-rev-item-name small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  margin-top: 2px;
}

.aut-rev-item-orig {
  color: #6c757d;
}

.aut-rev-item-prop {
  color: #b7791f;
  font-weight: 700;
}

.aut-rev-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid #16a34a;
  border-radius: 6px;
  padding: 0 6px;
}

.aut-rev-input-wrap span {
  color: #16a34a;
  font-weight: 600;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}

.aut-rev-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 6px 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  width: 100%;
  text-align: right;
  background: transparent;
}

.aut-rev-input::-webkit-outer-spin-button,
.aut-rev-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.aut-rev-totales {
  background: #fafbfc;
  padding: 14px;
  border-radius: 8px;
}

.aut-rev-tot-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.aut-rev-tot-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.aut-rev-tot-row strong {
  font-family: 'IBM Plex Mono', monospace;
  color: #0b1929;
  font-weight: 700;
}

.aut-rev-tot-row.destacado {
  border-top: 1px solid #e4e7ec;
  margin-top: 8px;
  padding-top: 10px;
}

.aut-rev-tot-row.destacado strong {
  color: #16a34a;
  font-size: 16px;
}

.aut-rev-respuesta {
  background: #e0f2fe;
  border-left: 3px solid #0369a1;
  padding: 12px 14px;
  border-radius: 4px;
  margin-top: 14px;
}

.aut-rev-resp-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #0369a1;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.aut-rev-resp-text {
  font-size: 13px;
  color: #0c4a6e;
  font-style: italic;
}

/* Pop-up admin de nueva solicitud */
.aut-admin-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  animation: autAdminPopupIn 0.4s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes autAdminPopupIn {
  from { transform: translateY(40px) scale(0.95); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.aut-admin-popup-card {
  background: #fff;
  width: 360px;
  border-radius: 14px;
  border-top: 4px solid #b7791f;
  padding: 16px 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  position: relative;
}

.aut-admin-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: none;
  background: #f0f2f5;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  color: #6c757d;
}

.aut-admin-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.aut-admin-popup-icon {
  font-size: 32px;
}

.aut-admin-popup-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #b7791f;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.aut-admin-popup-folio {
  font-family: 'IBM Plex Serif', serif;
  font-size: 16px;
  font-weight: 700;
  color: #0b2545;
}

.aut-admin-popup-body {
  margin-bottom: 12px;
}

.aut-admin-popup-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.aut-admin-popup-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aut-admin-popup-row strong {
  color: #0b1929;
  font-weight: 700;
  font-size: 12px;
}

.aut-admin-popup-row.destacado strong {
  color: #b7791f;
  font-size: 13px;
}

.aut-admin-popup-motivo {
  font-style: italic;
  font-size: 11px;
  color: #6c757d;
  background: #f7f8fa;
  padding: 8px 10px;
  border-radius: 4px;
  margin-top: 8px;
}

.aut-admin-popup-btn {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #b7791f 0%, #d97706 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.aut-admin-popup-btn:hover {
  background: linear-gradient(135deg, #92580f 0%, #b7791f 100%);
}

@media (max-width: 768px) {
  .aut-admin-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .aut-admin-card-info {
    grid-template-columns: 1fr;
  }

  .aut-admin-card-totales {
    flex-direction: column;
    align-items: stretch;
  }

  .aut-totales-arrow {
    transform: rotate(90deg);
    text-align: center;
  }

  .aut-rev-items-header,
  .aut-rev-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .aut-rev-items-header > div::before,
  .aut-rev-item > div::before {
    content: attr(data-label);
  }

  .aut-admin-popup {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }

  .aut-admin-popup-card {
    width: 100%;
  }
}

/* ===========================================================
   MODAL DE RESULTADO DE AUTORIZACIÓN (vendedor)
   =========================================================== */

.aut-resultado-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  pointer-events: none;
  padding: 20px;
}

.aut-resultado-overlay.active {
  visibility: visible;
  pointer-events: auto;
}

.aut-resultado-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.75);
  opacity: 0;
  transition: opacity 0.25s;
  backdrop-filter: blur(6px);
}

.aut-resultado-overlay.active .aut-resultado-backdrop {
  opacity: 1;
}

.aut-resultado-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 580px;
  max-height: 92vh;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92) translateY(20px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.aut-resultado-overlay.active .aut-resultado-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.aut-resultado-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 20px;
  color: #fff;
}

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

.aut-res-header-icon {
  font-size: 36px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.aut-res-header-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  opacity: 0.95;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-weight: 700;
}

.aut-res-header-folio {
  font-family: 'IBM Plex Serif', serif;
  font-size: 19px;
  font-weight: 700;
}

.aut-res-close {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.15s;
}

.aut-res-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.aut-resultado-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.aut-res-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.aut-res-info-block {
  background: #fafbfc;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 3px solid #e4e7ec;
}

.aut-res-info-block span {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.aut-res-info-block strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0b1929;
}

.aut-res-comentario {
  background: #e0f2fe;
  border-left: 3px solid #0369a1;
  padding: 12px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.aut-res-comentario-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #0369a1;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.aut-res-comentario-text {
  font-size: 13px;
  color: #0c4a6e;
  font-style: italic;
  line-height: 1.4;
}

.aut-res-items-section {
  margin-bottom: 16px;
}

.aut-res-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.aut-res-items-list {
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  overflow: hidden;
}

.aut-res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s;
}

.aut-res-item:last-child {
  border-bottom: none;
}

.aut-res-item:hover {
  background: #fafbfc;
}

.aut-res-item-info {
  flex: 1;
  min-width: 0;
}

.aut-res-item-name {
  font-family: 'IBM Plex Serif', serif;
  font-size: 13px;
  font-weight: 700;
  color: #0b1929;
  line-height: 1.3;
  margin-bottom: 2px;
}

.aut-res-item-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 0.5px;
}

.aut-res-item-prices {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.aut-res-precio-orig {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: #6c757d;
}

.aut-res-precio-orig.tachado {
  text-decoration: line-through;
}

.aut-res-arrow {
  font-size: 16px;
  color: #16a34a;
  font-weight: 700;
}

.aut-res-precio-nuevo {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: #16a34a;
  background: #e8f5ea;
  padding: 3px 10px;
  border-radius: 4px;
}

.aut-res-igual {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  font-style: italic;
}

.aut-res-totales {
  background: linear-gradient(135deg, #f7f8fa 0%, #fafbfc 100%);
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid #e4e7ec;
}

.aut-res-tot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.aut-res-tot-row span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.aut-res-tot-row strong {
  font-family: 'IBM Plex Mono', monospace;
  color: #0b1929;
  font-weight: 700;
  font-size: 14px;
}

.aut-res-tot-row.destacado {
  border-top: 1px solid #e4e7ec;
  margin-top: 6px;
  padding-top: 10px;
}

.aut-res-tot-row.destacado strong {
  color: #16a34a;
  font-size: 18px;
}

.aut-res-tot-row.ahorro strong {
  color: #c0392b;
}

.aut-resultado-footer {
  border-top: 1px solid #eef0f3;
  padding: 16px 24px 20px;
  background: #fafbfc;
}

.aut-res-instructions {
  background: #fff7e6;
  border-left: 3px solid #b7791f;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 12px;
  color: #855411;
  margin-bottom: 12px;
  line-height: 1.4;
}

.aut-res-instructions strong {
  display: block;
  margin-bottom: 2px;
}

.aut-res-actions {
  display: flex;
  gap: 10px;
}

.aut-res-btn {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.aut-res-btn-secondary {
  background: #fff;
  color: #6c757d;
  border: 1px solid #e4e7ec;
}

.aut-res-btn-secondary:hover {
  background: #f7f8fa;
  border-color: #c0c8d0;
  color: #0b2545;
}

.aut-res-btn-primary {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  flex: 2;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.aut-res-btn-primary:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.aut-res-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 600px) {
  .aut-resultado-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .aut-resultado-card {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 95vh;
  }
  .aut-resultado-header {
    padding: 18px 20px;
  }
  .aut-res-header-icon {
    font-size: 30px;
  }
  .aut-res-header-folio {
    font-size: 16px;
  }
  .aut-res-info-grid {
    grid-template-columns: 1fr 1fr;
  }
  .aut-res-item {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .aut-res-item-prices {
    justify-content: flex-end;
  }
}

/* ===========================================================
   HISTORIAL DE AUTORIZACIONES EN CARDS
   =========================================================== */

.aut-historial-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e4e7ec;
}

.aut-historial-block:empty {
  display: none;
}

.aut-hist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.aut-hist-icon {
  font-size: 16px;
}

.aut-hist-title {
  flex: 1;
  font-family: 'IBM Plex Serif', serif;
  font-size: 13px;
  font-weight: 700;
  color: #0b2545;
}

.aut-hist-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  background: #f0f2f5;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: 0.5px;
}

.aut-hist-timeline {
  position: relative;
  padding-left: 22px;
}

.aut-hist-item {
  position: relative;
  margin-bottom: 14px;
}

.aut-hist-item:last-child {
  margin-bottom: 0;
}

.aut-hist-item-line {
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: -14px;
  width: 2px;
  background: #e4e7ec;
}

.aut-hist-item:last-child .aut-hist-item-line {
  display: none;
}

.aut-hist-item-dot {
  position: absolute;
  left: -19px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #e4e7ec;
  z-index: 1;
}

.aut-hist-item-card {
  background: #fafbfc;
  border: 1px solid #e4e7ec;
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.15s;
}

.aut-hist-item[data-estado="pendiente"] .aut-hist-item-card {
  background: #fffbeb;
  border-color: #fde68a;
}

.aut-hist-item[data-estado="autorizada"] .aut-hist-item-card,
.aut-hist-item[data-estado="aplicada"] .aut-hist-item-card {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.aut-hist-item[data-estado="rechazada"] .aut-hist-item-card {
  background: #fef2f2;
  border-color: #fecaca;
}

.aut-hist-item[data-estado="contrapropuesta"] .aut-hist-item-card {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.aut-hist-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.aut-hist-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.aut-hist-numero {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  font-weight: 600;
}

.aut-hist-fecha {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  margin-left: auto;
  letter-spacing: 0.5px;
}

.aut-hist-people {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
}

.aut-hist-person {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

.aut-hist-person span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.aut-hist-person strong {
  color: #0b1929;
  font-weight: 700;
}

.aut-hist-person small {
  color: #9ca3af;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  margin-left: auto;
}

.aut-hist-person.aplicada strong {
  color: #15803d;
}

.aut-hist-motivo {
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 11px;
  border-left: 3px solid #b7791f;
}

.aut-hist-motivo.admin {
  border-left-color: #0369a1;
}

.aut-hist-motivo span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.aut-hist-motivo em {
  color: #0b1929;
  font-style: italic;
}

.aut-hist-items {
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.aut-hist-items-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: #6c757d;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 700;
}

.aut-hist-producto {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed #f0f2f5;
}

.aut-hist-producto:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.aut-hist-producto:first-child {
  padding-top: 0;
}

.aut-hist-prod-info {
  flex: 1;
  min-width: 0;
}

.aut-hist-prod-name {
  font-family: 'IBM Plex Serif', serif;
  font-size: 12px;
  font-weight: 700;
  color: #0b1929;
  line-height: 1.3;
  margin-bottom: 2px;
}

.aut-hist-prod-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  color: #6c757d;
  letter-spacing: 0.5px;
}

.aut-hist-prod-precios {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  text-align: right;
}

.aut-hist-precio {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 10px;
}

.aut-hist-precio-label {
  font-family: 'IBM Plex Mono', monospace;
  color: #6c757d;
  letter-spacing: 0.3px;
  font-size: 9px;
}

.aut-hist-precio strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #0b1929;
  font-weight: 700;
}

.aut-hist-precio.propuesto strong {
  color: #b7791f;
}

.aut-hist-precio.autorizado strong {
  color: #15803d;
}

.aut-hist-precio.rechazado strong {
  color: #c0392b;
}

.aut-hist-totales {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  padding: 8px 10px;
}

.aut-hist-tot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 11px;
}

.aut-hist-tot span {
  color: #6c757d;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.aut-hist-tot strong {
  font-family: 'IBM Plex Mono', monospace;
  color: #0b1929;
  font-weight: 700;
  font-size: 12px;
}

.aut-hist-tot.destacado {
  border-top: 1px solid #e4e7ec;
  margin-top: 4px;
  padding-top: 6px;
}

.aut-hist-tot.destacado strong {
  font-size: 13px;
}

.aut-hist-tot.ahorro strong {
  color: #c0392b;
}

@media (max-width: 600px) {
  .aut-hist-producto {
    flex-direction: column;
    gap: 6px;
  }

  .aut-hist-prod-precios {
    align-items: stretch;
    text-align: left;
  }

  .aut-hist-precio {
    justify-content: space-between;
  }

  .aut-hist-fecha {
    width: 100%;
    margin-left: 0;
  }
}

/* Resumen vacío en cards admin (sin autorizaciones) */
.aut-hist-count.empty {
  background: #e8f5ea;
  color: #14591f;
}

.aut-hist-empty-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
}

.aut-hist-empty-icon {
  width: 32px;
  height: 32px;
  background: #e8f5ea;
  color: #15803d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.aut-hist-empty-text {
  flex: 1;
  min-width: 0;
}

.aut-hist-empty-text strong {
  display: block;
  font-family: 'IBM Plex Serif', serif;
  font-size: 13px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 2px;
}

.aut-hist-empty-text small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

/* Botón "Cotización Nuevo Precio" (verde, destacado) */
.status-btn.nuevo-precio {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff !important;
  border-color: #16a34a;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
  position: relative;
}

.status-btn.nuevo-precio:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  border-color: #15803d;
  box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
  transform: translateY(-1px);
}

/* Etiqueta tipo "ajuste" para totales de aumento */
.aut-hist-tot.aumento strong {
  color: #2563eb;
}

/* ===========================================================
   CENTRO DE NOTIFICACIONES (estilo Facebook)
   =========================================================== */

/* Widget flotante (desktop) - oculto en mobile porque ahí ya está dentro del header */
.notif-widget {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 9990;
}

@media (max-width: 768px) {
  /* Ocultar SOLO la campana flotante en mobile - dropdown permanece visible */
  .notif-widget .notif-bell {
    display: none;
  }
}

/* CAMPANA INTEGRADA EN MOBILE-HEADER */
.mobile-header-bell {
  position: relative;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.15s;
  margin-right: 8px;
  flex-shrink: 0;
  padding: 0;
}

.mobile-header-bell:hover,
.mobile-header-bell:active {
  background: rgba(255, 255, 255, 0.22);
}

.mobile-header-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #c0392b;
  color: #fff;
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0b2545;
  animation: notifBadgePulse 2s ease-in-out infinite;
}

/* CAMPANA EN HEADER DE CUENTAS */
.cxc-bell {
  position: relative;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.15s;
  margin-right: 8px;
  flex-shrink: 0;
  padding: 0;
}

.cxc-bell:hover {
  background: rgba(255, 255, 255, 0.22);
}

.cxc-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: #c0392b;
  color: #fff;
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0b2545;
  animation: notifBadgePulse 2s ease-in-out infinite;
}

/* CAMPANA */
.notif-bell {
  position: relative;
  width: 42px;
  height: 42px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b2545;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(11, 25, 41, 0.06);
}

.notif-bell:hover {
  background: #f7f8fa;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(11, 25, 41, 0.12);
}

.notif-bell-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  background: #c0392b;
  color: #fff;
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(192, 57, 43, 0.4);
  animation: notifBadgePulse 2s ease-in-out infinite;
}

@keyframes notifBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* DROPDOWN */
.notif-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(11, 25, 41, 0.18);
  border: 1px solid #e4e7ec;
  display: none;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}

.notif-dropdown.open {
  display: flex;
  animation: notifDropdownIn 0.2s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.notif-dropdown-header {
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fafbfc;
}

.notif-dropdown-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 17px;
  font-weight: 700;
  color: #0b2545;
}

.notif-marcar-todas {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid #e4e7ec;
  padding: 5px 10px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  color: #6c757d;
  transition: all 0.15s;
}

.notif-marcar-todas:hover {
  background: #f0f2f5;
  color: #0b2545;
  border-color: #c0c8d0;
}

.notif-dropdown-body {
  flex: 1;
  overflow-y: auto;
  max-height: 50vh;
}

/* ITEM */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
  align-items: flex-start;
}

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

.notif-item:hover {
  background: #f7f8fa;
}

.notif-item.no-leida {
  background: #eff6ff;
}

.notif-item.no-leida:hover {
  background: #dbeafe;
}

.notif-item-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item.no-leida .notif-item-icon {
  background: #fff;
  border-color: #2563eb;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 13px;
  font-weight: 700;
  color: #0b1929;
  line-height: 1.3;
  margin-bottom: 2px;
}

.notif-item-message {
  font-size: 12px;
  color: #4a5568;
  line-height: 1.4;
  margin-bottom: 4px;
  word-break: break-word;
}

.notif-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
}

.notif-item-generador {
  background: #f0f2f5;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.3px;
}

.notif-item-tiempo {
  margin-left: auto;
}

.notif-item-dot {
  width: 8px;
  height: 8px;
  background: #2563eb;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 14px;
}

.notif-item-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e4e7ec;
  border-radius: 50%;
  cursor: pointer;
  font-size: 10px;
  color: #6c757d;
  opacity: 0;
  transition: opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-item:hover .notif-item-delete {
  opacity: 1;
}

.notif-item-delete:hover {
  background: #fef2f2;
  color: #c0392b;
  border-color: #fecaca;
}

.notif-loading {
  padding: 30px 20px;
  text-align: center;
  color: #6c757d;
  font-size: 13px;
}

.notif-empty {
  padding: 30px 20px;
  text-align: center;
}

.notif-empty-icon {
  font-size: 38px;
  margin-bottom: 8px;
  opacity: 0.4;
}

.notif-empty-text {
  font-family: 'IBM Plex Serif', serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b2545;
  margin-bottom: 4px;
}

.notif-empty-sub {
  font-size: 11px;
  color: #6c757d;
}

.notif-dropdown-footer {
  padding: 10px 16px;
  border-top: 1px solid #eef0f3;
  background: #fafbfc;
}

.notif-ver-todas {
  width: 100%;
  background: transparent;
  border: none;
  padding: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.notif-ver-todas:hover {
  background: #eff6ff;
}

/* MODAL "VER TODAS" */
.notif-todas-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notif-todas-overlay.open {
  display: flex;
}

.notif-todas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.65);
  backdrop-filter: blur(4px);
}

.notif-todas-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: notifTodasIn 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.notif-todas-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: linear-gradient(135deg, #0b2545 0%, #14365b 100%);
  color: #fff;
}

.notif-todas-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.notif-todas-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 700;
}

.notif-todas-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-todas-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.notif-todas-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
  overflow-x: auto;
}

.notif-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: 100px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #6c757d;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-tab:hover {
  background: #f0f2f5;
}

.notif-tab.active {
  background: #0b2545;
  color: #fff;
  border-color: #0b2545;
}

.notif-tab-count {
  background: rgba(255, 255, 255, 0.2);
  color: inherit;
  padding: 1px 6px;
  border-radius: 100px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  font-weight: 700;
}

.notif-tab:not(.active) .notif-tab-count {
  background: #e4e7ec;
  color: #6c757d;
}

.notif-todas-body {
  flex: 1;
  overflow-y: auto;
  background: #fff;
}

.notif-grupo-titulo {
  padding: 12px 18px 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #6c757d;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
}

/* MOBILE: ajustar campana en móvil */
@media (max-width: 768px) {
  .notif-widget {
    top: 10px;
    right: 12px;
  }

  .notif-bell {
    width: 38px;
    height: 38px;
  }

  .notif-dropdown {
    position: fixed;
    top: 60px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }

  .notif-todas-card {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }

  .notif-todas-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .notif-todas-tabs {
    padding: 10px 12px;
  }

  .notif-tab {
    padding: 5px 10px;
    font-size: 11px;
  }
}

/* Ajustar para que la campana no tape menú hamburguesa */
@media (max-width: 768px) {
  .menu-toggle, .nav-toggle {
    margin-right: 60px;
  }
}

/* ===========================================================
   CARD AUTORIZACIÓN ADMIN v2 (más completo y explícito)
   =========================================================== */

.aut-admin-card.aut-card-v2 .aut-admin-card-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 16px 20px;
  background: #fafbfc;
  border-bottom: 1px solid #eef0f3;
}

.aut-admin-card.aut-card-v2 .aut-admin-card-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
  margin-top: 2px;
}

.aut-admin-card.aut-card-v2 .aut-admin-card-motivo {
  margin: 14px 20px;
  padding: 12px 14px;
  background: #fffbeb;
  border-left: 3px solid #b7791f;
  border-radius: 4px;
  font-style: italic;
  color: #855411;
  font-size: 13px;
}

/* DESGLOSE PRODUCTOS */
.aut-prod-detalle-wrap {
  margin: 14px 20px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  overflow: hidden;
}

.aut-prod-detalle-titulo {
  padding: 10px 14px;
  background: #0b2545;
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.aut-prod-detalle {
  padding: 14px;
  border-bottom: 1px solid #eef0f3;
}

.aut-prod-detalle:last-child {
  border-bottom: none;
}

.aut-prod-detalle-name {
  font-family: 'IBM Plex Serif', serif;
  font-size: 14px;
  font-weight: 700;
  color: #0b1929;
  margin-bottom: 4px;
}

.aut-prod-detalle-name small {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 400;
  color: #6c757d;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.aut-prod-detalle-cant {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: #4a5568;
  margin-bottom: 10px;
  padding: 4px 8px;
  background: #f7f8fa;
  border-radius: 4px;
  display: inline-block;
}

.aut-prod-detalle-precios {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.aut-prod-precio-row {
  display: grid;
  grid-template-columns: 130px 110px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}

.aut-prod-precio-row span:first-child {
  color: #6c757d;
  font-size: 12px;
}

.aut-prod-precio-row strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: #0b1929;
  font-weight: 600;
}

.aut-prod-precio-row small {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
  text-align: right;
}

.aut-prod-precio-row.destacado {
  background: #fff7e6;
}

.aut-prod-precio-row.destacado strong {
  color: #855411;
}

.aut-prod-precio-row.delta {
  background: #fdf0ef;
}

.aut-prod-precio-row.delta strong {
  color: #c0392b;
}

.aut-prod-precio-row.delta small {
  color: #c0392b;
}

.aut-prod-detalle-vacio {
  padding: 20px;
  text-align: center;
  color: #6c757d;
  font-size: 13px;
}

/* IMPACTO COTIZACIÓN COMPLETA */
.aut-impacto-cot {
  margin: 14px 20px 18px;
  border: 2px solid #0b2545;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.aut-impacto-titulo {
  padding: 10px 14px;
  background: linear-gradient(135deg, #0b2545 0%, #14365b 100%);
  color: #fff;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.aut-impacto-grid {
  padding: 14px;
}

.aut-impacto-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}

.aut-impacto-row span:first-child {
  color: #4a5568;
  font-weight: 500;
}

.aut-impacto-row strong {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  color: #0b1929;
  font-weight: 700;
}

.aut-impacto-row.destacado {
  background: #fff7e6;
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
  border-left: 3px solid #b7791f;
}

.aut-impacto-row.destacado strong {
  color: #855411;
}

.aut-impacto-row.ajuste {
  margin-top: 4px;
}

.aut-impacto-row.ajuste strong {
  color: #c0392b;
  font-size: 18px;
}

.aut-impacto-pct {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: #6c757d;
  background: #f7f8fa;
  padding: 2px 8px;
  border-radius: 100px;
}

.aut-impacto-divider {
  border-top: 1px dashed #e4e7ec;
  margin: 4px 0;
}

.aut-impacto-nota {
  padding: 8px 14px;
  background: #fafbfc;
  border-top: 1px solid #eef0f3;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: #6c757d;
  font-style: italic;
}

.aut-admin-card.aut-card-v2 .aut-admin-card-actions {
  padding: 14px 20px;
  background: #fafbfc;
  border-top: 1px solid #eef0f3;
}

.aut-btn-revisar {
  width: 100%;
  padding: 12px !important;
  font-size: 13px !important;
  letter-spacing: 1.5px !important;
}

/* MOBILE */
@media (max-width: 768px) {
  .aut-admin-card.aut-card-v2 .aut-admin-card-info {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .aut-prod-precio-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .aut-prod-precio-row small {
    text-align: left;
  }

  .aut-impacto-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .aut-impacto-row strong {
    font-size: 18px;
  }

  .aut-impacto-pct {
    justify-self: start;
  }
}

/* ===========================================================
   PREVISUALIZADOR DEL VENDEDOR · TOTALES MEJORADOS
   =========================================================== */

.aut-totals-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  color: #6c757d;
  text-transform: uppercase;
  margin-top: 12px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e4e7ec;
}

.aut-totals-section-title:first-child {
  margin-top: 0;
}

.aut-totals-divider {
  height: 1px;
  background: #e4e7ec;
  margin: 14px 0 4px;
}

.aut-totals-row.destacado-final {
  background: #fff7e6;
  margin: 4px -14px;
  padding: 8px 14px;
  border-left: 3px solid #b7791f;
  border-radius: 0;
}

.aut-totals-row.destacado-final strong {
  color: #855411;
  font-size: 17px;
}

.aut-totals-row.ajuste-final {
  margin-top: 4px;
}

.aut-totals-row.ajuste-final strong {
  color: #c0392b;
  font-size: 16px;
  font-weight: 700;
}

/* ===========================================================
   MODAL REVISIÓN ADMIN · TOTALES IGUALES AL VENDEDOR
   =========================================================== */

.aut-rev-tot-section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.3px;
  color: #6c757d;
  text-transform: uppercase;
  margin-top: 12px;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #e4e7ec;
}

.aut-rev-tot-section-title:first-child {
  margin-top: 0;
}

.aut-rev-tot-divider {
  height: 1px;
  background: #e4e7ec;
  margin: 14px 0 4px;
}

.aut-rev-tot-row.destacado-final {
  background: #fff7e6;
  margin: 4px -14px;
  padding: 8px 14px;
  border-left: 3px solid #b7791f;
  border-radius: 0;
}

.aut-rev-tot-row.destacado-final strong {
  color: #855411;
  font-size: 17px;
}

.aut-rev-tot-row.ajuste-final {
  margin-top: 4px;
}

.aut-rev-tot-row.ajuste-final strong {
  color: #c0392b;
  font-size: 16px;
  font-weight: 700;
}

/* ===========================================================
   MODAL ENVIAR POR EMAIL
   =========================================================== */

.status-btn.email-btn {
  background: #fff;
  color: #0b2545;
  border: 1px solid #0b2545;
}

.status-btn.email-btn:hover {
  background: #0b2545;
  color: #fff;
}

.email-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.email-modal-overlay.active {
  display: flex;
}

.email-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 25, 41, 0.65);
  backdrop-filter: blur(4px);
}

.email-modal-card {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: emailModalIn 0.25s cubic-bezier(0.34, 1.3, 0.64, 1);
}

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

.email-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: linear-gradient(135deg, #0b2545 0%, #14365b 100%);
  color: #fff;
}

.email-modal-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.8px;
  opacity: 0.85;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.email-modal-title {
  font-family: 'IBM Plex Serif', serif;
  font-size: 20px;
  font-weight: 700;
}

.email-modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.email-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.email-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.email-info {
  background: #f7f8fa;
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.email-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.email-info-row span {
  color: #6c757d;
}

.email-info-row strong {
  color: #0b2545;
}

.email-field {
  margin-bottom: 18px;
}

.email-field label:not(.email-checkbox) {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #4a5568;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.email-field input[type="text"],
.email-field input[type="email"],
.email-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #d4d8de;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #0b1929;
}

.email-field input:focus,
.email-field textarea:focus {
  outline: none;
  border-color: #0b2545;
  box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.08);
}

.email-field small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #6c757d;
}

.email-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #fafbfc;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 6px;
  font-size: 13px;
}

.email-checkbox:hover {
  background: #f0f2f5;
  border-color: #0b2545;
}

.email-checkbox input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}

.email-checkbox span {
  flex: 1;
  color: #0b1929;
}

.email-checkbox span small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #6c757d;
}

.email-fichas-list {
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  background: #fafbfc;
}

.email-link-info {
  background: #e0f2fe;
  border-left: 3px solid #075985;
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 12px;
  color: #075985;
  margin-bottom: 18px;
  line-height: 1.5;
}

.email-link-info code {
  display: inline-block;
  margin-top: 4px;
  word-break: break-all;
}

.email-loading {
  padding: 40px 20px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
}

.email-error {
  padding: 20px;
  background: #fdf0ef;
  border-left: 3px solid #c0392b;
  color: #8b2820;
  font-size: 13px;
  border-radius: 4px;
}

.email-modal-footer {
  padding: 16px 24px;
  background: #fafbfc;
  border-top: 1px solid #eef0f3;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.email-modal-footer .btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.email-modal-footer .btn-cancel {
  background: #fff;
  color: #6c757d;
  border: 1px solid #d4d8de;
}

.email-modal-footer .btn-cancel:hover {
  background: #f0f2f5;
}

.email-modal-footer .btn-primary {
  background: #0b2545;
  color: #fff;
}

.email-modal-footer .btn-primary:hover:not(:disabled) {
  background: #14365b;
}

.email-modal-footer .btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .email-modal-card {
    max-width: 100%;
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }

  .email-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .email-modal-footer {
    flex-direction: column-reverse;
  }

  .email-modal-footer .btn {
    width: 100%;
  }
}

/* ===========================================================
   TOAST DE EMAIL (snackbar)
   =========================================================== */
.email-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0b2545;
  color: #fff;
  padding: 14px 22px;
  border-radius: 100px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  z-index: 99999;
  transition: transform 0.3s cubic-bezier(0.34, 1.3, 0.64, 1);
  max-width: 90vw;
  text-align: center;
}

.email-toast.show {
  transform: translateX(-50%) translateY(0);
}

.email-toast-success {
  background: #1e7e34;
}

.email-toast-error {
  background: #c0392b;
}

.email-toast-info {
  background: #0b2545;
}

@media (max-width: 768px) {
  .email-toast {
    bottom: 80px;
    font-size: 13px;
    padding: 12px 18px;
  }
}

/* ===========================================================
   MÓDULO FLETES
   =========================================================== */
.fletes-tabs {
  display: flex;
  gap: 0;
  margin: 24px 0 0;
  border-bottom: 2px solid var(--border);
}

.fletes-tab {
  background: transparent;
  border: none;
  padding: 14px 24px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.fletes-tab:hover {
  color: var(--navy);
}

.fletes-tab.active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}

.fletes-info {
  margin: 16px 0 12px;
}

.info-pill {
  display: inline-block;
  background: #e0f2fe;
  color: #075985;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}

/* ===========================================================
   FLETE EN COTIZADOR
   =========================================================== */
.flete-section {
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

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

@media (max-width: 768px) {
  .flete-options { grid-template-columns: 1fr; }
}

.flete-radio {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.flete-radio input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  transform: scale(1.2);
  cursor: pointer;
}

.flete-radio span {
  font-weight: 600;
  font-size: 13px;
  color: var(--navy);
  padding-right: 30px;
}

.flete-radio small {
  color: var(--text-dim);
  font-size: 11px;
}

.flete-radio:hover {
  border-color: var(--navy);
  background: #f0f4f9;
}

.flete-radio:has(input:checked) {
  border-color: var(--navy);
  background: rgba(11, 37, 69, 0.05);
  box-shadow: 0 0 0 2px rgba(11, 37, 69, 0.1);
}

.flete-precio-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 12px;
}

.flete-precio-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.flete-precio-info span {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}
