/* ============================================================
   HOGAR EXPRESS ERP — Hoja de Estilos Principal
   Diseño: Clean & Professional
   Versión: 2.0 — Paleta unificada, modo oscuro profesional
   ============================================================ */

/* ============================================================
   TOKENS DE DISEÑO — MODO CLARO
   ============================================================ */
:root {
  /* ── Color de marca principal: verde esmeralda ── */
  --primary:        #2e9e60;
  --primary-light:  #3dbb74;
  --primary-dark:   #1e7045;
  --primary-rgb:    46, 158, 96;

  /* ── Acento: ámbar cálido ── */
  --accent:         #f59e0b;
  --accent-dark:    #d97706;

  /* ── Semánticos ── */
  --danger:         #ef4444;
  --danger-light:   #fee2e2;
  --warning:        #f97316;
  --warning-light:  #ffedd5;
  --success:        #22c55e;
  --success-light:  #dcfce7;
  --info:           #3b82f6;
  --info-light:     #dbeafe;

  /* ── Superficies ── */
  --bg-body:        #f4f6f8;
  --bg-card:        #ffffff;
  --bg-sidebar:     #1e2a23;
  --bg-topbar:      #ffffff;
  --bg-elevated:    #ffffff;
  --bg-subtle:      #f0f2f4;

  /* ── Texto ── */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --text-disabled:  #cbd5e1;
  --text-sidebar:   rgba(255, 255, 255, 0.75);
  --text-on-primary:#ffffff;

  /* ── Bordes ── */
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  /* ── Sombras ── */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.12), 0 4px 14px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.16), 0 8px 24px rgba(0,0,0,0.08);

  /* ── Geometría ── */
  --border-radius:   12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --sidebar-width:   260px;
  --topbar-height:   64px;
  --transition:      all 0.18s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   TOKENS DE DISEÑO — MODO OSCURO
   Paleta: slate oscuro neutro, no verde ni colores extraños
   ============================================================ */
[data-theme="dark"] {
  --primary:        #34d372;
  --primary-light:  #4ade80;
  --primary-dark:   #22a356;
  --primary-rgb:    52, 211, 114;

  --accent:         #fbbf24;
  --accent-dark:    #f59e0b;

  --danger:         #f87171;
  --danger-light:   rgba(248,113,113,0.12);
  --warning:        #fb923c;
  --warning-light:  rgba(251,146,60,0.12);
  --success:        #4ade80;
  --success-light:  rgba(74,222,128,0.12);
  --info:           #60a5fa;
  --info-light:     rgba(96,165,250,0.12);

  /* ── Superficies: escala slate oscuro ── */
  --bg-body:        #0f1117;
  --bg-card:        #1a1d24;
  --bg-sidebar:     #111318;
  --bg-topbar:      #1a1d24;
  --bg-elevated:    #22262f;
  --bg-subtle:      #22262f;

  /* ── Texto: legible, sin neón ── */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #64748b;
  --text-disabled:  #334155;
  --text-sidebar:   rgba(255, 255, 255, 0.65);
  --text-on-primary:#0f1117;

  /* ── Bordes: visibles pero sutiles ── */
  --border:         #2a2f3a;
  --border-strong:  #374151;

  /* ── Sombras: más profundas en dark ── */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 10px 40px rgba(0,0,0,0.6);
  --shadow-xl:  0 20px 60px rgba(0,0,0,0.7);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Transición suave al cambiar tema — solo propiedades necesarias */
*, *::before, *::after {
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.18s ease;
}

/* Excluir de transición lo que no debe animar */
.erp-sidebar, .erp-main, .nav-link-item, .btn, .form-control, .form-select,
.stat-card, .producto-card, .modal, .modal-backdrop {
  transition: var(--transition);
}

/* Scrollbar personalizada */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */
.erp-body {
  display: flex;
  min-height: 100vh;
}

.erp-sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 1000;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1), transform 0.22s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 4px 0 32px rgba(0,0,0,0.22);
}

.erp-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.22s cubic-bezier(0.4,0,0.2,1);
}

