:root {
  --sidebar-ancho: 250px;
  --sidebar-fondo: #1e293b;
  --sidebar-texto: #cbd5e1;
}

body { background: #f1f5f9; }
.min-w-0 { min-width: 0; }

.sidebar {
  width: var(--sidebar-ancho);
  min-height: 100vh;
  background: var(--sidebar-fondo);
  color: var(--sidebar-texto);
}
.offcanvas.sidebar { width: var(--sidebar-ancho); }
.sidebar .marca { color: #fff; }
.sidebar .nav-link { color: var(--sidebar-texto); border-radius: .5rem; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar .nav-link.active { background: var(--bs-primary); color: #fff; }
/* Solo el menú fijo de escritorio: el del celular es un offcanvas de Bootstrap y necesita su position: fixed. */
#sidebar { overflow-y: auto; position: sticky; top: 0; max-height: 100vh; }
.menu-lateral .menu-bloque { cursor: pointer; }
.menu-lateral .flecha { font-size: .75rem; transition: transform .2s; }
.menu-lateral .menu-bloque.collapsed .flecha { transform: rotate(-90deg); }
.menu-lateral .submenu { padding: .25rem 0 .5rem 1.25rem; }
.menu-lateral .submenu .nav-link { font-size: .9rem; padding: .35rem .75rem; }
.menu-lateral .nav-link.disabled { color: #64748b; }
.menu-lateral .pronto { background: rgba(255, 255, 255, .08); color: #94a3b8; font-weight: 500; font-size: .65rem; }
body.menu-oculto #sidebar { display: none !important; }

.selector-sucursal { min-width: 190px; }
.select2-container--bootstrap-5 .select2-dropdown { z-index: 1060; }
.is-invalid + .select2-container--bootstrap-5 .select2-selection { border-color: var(--bs-danger); }

.topbar { background: #fff; border-bottom: 1px solid #e2e8f0; min-height: 56px; }

.avatar { object-fit: cover; flex-shrink: 0; }
.avatar-iniciales {
  display: inline-flex; align-items: center; justify-content: center;
  background: #dbeafe; color: #1d4ed8; font-weight: 600;
}

.fila-link { cursor: pointer; }
.ficha-datos dt { font-weight: 500; color: var(--bs-secondary-color); }
.ficha-datos dd { margin-bottom: .5rem; }
.grupos-check { padding-top: .4rem; }
.matriz-permisos td:first-child, .matriz-permisos th:first-child { padding-left: 1rem; }
.acceso-rapido:hover { transform: translateY(-2px); transition: transform .15s; }

.pantalla-login { background: #f1f5f9; }
.login-marca {
  background: linear-gradient(145deg, #1e293b 0%, #1e3a8a 100%);
  color: #e2e8f0;
}
.login-marca .modulo { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.login-marca .modulo i {
  width: 2.25rem; height: 2.25rem; border-radius: .6rem; display: inline-flex;
  align-items: center; justify-content: center; background: rgba(255, 255, 255, .1); font-size: 1.1rem;
}
.login-form { max-width: 380px; }

/* Almacén */
.miniatura { width: 44px; height: 44px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; }
.miniatura-vacia { background: #f1f5f9; color: #94a3b8; }
.foto-producto { max-height: 260px; }
.foto-vacia { height: 160px; display: flex; align-items: center; justify-content: center; background: #f1f5f9; color: #94a3b8; }
.precio-manual { background-color: #fff8e1 !important; }

/* Renglones cargados con lector o búsqueda (static/js/renglones.js) */
@keyframes renglon-nuevo { from { background-color: rgba(25, 135, 84, .18); } to { background-color: transparent; } }
tr.renglon-nuevo > td { animation: renglon-nuevo 1.2s ease-out; }

/* Pantalla de venta */
@media (min-width: 1200px) { .panel-cobro { position: sticky; top: 1rem; } }
.tabla-venta td { vertical-align: middle; }