/* Sidebar colapsado — aplicado desde <head> antes del paint */
[data-sidebar="collapsed"] .erp-sidebar { width: 68px; }
[data-sidebar="collapsed"] .erp-main    { margin-left: 68px; }
/* POR */
[data-sidebar="collapsed"] .nav-label,
[data-sidebar="collapsed"] .brand-text,
[data-sidebar="collapsed"] .nav-section-label,
[data-sidebar="collapsed"] .user-details,
[data-sidebar="collapsed"] .brand-sub { display: none; }

/* ============================================================
   SIDEBAR — BRAND
   ============================================================ */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.brand-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.brand-name {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 0.68rem;
  color: var(--text-sidebar);
  font-weight: 400;
  opacity: 0.7;
}

/* ============================================================
   SIDEBAR — NAV
   ============================================================ */
.sidebar-nav {
  flex: 1;
  padding: 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.nav-section-label {
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  padding: 14px 10px 5px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 0.855rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 1px;
  position: relative;
}

.nav-link-item i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }

.nav-link-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
  transform: translateX(2px);
}

.nav-link-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px rgba(var(--primary-rgb), 0.4);
}

/* ============================================================
   SIDEBAR — FOOTER / USUARIO
   ============================================================ */
.sidebar-footer {
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

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

.user-avatar-img {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--primary-rgb), 0.5);
  flex-shrink: 0;
}

.user-details { flex: 1; min-width: 0; }

.user-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.6rem;
  padding: 1px 7px;
  background: rgba(255,255,255,0.12);
  color: var(--primary-light);
  border-radius: 20px;
  font-weight: 600;
}

.btn-logout {
  color: rgba(255,255,255,0.35);
  font-size: 1.1rem;
  text-decoration: none;
  transition: var(--transition);
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ============================================================
   TOPBAR
   ============================================================ */
.erp-topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.topbar-left  { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.35rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg-subtle); color: var(--primary); }

.breadcrumb       { font-size: 0.8rem; margin: 0; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

.sucursal-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.topbar-btn {
  background: none;
  border: none;
  font-size: 1.15rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  line-height: 1;
  flex-shrink: 0;
}
.topbar-btn:hover { background: var(--bg-subtle); color: var(--primary); }

.notif-badge {
  position: absolute;
  top: 3px; right: 3px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 15px; height: 15px;
  font-size: 0.58rem;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* Panel de notificaciones */
.notif-panel {
  width: 320px;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: var(--border-radius-lg) !important;
  overflow: hidden;
  background: var(--bg-card) !important;
}

.notif-header {
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.855rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-primary);
}

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.835rem;
}
.notif-empty i { font-size: 2rem; display: block; margin-bottom: 8px; opacity: 0.4; }

/* Estado del sistema */
.system-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 0.7rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--text-muted);
}

.status-dot {
  font-size: 0.45rem;
  color: var(--text-disabled);
  transition: color 0.4s ease;
}
.status-dot.ok    { color: var(--success); }
.status-dot.error { color: var(--danger); }

/* Botón con texto (soporte) */
.topbar-btn-label {
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 4px;
}

/* Variante WhatsApp */
.topbar-btn--whatsapp {
    color: #25d366;
    text-decoration: none;
}
.topbar-btn--whatsapp:hover {
    color: #1da851;
    background: rgba(37, 211, 102, 0.08);
}

/* Variante danger (logout) */
.topbar-btn--danger {
    color: var(--danger);
}
.topbar-btn--danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
}

/* Botón marcar todas leídas */
.btn-marcar-todas {
    background: none;
    border: none;
    font-size: 0.72rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}
.btn-marcar-todas:hover { color: var(--primary); }
/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.erp-content {
  flex: 1;
  padding: 24px;
}

.erp-footer {
  padding: 11px 24px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  background: var(--bg-topbar);
  flex-shrink: 0;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container { padding: 16px 24px 0; }
.flash-msg { border-radius: var(--border-radius-sm); font-size: 0.855rem; }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  background:  #5c7c83;      /*Cambiar coor de header de caja*/
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.875rem;
  color: white;
}

.card-body { padding: 20px; }

/* ── Stat Cards ── */
.stat-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--stat-color, var(--primary));
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: rgba(var(--stat-rgb, 46,158,96), 0.1);
  color: var(--stat-color, var(--primary));
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.stat-change {
  font-size: 0.73rem;
  font-weight: 600;
  margin-top: 4px;
}

a.stat-card, a.stat-card:hover { color: inherit; }

/* ============================================================
   TABLAS
   ============================================================ */
.table-responsive { border-radius: var(--border-radius); overflow: hidden; }

.table {
  font-size: 0.855rem;
  margin-bottom: 0;
  color: var(--text-primary);
}

.table thead th {
  background: #5c7c83;
  color: white;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table tbody td {
  padding: 11px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: rgba(var(--primary-rgb), 0.04); }

/* Tablas responsivas tipo card en móvil */
@media (max-width: 576px) {
  .table-card-mobile thead { display: none; }
  .table-card-mobile tbody tr {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
    padding: 4px 0;
    box-shadow: var(--shadow-sm);
  }
  .table-card-mobile tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
  }
  .table-card-mobile tbody td:last-child { border-bottom: none; }
  .table-card-mobile tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-right: 10px;
  }
}

/* ============================================================
   BADGES
   ============================================================ */
.badge-stock-ok   { background: var(--success-light); color: var(--success); }
.badge-stock-low  { background: var(--warning-light); color: var(--warning); }
.badge-stock-zero { background: var(--danger-light);  color: var(--danger); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
  font-weight: 600;
  font-size: 0.855rem;
  border-radius: 9px;
  padding: 7px 16px;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: #fff;
}
.btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.25);
}

.btn-success { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-warning { background: var(--accent); border-color: var(--accent); color: #1a202c; }
.btn-warning:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #1a202c; }

.btn-icon {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.92rem;
}

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.form-control, .form-select {
  border-radius: 9px;
  border: 1px solid var(--border);
  font-size: 1rem;
  padding: 8px 12px;
  color: var(--text-primary);
  background: var(--bg-card);
  transition: var(--transition);
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.14);
  background: var(--bg-card);
  color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }

.input-group-text {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
}

/* ── Dark: formularios ── */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select         { background: var(--bg-elevated); border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus   { background: var(--bg-elevated); border-color: var(--primary); }
[data-theme="dark"] .form-control::placeholder { color: var(--text-muted); }
[data-theme="dark"] .input-group-text    { background: var(--bg-subtle); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] select option        { background: var(--bg-elevated); color: var(--text-primary); }

/* ============================================================
   MODALES
   ============================================================ */
.modal-content {
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title  { font-weight: 800; font-size: 0.975rem; }
.modal-body   { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); }

[data-theme="dark"] .modal-content { background: var(--bg-card); }
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer  { border-color: var(--border); }

/* ============================================================
   DROPDOWNS
   ============================================================ */
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--border-radius);
  padding: 6px;
}

.dropdown-item {
  color: var(--text-primary);
  border-radius: var(--border-radius-sm);
  font-size: 0.855rem;
  padding: 7px 12px;
}
.dropdown-item:hover { background: var(--bg-subtle); color: var(--text-primary); }

[data-theme="dark"] .dropdown-menu    { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .dropdown-item    { color: var(--text-primary); }
[data-theme="dark"] .dropdown-item:hover { background: var(--bg-elevated); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-input-group { position: relative; }

.search-input-group .bi-search {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.search-input-group .form-control { padding-left: 34px; }

/* ============================================================
   STOCK ALERT BANNER
   ============================================================ */
.stock-alert-banner {
  background: var(--warning-light);
  border: 1px solid rgba(249,115,22,0.3);
  border-left: 4px solid var(--warning);
  border-radius: var(--border-radius-sm);
  padding: 11px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.835rem;
}

/* ============================================================
   POS — NUEVA VENTA
   ============================================================ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 18px;
  height: calc(100vh - var(--topbar-height) - 80px);
  overflow: hidden;
}

.pos-productos {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pos-carrito {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow-sm);
}

.pos-search { margin-bottom: 14px; }

.producto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 2px 4px 4px 2px;
}

.producto-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 13px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  max-height: 200px;
}

.producto-card:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.04);
  box-shadow: var(--shadow-sm);
}

.producto-card.sin-stock { opacity: 0.45; cursor: not-allowed; }

.producto-card .nombre {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.producto-card .precio {
  font-size: 0.975rem;
  font-weight: 800;
  color: var(--primary);
}

.producto-card .stock-info {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.producto-card .cat-badge {
  display: inline-block;
  font-size: 0.63rem;
  padding: 2px 7px;
  border-radius: 20px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  margin-bottom: 5px;
  font-weight: 700;
}

/* ── Carrito ── */
.carrito-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.carrito-items {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  min-height: 60px;
  max-height: 220px;
}

.carrito-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  margin-bottom: 5px;
  font-size: 0.75rem;
  background: var(--bg-subtle);
}

.carrito-item-nombre { flex: 1; font-weight: 600; color: var(--text-primary); }

.carrito-item-qty { display: flex; align-items: center; gap: 4px; }

.qty-btn {
  width: 24px; height: 24px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  color: var(--text-primary);
}
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.qty-value {
    font-weight: 700;
    width: 38px;
    text-align: center;
    color: var(--text-primary);
    font-size: .8rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    padding: 0 2px;
    outline: none;
    font-family: inherit;
    cursor: text;
    -moz-appearance: textfield;
}
.qty-value:focus {
    border-color: var(--primary);
    background: var(--bg-card);
}
.qty-value::-webkit-outer-spin-button,
.qty-value::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

.carrito-resumen {
  padding: 13px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.resumen-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 3px 0;
  color: var(--text-secondary);
}

.resumen-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  padding: 10px 0 11px;
  border-top: 1px solid var(--border);
  margin-top: 7px;
}

.carrito-vacio {
  text-align: center;
  padding: 18px 16px;
  color: var(--text-muted);
}
.carrito-vacio i { font-size: 2.5rem; display: block; margin-bottom: 8px; opacity: 0.25; }

/* Botón flotante carrito — solo móvil */
.pos-fab {
  display: none;
  position: fixed;
  bottom: 22px; right: 22px;
  z-index: 1050;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.35rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(var(--primary-rgb), 0.45);
  transition: var(--transition);
}
.pos-fab:hover { background: var(--primary-light); transform: scale(1.06); }

.pos-fab-badge {
  position: absolute;
  top: 5px; right: 5px;
  background: var(--danger);
  color: #fff;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── Dark: POS ── */
[data-theme="dark"] .carrito-item      { background: var(--bg-elevated); border-color: var(--border); }
[data-theme="dark"] .carrito-resumen   { background: var(--bg-body); }
[data-theme="dark"] .pos-carrito .bg-light { background: var(--bg-body) !important; }

/* ============================================================
   CHARTS / REPORTES
   ============================================================ */
.chart-container { position: relative; height: 280px; }

/* ============================================================
   AUTH — LOGIN
   ============================================================ */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(145deg, #0a1628 0%, #1a3a2a 45%, #0d2016 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-body::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.06);
  top: -180px; right: -120px;
  pointer-events: none;
}

.auth-body::after {
  content: '';
  position: absolute;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: rgba(var(--primary-rgb), 0.04);
  bottom: -120px; left: -80px;
  pointer-events: none;
}

.auth-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 42px;
  width: 100%;
  max-width: 430px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.32);
  position: relative;
  z-index: 10;
}

.auth-logo { text-align: center; margin-bottom: 26px; }

.auth-logo .logo-icon {
  width: 62px; height: 62px;
  border-radius: 16px;
  background: orange;
  color: #fff;
  font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(250, 135, 52, 0.32);          /*Este es el color de sombra del logo de login*/
}

.auth-logo h1 { font-size: 1.35rem; font-weight: 800; color: #0f172a; }
.auth-logo p  { font-size: 0.8rem; color: #64748b; }

/* ============================================================
   UPLOAD DE IMAGEN
   ============================================================ */
.img-upload-wrapper { position: relative; display: inline-block; }

.img-upload-preview {
  width: 110px; height: 110px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.img-upload-preview:hover { border-color: var(--primary); }

.img-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

.img-upload-preview .img-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  gap: 4px;
  width: 100%; height: 100%;
}
.img-upload-preview .img-placeholder i { font-size: 1.8rem; opacity: 0.35; }

.img-upload-btn {
  position: absolute;
  bottom: -6px; right: -6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--bg-card);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.img-upload-btn:hover { background: var(--primary-light); transform: scale(1.1); }
.img-upload-input { display: none; }

/* Imágenes en tabla */
.avatar-lg {
  width: 78px; height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.product-thumb {
  width: 42px; height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.product-thumb-placeholder {
  width: 42px; height: 42px;
  border-radius: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-primary-erp { color: var(--primary) !important; }
.bg-primary-erp   { background: var(--primary) !important; }
.text-accent      { color: var(--accent) !important; }

/* Campo de dinero (abrir caja) */
.campoDinero { font-size: 30px; font-weight: 700; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--border) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.6s infinite;
  border-radius: 6px;
}

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

/* Sidebar overlay mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* Notificación — shake */
@keyframes notif-shake {
  0%,100% { transform: rotate(0deg); }
  25%      { transform: rotate(-15deg); }
  75%      { transform: rotate(15deg); }
}
.notif-shake { animation: notif-shake 0.4s ease 2; }

/* Pulse en tiempo real */
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ============================================================
   DARK MODE — OVERRIDES ADICIONALES
   Componentes Bootstrap que no respetan variables CSS
   ============================================================ */
[data-theme="dark"] .card               { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .card-header        { background: transparent; border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .stat-card          { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .producto-card      { background: var(--bg-card); border-color: var(--border); }
[data-theme="dark"] .producto-card:hover { border-color: var(--primary); background: rgba(var(--primary-rgb), 0.06); }

[data-theme="dark"] .table thead th     { background: var(--bg-elevated); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .table tbody td     { color: var(--text-primary); border-color: var(--border); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(var(--primary-rgb), 0.05); }
[data-theme="dark"] .table-light,
[data-theme="dark"] .table-light td,
[data-theme="dark"] .table-light th     { background: var(--bg-elevated) !important; color: var(--text-primary); }
[data-theme="dark"] .bg-light           { background: var(--bg-elevated) !important; }
[data-theme="dark"] .text-dark          { color: var(--text-primary) !important; }

[data-theme="dark"] .erp-topbar         { background: var(--bg-topbar); border-color: var(--border); }
[data-theme="dark"] .erp-footer         { background: var(--bg-topbar); border-color: var(--border); color: var(--text-muted); }
[data-theme="dark"] .sidebar-brand      { border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .sidebar-footer     { border-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .topbar-btn         { color: var(--text-secondary); }
[data-theme="dark"] .topbar-btn:hover   { background: var(--bg-elevated); color: var(--primary); }
[data-theme="dark"] .sidebar-toggle:hover { background: var(--bg-elevated); }
[data-theme="dark"] .sucursal-badge     { background: rgba(var(--primary-rgb), 0.12); color: var(--primary); }
[data-theme="dark"] .system-status      { background: var(--bg-elevated); border-color: var(--border); }

[data-theme="dark"] .notif-panel        { background: var(--bg-card) !important; border-color: var(--border) !important; }
[data-theme="dark"] .notif-header       { background: var(--bg-elevated); border-color: var(--border); color: var(--text-primary); }

[data-theme="dark"] .qty-btn            { background: var(--bg-elevated); border-color: var(--border); color: var(--text-primary); }
[data-theme="dark"] .btn-outline-secondary { border-color: var(--border); color: var(--text-secondary); }
[data-theme="dark"] .btn-outline-secondary:hover { background: var(--bg-elevated); color: var(--text-primary); }

[data-theme="dark"] .alert              { border-color: var(--border); }
[data-theme="dark"] .badge.bg-light     { background: var(--bg-elevated) !important; color: var(--text-primary) !important; }
[data-theme="dark"] .breadcrumb-item    { color: var(--text-muted); }
[data-theme="dark"] .breadcrumb-item a  { color: var(--primary); }
[data-theme="dark"] .breadcrumb-item.active { color: var(--text-muted); }

[data-theme="dark"] .stock-alert-banner { background: rgba(249,115,22,0.1); border-color: rgba(249,115,22,0.25); }

/* ============================================================
   RESPONSIVE — BREAKPOINTS COMPLETOS
   ============================================================ */

/* ── 1280px+ : pantallas grandes ── */
@media (min-width: 1280px) {
  .pos-layout { grid-template-columns: 1fr 400px; }
}

/* ── < 992px : tablets y móviles ── */
@media (max-width: 992px) {
  .erp-sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .erp-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,0.28);
  }
  .erp-main { margin-left: 0 !important; }

  .erp-sidebar.collapsed {
    width: var(--sidebar-width) !important;
    transform: translateX(-100%);
  }
  .erp-sidebar.collapsed.open {
    transform: translateX(0);
  }

  /* POS móvil */
  .pos-layout { grid-template-columns: 1fr; height: auto; overflow: visible; gap: 0; }
  .pos-productos { overflow: visible; }
  .pos-carrito { display: none; border-radius: 0; border-left: none; border-right: none; max-height: none; }
  .pos-carrito.mobile-visible { display: flex; }
  .pos-productos.mobile-oculto { display: none; }
  .producto-grid { max-height: 55vh; overflow-y: auto; }
  .pos-fab { display: flex; }
}

/* ── < 768px : móviles medianos ── */
@media (max-width: 768px) {
  .erp-content { padding: 14px; }
  .auth-card { padding: 28px 22px; margin: 12px; }
  .producto-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); }
  .page-title { font-size: 1.2rem; }
  .stat-value { font-size: 1.35rem; }

  /* Topbar: ocultar elementos secundarios */
  .system-status { display: none; }
  .sucursal-badge { display: none; }
  .breadcrumb    { display: none; }

  /* Tablas: reducir padding */
  .table thead th, .table tbody td { padding: 8px 10px; }

  .notif-panel { width: calc(100vw - 24px); }
}

/* ── < 480px : móviles pequeños ── */
@media (max-width: 480px) {
  .erp-content { padding: 10px; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn { width: 100%; justify-content: center; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.2rem; }
  .auth-card { padding: 24px 18px; margin: 10px; border-radius: 16px; }
  .producto-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .campoDinero { font-size: 24px; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .erp-sidebar, .erp-topbar, .erp-footer, .no-print { display: none !important; }
  .erp-main { margin-left: 0 !important; }
  .erp-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================
   UTILIDADES — Clases para reemplazar estilos inline
   Generadas a partir de patrones repetidos en las vistas
   ============================================================ */

/* ── Tipografía ── */
.text-xxs   { font-size: .65rem; }
.text-xs    { font-size: .72rem; }
.text-xs2   { font-size: .73rem; }
.text-sm    { font-size: .82rem; }
.text-sm2   { font-size: .88rem; line-height: 1.75; }
.text-base  { font-size: 1rem; }
.text-lg    { font-size: 1.2rem; }
.text-xl    { font-size: 1.3rem; }
.text-2xl   { font-size: 2rem; }
.text-3xl   { font-size: 2.5rem; }

.text-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.text-hint {
  font-size: .65rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.text-primary-color { color: var(--primary); }
.text-muted-sm      { font-size: .8rem; color: var(--text-muted); }

/* ── Avatares e imágenes de producto ── */
/* Redondo (usuarios, clientes) */
.avatar-xs {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.avatar-sm {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.avatar-md {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-lg {
  width: 90px; height: 90px;
  border-radius: 50%;
  object-fit: cover;
}

/* Iniciales (cuando no hay foto) */
.avatar-initials-sm {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .95rem;
  flex-shrink: 0;
}
.avatar-initials-xs {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .9rem;
  flex-shrink: 0;
}

/* Cuadrado (productos) */
.img-product-sm {
  width: 38px; height: 38px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.img-product-md {
  width: 48px; height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 6px;
}
.img-product-lg {
  width: 65px; height: 65px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Placeholder cuando no hay imagen */
.img-placeholder-sm {
  width: 38px; height: 38px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
  opacity: .4;
}
.img-placeholder-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(229,62,62,.1);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}

/* Icono contenedor cuadrado (sidebar, cards) */
.icon-box-sm {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: rgba(26,107,92,.1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Badges de estado ── */
/* Uso: <span class="status-badge status-success">Activo</span> */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 700;
}
.status-success {
  background: rgba(39,103,73,.1);
  color: #276749;
}
.status-danger {
  background: rgba(229,62,62,.1);
  color: #e53e3e;
}
.status-warning {
  background: rgba(240,165,0,.1);
  color: #f0a500;
}
.status-info {
  background: rgba(43,108,176,.1);
  color: #2b6cb0;
}
.status-orange {
  background: rgba(221,107,32,.1);
  color: #dd6b20;
}
.status-primary {
  background: rgba(26,107,92,.1);
  color: var(--primary);
}

/* Badge mini (etiquetas dentro de texto) */
.badge-mini {
  font-size: .6rem;
  background: rgba(26,107,92,.13);
  color: var(--primary);
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 700;
  margin-left: 2px;
}
.badge-muted {
  font-size: .7rem;
  background: var(--bg-body);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

/* ── Iconos decorativos vacíos (empty states) ── */
.empty-icon {
  font-size: 2rem;
  opacity: .2;
  display: block;
  margin-bottom: 8px;
}
.empty-icon-lg {
  font-size: 2.5rem;
  opacity: .2;
}

/* ── Contenedores de fondo ── */
.bg-body-fill    { background: var(--bg-body); }
.bg-card-fill    { background: var(--bg-card); }
.bg-primary-soft { background: rgba(26,107,92,.07); border-radius: 8px; padding: 6px 8px; margin-bottom: 4px; }

/* ── Scroll contenedor ── */
.scroll-y-320 { max-height: 320px; overflow-y: auto; }

/* ── Layouts frecuentes ── */
.max-w-360 { max-width: 360px; }
.col-110   { width: 110px; }
.hidden    { display: none; }

/* ── Stat card con color variable ── */
/* Uso: <div class="stat-colored" style="--stat-color:#276749"> */
.stat-colored { border-left: 3px solid var(--stat-color, var(--primary)); }

/* ── Dark mode para las nuevas utilidades ── */
[data-theme="dark"] .status-success  { background: rgba(39,103,73,.2);  color: #68d391; }
[data-theme="dark"] .status-danger   { background: rgba(229,62,62,.2);  color: #fc8181; }
[data-theme="dark"] .status-warning  { background: rgba(240,165,0,.2);  color: #f6c90e; }
[data-theme="dark"] .status-info     { background: rgba(43,108,176,.2); color: #90cdf4; }
[data-theme="dark"] .status-orange   { background: rgba(221,107,32,.2); color: #fbd38d; }
[data-theme="dark"] .status-primary  { background: rgba(52,211,114,.15); color: var(--primary); }
[data-theme="dark"] .badge-muted     { background: var(--bg-elevated); }
[data-theme="dark"] .img-placeholder-sm { background: var(--bg-elevated); }
[data-theme="dark"] .icon-box-sm     { background: rgba(52,211,114,.1); }

/* Desde aqui se hizo una implementacion recien */
/* ── Venta Fácil — tarjetas de producto ── */
.vf-prod-card {
    box-shadow: 0 2px 8px rgba(0,0,0,.09), 0 1px 3px rgba(0,0,0,.06) !important;
    border: 1.5px solid var(--border-strong) !important;
}

.vf-prod-placeholder {
    background: linear-gradient(135deg, #dbeafe 0%, #ede9fe 100%) !important;
    border: 1px dashed #93c5fd !important;
    opacity: 1 !important;
}

.vf-prod-stock.ok   { background: #dcfce7 !important; color: #166534 !important; }
.vf-prod-stock.low  { background: #fef3c7 !important; color: #92400e !important; }
.vf-prod-stock.zero { background: #fee2e2 !important; color: #991b1b !important; }

/* Dark mode */
[data-theme="dark"] .vf-prod-card {
    box-shadow: 0 2px 8px rgba(0,0,0,.35) !important;
    border-color: var(--border-strong) !important;
}

[data-theme="dark"] .vf-prod-placeholder {
    background: linear-gradient(135deg, rgba(96,165,250,.15) 0%, rgba(167,139,250,.15) 100%) !important;
    border-color: rgba(96,165,250,.3) !important;
}


/* ============================================================
   SIDEBAR — ICON WRAP
   ============================================================ */
.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.nav-icon-wrap {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.nav-icon-wrap i {
    font-size: 0.95rem;
    line-height: 1;
}

/* Hover: intensificar fondo del ícono */
.nav-link-item:hover .nav-icon-wrap {
    background: rgba(255, 255, 255, 0.12);
}

/* Activo: fondo blanco semitransparente */
.nav-link-item.active .nav-icon-wrap {
    background: rgba(255, 255, 255, 0.18) !important;
}

/* Sidebar colapsado: centrar ícono */
[data-sidebar="collapsed"] .nav-icon-wrap {
    margin: 0 auto;
}

/* Badge de módulo */
.nav-badge {
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 700;
}



/* ── Sidebar colapsado ── */
/* ============================================================
   SIDEBAR — NAV LABEL (texto de cada ítem)
   ============================================================ */
.nav-label {
    font-style: normal;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
/* ============================================================
   SIDEBAR — COLAPSADO
   ============================================================ */
/* ============================================================
   SIDEBAR — COLAPSADO
   ============================================================ */
.erp-sidebar.collapsed {
    width: 68px;
}

.erp-sidebar.collapsed .nav-label,
.erp-sidebar.collapsed .brand-text,
.erp-sidebar.collapsed .brand-sub,
.erp-sidebar.collapsed .user-details,
.erp-sidebar.collapsed .nav-section-label,
.erp-sidebar.collapsed .nav-badge { display: none !important; }

.erp-sidebar.collapsed .nav-link-item {
    justify-content: center;
    padding: 9px 0;
}
.erp-sidebar.collapsed .nav-icon-wrap {
    margin: 0 auto;
    width: 34px;
    height: 34px;
}
.erp-sidebar.collapsed .sidebar-footer {
    justify-content: center;
    padding: 14px 8px;
}
.erp-sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 20px 8px 16px;
}
.erp-sidebar.collapsed .sidebar-logo {
    width: 34px;
    height: 34px;
}

/* FAB Sugerencias */
.fab-sugerencia {
    position: fixed;
    bottom: calc(60px + 20px);
    right: 24px;
    z-index: 1050;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1.3rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .15s, opacity .15s;
}
.fab-sugerencia:hover { transform: scale(1.08); }

/* Modal sugerencias */
.modal-sugerencia-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0,0,0,.45);
    align-items: center;
    justify-content: center;
}
.modal-sugerencia-card {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    margin: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.2);
    overflow: hidden;
}
.modal-sugerencia-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-sugerencia-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}
.modal-sugerencia-close:hover { color: var(--text-primary); }
.modal-sugerencia-body { padding: 20px; }



.dropdown-item-producto {
  border-radius: 6px;
  margin: 2px 4px;
}
.dropdown-item-producto:hover,
.dropdown-item-producto.active {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--text-primary);
}


/* agregado recién el 12-05-26 */
/* ============================================================
   SIDEBAR — SECCIONES PLEGABLES
   Agregar al final de app.css
   ============================================================ */

/* Botón toggle de sección */
.nav-section-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 12px 10px 5px;
    color: rgba(255, 255, 255, 0.28);
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.18s ease;
    gap: 6px;
}

.nav-section-toggle:hover {
    color: rgba(255, 255, 255, 0.55);
}

.nav-section-toggle-label {
    flex: 1;
    text-align: left;
}

/* Flecha rotante */
.nav-section-arrow {
    font-size: 0.65rem;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nav-section-toggle.collapsed .nav-section-arrow {
    transform: rotate(-90deg);
}

/* Contenedor de ítems colapsable */
.nav-section-items {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease;
    opacity: 0;
}

.nav-section-items.open {
    max-height: 600px; /* suficiente para cualquier sección */
    opacity: 1;
}

/* Sidebar colapsado: ocultar toggle y mostrar solo iconos */
[data-sidebar="collapsed"] .nav-section-toggle,
.erp-sidebar.collapsed .nav-section-toggle {
    display: none;
}

[data-sidebar="collapsed"] .nav-section-items,
.erp-sidebar.collapsed .nav-section-items {
    max-height: 600px !important;
    opacity: 1 !important;
    overflow: visible;
}

#mp_efectivo:checked + label { background: #198754; border-color: #198754; color: #fff; }
#mp_tarjeta:checked  + label { background: #0dcaf0; border-color: #0dcaf0; color: #fff; }
#mp_qr:checked       + label { background: #6f42c1; border-color: #6f42c1; color: #ffffff; }
#mp_credito:checked  + label { background: #f4ac37; border-color: #f4ac37; color: #fff; }