/* =====================================================================
   ERP/POS Multi-negocio — estilos compartidos
   Identidad de marca ELA: azul profundo/corporativo + cian, Plus Jakarta
   Sans para texto y IBM Plex Mono para cifras — ver el brand kit v1.0/2026.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  --bs-primary: #1348c8;       /* Azul corporativo */
  --bs-primary-rgb: 19, 72, 200;
  --bs-accent: #12b5e5;        /* Cian */
  --bs-navy: #0b1f3a;          /* Azul profundo */
  --bs-success: #16a34a;
  --bs-danger: #ea5455;
  --bs-warning: #ff9f43;
  --bs-info: #12b5e5;

  --sidebar-width: 260px;
  --sidebar-width-collapsed: 80px;
  --navbar-height: 64px;
  --body-bg: #f5f7fa;
  --card-shadow: 0 1px 2px rgba(11,31,58,.06), 0 8px 24px rgba(11,31,58,.05);
  --border-color: #e2e8f0;

  --text-heading: #0b1f3a;     /* Azul profundo, para títulos */
  --text-body: #475569;
  --text-muted: #94a3b8;       /* Pizarra, tono claro */

  --font-sans: 'Plus Jakarta Sans', "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  background: var(--body-bg);
  font-family: var(--font-sans);
  color: var(--text-body);
}

/* Cifras, montos y códigos en monoespaciada — igual que en el brand kit
   ("$0,00 · IBM Plex Mono"). Se aplica por selector, no reescribiendo
   formatoMoneda(), porque ese helper devuelve texto plano (se usa tanto con
   textContent como con innerHTML en el código existente) — envolverlo en
   un <span> ahí rompería todos los usos con textContent. */
.total-grande, .stat-value, .fp-monto, .fp-vuelto, .fp-bs, .fp-impuesto,
td.text-end, th.text-end, .mono-num {
  font-family: var(--font-mono);
}

a { text-decoration: none; }

/* Bug clásico de flexbox: un hijo "flex-grow-1" no se encoge por debajo del
   ancho de su contenido (min-width:auto por defecto) — si ese contenido es
   texto largo (ej. una notificación con nombre de producto + fecha), la
   fila entera se ensancha más que la pantalla en vez de que el texto haga
   salto de línea, y en un celular queda cortado fuera de la vista. */
.flex-grow-1 { min-width: 0; }

/* ---------- Sidebar ---------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bs-navy);
  border-right: 1px solid rgba(255,255,255,.06);
  z-index: 1030;
  transition: width .2s ease, transform .2s ease;
  display: flex;
  flex-direction: column;
}

.app-sidebar .sidebar-brand {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 1.3rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}

/* Logotipo "ela" (assets/img/logo-icon.png, recortado con fondo
   transparente) — clase genérica, se reusa en el sidebar y el login. */
.brand-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand-icon img { width: 100%; height: 100%; object-fit: contain; }

.app-sidebar .sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .75rem;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.4);
  font-weight: 700;
  margin: 1.1rem 0 .4rem;
  padding: 0 .6rem;
  white-space: nowrap;
  background: none;
  border: none;
  cursor: pointer;
}

.sidebar-section:first-child .sidebar-section-title { margin-top: 0; }

.sidebar-section-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform .2s ease;
}
.sidebar-section.expanded .sidebar-section-chevron { transform: rotate(180deg); }

/* Acordeón: solo se ven los ítems de la sección desplegada. En modo
   colapsado (solo íconos, ver más abajo) esto se ignora — ahí siempre se
   ven todos, porque el título (y su botón para desplegar) queda oculto. */
.sidebar-section-items { display: none; }
.sidebar-section.expanded .sidebar-section-items { display: block; }
body.sidebar-collapsed .sidebar-section-items { display: block !important; }

.nav-link-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .62rem .8rem;
  border-radius: .5rem;
  color: rgba(255,255,255,.65);
  font-size: .95rem;
  font-weight: 500;
  margin-bottom: .15rem;
  cursor: pointer;
  white-space: nowrap;
}

.nav-link-item svg { width: 18px; height: 18px; flex-shrink: 0; }

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

.nav-link-item.active {
  background: linear-gradient(118deg, var(--bs-primary), var(--bs-accent));
  color: #fff;
  box-shadow: 0 2px 10px rgba(19,72,200,.35);
}

/* Collapsed state (desktop) */
body.sidebar-collapsed .app-sidebar { width: var(--sidebar-width-collapsed); }
body.sidebar-collapsed .app-sidebar .sidebar-brand span,
body.sidebar-collapsed .nav-link-item span,
body.sidebar-collapsed .sidebar-section-title { display: none; }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-width-collapsed); }

.app-main { margin-left: var(--sidebar-width); transition: margin-left .2s ease; min-height: 100vh; }

/* ---------- Navbar ---------- */
.app-navbar {
  position: sticky;
  top: 0;
  height: var(--navbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.3rem;
  z-index: 1020;
  box-shadow: 0 2px 6px rgba(34,41,47,.04);
}

.navbar-search { max-width: 320px; }

.navbar-icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-body);
  position: relative;
  border: none;
  background: transparent;
}
.navbar-icon-btn:hover { background: rgba(19,72,200,.08); color: var(--bs-primary); }
.navbar-icon-btn .badge-dot {
  position: absolute; top: 4px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--bs-danger);
}

.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bs-primary), var(--bs-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border-color); border-radius: .75rem; box-shadow: var(--card-shadow); }
/* Clase genérica (no solo dentro de .stat-card): también se usa suelta,
   ej. el ícono de cada fila en la lista de notificaciones — ahí, sin esta
   regla, el <i> quedaba sin centrar dentro de su caja (display inline por
   defecto en vez de flex). */
.stat-icon {
  width: 46px; height: 46px; border-radius: .65rem;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-heading); }
.stat-card .stat-label { font-size: .82rem; color: var(--text-muted); }

.bg-soft-primary { background: rgba(19,72,200,.1); color: var(--bs-primary); }
.bg-soft-success { background: rgba(22,163,74,.12); color: var(--bs-success); }
.bg-soft-danger  { background: rgba(234,84,85,.12); color: var(--bs-danger); }
.bg-soft-warning { background: rgba(255,159,67,.12); color: var(--bs-warning); }
.bg-soft-info    { background: rgba(18,181,229,.12); color: var(--bs-info); }

.text-primary { color: var(--bs-primary) !important; }
.btn-primary { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-primary:hover, .btn-primary:focus { background-color: #0f3aa0; border-color: #0f3aa0; }
.btn-outline-primary { color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-outline-primary:hover { background-color: var(--bs-primary); border-color: var(--bs-primary); }

.badge.bg-primary { background-color: var(--bs-primary) !important; }
.badge.bg-success { background-color: var(--bs-success) !important; }
.badge.bg-danger  { background-color: var(--bs-danger) !important; }
.badge.bg-warning { background-color: var(--bs-warning) !important; color: #fff; }
.badge.bg-info    { background-color: var(--bs-info) !important; }

.page-title { font-weight: 800; color: var(--text-heading); }
.breadcrumb-muted { color: var(--text-muted); font-size: .85rem; }

.table-card thead th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-muted); border-bottom: 1px solid var(--border-color); font-weight: 700;
}
.table-card td, .table-card th { vertical-align: middle; }

.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .2rem rgba(19,72,200,.15);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--bs-danger); }
.form-control.is-valid, .form-select.is-valid { border-color: var(--bs-success); }

.login-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bs-navy) 0%, var(--bs-primary) 100%);
  padding: 1rem;
}
.login-card { width: 100%; max-width: 420px; border-radius: 1rem; padding: 2.2rem; }

.sidebar-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1025; display: none;
}
body.sidebar-mobile-open .sidebar-backdrop { display: block; }

/* Visibilidad por rol: admin-only se oculta salvo body.role-admin;
   ventas-only se oculta salvo role-admin o role-vendedor;
   sin-vendedor se ve para todos MENOS vendedor (inventario/proveedores son
   de solo lectura para ese rol). */
.admin-only, .ventas-only, .superadmin-only { display: none !important; }
body.role-admin .admin-only { display: revert !important; }
body.role-admin .ventas-only,
body.role-vendedor .ventas-only { display: revert !important; }
body.role-superadmin .superadmin-only { display: revert !important; }
body.role-vendedor .sin-vendedor { display: none !important; }
body.role-superadmin .superadmin-only-hide { display: none !important; }
body.role-contador .contador-only-hide { display: none !important; }
body.role-cocina .cocina-only-hide { display: none !important; }
body.role-almacen .sin-almacen { display: none !important; }

@media (max-width: 991.98px) {
  .app-sidebar { transform: translateX(-100%); }
  body.sidebar-mobile-open .app-sidebar { transform: translateX(0); }
  .app-main { margin-left: 0; }
  body.sidebar-collapsed .app-main { margin-left: 0; }
}

/* Tablet/celular: el padding grande de las páginas (p-md-4) sobra en
   pantallas angostas, y los títulos de tabla no necesitan ser tan anchos. */
@media (max-width: 767.98px) {
  .stat-card .stat-value { font-size: 1.25rem; }
  .pos-total-bar .total-grande { font-size: 1.6rem; }
}

/* =====================================================================
   POS / Caja rápida (Facturación)
   ===================================================================== */
.pos-layout { display: flex; gap: 1rem; height: calc(100vh - var(--navbar-height) - 2rem); }
.pos-buscador { flex: 1.3; display: flex; flex-direction: column; min-width: 0; }
.pos-carrito { flex: 1; display: flex; flex-direction: column; min-width: 320px; }

.pos-carrito-lista { flex: 1; overflow-y: auto; }
.pos-carrito-item {
  display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem;
  border-bottom: 1px solid var(--border-color);
}
.pos-carrito-item .nombre { flex: 1; font-weight: 600; color: var(--text-heading); font-size: .9rem; }
.pos-carrito-item input[type="number"] { width: 70px; }

.pos-total-bar {
  border-top: 2px solid var(--border-color);
  padding: 1rem;
  background: #fff;
  border-radius: 0 0 .75rem .75rem;
}
.pos-total-bar .total-grande { font-size: 2rem; font-weight: 800; color: var(--bs-primary); }

.pos-metodo-pago-btn {
  border: 2px solid var(--border-color);
  border-radius: .75rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
  background: #fff;
}
.pos-metodo-pago-btn:hover { border-color: var(--bs-primary); }
.pos-metodo-pago-btn.selected {
  border-color: var(--bs-primary);
  background: rgba(19,72,200,.08);
  box-shadow: 0 0 0 .15rem rgba(19,72,200,.2);
}

/* Fila de método de pago (modal Cobro): flex-wrap en vez de columnas fijas
   de Bootstrap, para que cada campo reacomode solo según el ancho disponible
   (tablet en el mostrador, o hasta un celular) en vez de quedar aplastado. */
.pos-fila-pago {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .5rem .6rem;
  border: 1px solid var(--border-color);
  border-radius: .5rem;
}
.pos-fila-pago .fp-metodo { flex: 1 1 150px; }
.pos-fila-pago .fp-base { flex: 1 1 90px; }
.pos-fila-pago .fp-recibido { flex: 1 1 100px; }
.pos-fila-pago .fp-vuelto { flex: 1 1 90px; text-align: right; }
.pos-fila-pago .fp-impuesto,
.pos-fila-pago .fp-monto,
.pos-fila-pago .fp-bs { flex: 1 1 90px; text-align: right; }
.pos-fila-pago .fp-borrar { flex: 0 0 auto; }

/* Tablet e igual o más angosto: el mostrador (buscador) y el carrito dejan de
   competir por el mismo ancho — se apilan uno debajo del otro y cada uno
   toma el alto que necesite en vez de forzar el alto completo de pantalla
   (que en un celular deja al carrito con solo unos px visibles). */
@media (max-width: 991.98px) {
  .pos-layout { flex-direction: column; height: auto; }
  .pos-buscador { min-height: 320px; }
  .pos-carrito { min-width: 0; }
  .pos-carrito-lista { max-height: 320px; }
}

/* Documento imprimible: el mismo <div id="ticketImprimible"> cambia de
   clase según el botón usado (ver facturacion.js) — "ticket" es el ancho
   angosto de matriz de punto/térmica (80mm, papel continuo), "factura-normal"
   es tamaño carta para impresora normal (láser/inyección de tinta). El
   contenido HTML también es distinto entre los dos (factura-normal trae
   los datos fiscales completos: RIF, razón social, dirección — ver
   construirFacturaNormal en facturacion.js).
   Ambos ocultan el resto de la página al imprimir: solo se ve el
   documento, sin el POS ni los modales de por medio. */
.ticket, .factura-normal { display: none; }
@media print {
  body * { visibility: hidden; }
  .ticket, .ticket *, .factura-normal, .factura-normal * { visibility: visible; }

  .ticket { display: block; position: absolute; top: 0; left: 0; width: 80mm; padding: 4mm; font-size: 11px; }
  .ticket h5 { font-size: 13px; }
  .ticket table { width: 100%; }

  .factura-normal {
    display: block; position: absolute; top: 0; left: 0;
    width: 100%; padding: 15mm; font-size: 13px; color: #000;
  }
  .factura-normal table { width: 100%; border-collapse: collapse; }
  .factura-normal th, .factura-normal td { padding: 4px 6px; text-align: left; }
  .factura-normal thead th { border-bottom: 1px solid #000; }
  .factura-normal .encabezado-negocio { margin-bottom: 12px; }
  .factura-normal .encabezado-negocio h4 { margin: 0 0 2px; }
  .factura-normal .totales { width: 320px; margin-left: auto; margin-top: 10px; }
  .factura-normal .totales td:last-child { text-align: right; }
  .factura-normal .total-final { font-size: 16px; font-weight: bold; border-top: 1px solid #000; }

  /* Pantallas de reporte que se imprimen tal cual (body.imprimir-pagina):
     sin menú, barra superior ni botones, a todo el ancho. */
  body.imprimir-pagina * { visibility: visible; }
  body.imprimir-pagina .app-sidebar, body.imprimir-pagina .app-navbar, body.imprimir-pagina .sidebar-backdrop,
  body.imprimir-pagina .btn, body.imprimir-pagina .nav-tabs,
  body.imprimir-pagina .dataTables_length, body.imprimir-pagina .dataTables_filter,
  body.imprimir-pagina .dataTables_paginate { display: none !important; }
  body.imprimir-pagina .app-main { margin-left: 0 !important; }
  body.imprimir-pagina .card { box-shadow: none !important; break-inside: avoid; }
}

/* =====================================================================
   ELA Panel Admin (diseño de marca, carpeta "ELA branding design project
   (5)"). Va al final a propósito: reemplaza el aspecto de arriba sin
   cambiar clases ni ids que usan las pantallas.
   ===================================================================== */
:root {
  --bs-primary: #1348c8;
  --navy: #0b1f3a;
  --cian: #12b5e5;
  --azul: #1348c8;
  --body-bg: #f3f5f8;
  --border-color: #e2e8f0;
  --suave: #eef2f6;
  --texto2: #64748b;
  --texto3: #8a97ab;
  --sidebar-width: 248px;
  --navbar-height: 72px;
  --card-shadow: none;
  --bs-body-font-family: var(--font-sans);
  --bs-border-radius: 12px;
}
body { background: var(--body-bg); color: #334155; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6 { color: var(--navy); font-weight: 800; letter-spacing: -.01em; }

/* ---------- Menú lateral ---------- */
.app-sidebar { background: var(--navy); border-right: none; }
.app-sidebar .sidebar-brand { height: var(--navbar-height); border-bottom: none; padding: 0 22px; gap: 10px; }
.app-sidebar .sidebar-brand .brand-texto { font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.app-sidebar .sidebar-nav { padding: 8px 12px 24px; scrollbar-width: none; }
.app-sidebar .sidebar-nav::-webkit-scrollbar { display: none; }
.sidebar-section-title { height: 34px; margin: 6px 0 2px; padding: 0 10px; font-size: 11px; letter-spacing: .12em; color: var(--texto3); }
.sidebar-section:first-child .sidebar-section-title { margin-top: 0; }
.nav-link-item { height: 42px; padding: 0 12px; gap: 12px; border-radius: 12px; color: #dce3ec; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.nav-link-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link-item.active { background: var(--cian); color: var(--navy); box-shadow: none; }

/* ---------- Encabezado ---------- */
.app-navbar {
  height: var(--navbar-height); padding: 0 32px; gap: 16px;
  background: rgba(243,245,248,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color); box-shadow: none;
}
.navbar-titulo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.navbar-negocio { font-size: 12px; font-weight: 600; color: var(--texto3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar-pagina { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.navbar-buscar {
  flex: 0 1 240px; min-width: 40px; height: 40px; border-radius: 12px; background: #fff; border: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--texto3); font-size: 13px; overflow: hidden; white-space: nowrap; cursor: pointer;
}
.navbar-buscar:hover { border-color: var(--cian); }
.navbar-buscar svg { width: 16px; height: 16px; flex: none; }
.navbar-buscar .txt { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.navbar-buscar kbd, .buscador-ela kbd { font-family: var(--font-mono); font-size: 11px; color: var(--texto3); background: transparent; border: 1px solid var(--border-color); border-radius: 6px; padding: 2px 6px; box-shadow: none; }
.navbar-tasa { height: 40px; border-radius: 12px; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 14px; white-space: nowrap; flex: none; }
.navbar-tasa:hover { color: #fff; background: #13305a; }
.navbar-tasa .punto { width: 7px; height: 7px; border-radius: 50%; background: var(--cian); }
.navbar-tasa .e { font-size: 12px; color: #b8c4d6; }
.navbar-tasa strong { font-size: 13px; font-family: var(--font-sans); }
.navbar-icon-btn { width: 40px; height: 40px; border-radius: 12px; color: var(--navy); flex: none; }
.navbar-campana { border: 1px solid var(--border-color); background: #fff; }
.navbar-icon-btn:hover { background: #fff; color: var(--azul); }
.navbar-icon-btn .badge-num {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #e5484d; color: #fff; font-size: 10px; font-weight: 800; align-items: center; justify-content: center;
}
.user-avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--azul); font-weight: 800; font-size: 14px; flex: none; }
.navbar-usuario strong { font-size: 13px; color: var(--navy); white-space: nowrap; }
.navbar-usuario small { font-size: 11px; color: var(--texto3); }
@media (max-width: 991.98px) {
  .app-navbar { padding: 0 14px; gap: 10px; }
  .navbar-buscar { flex: none; width: 40px; padding: 0; justify-content: center; }
  .navbar-buscar .txt, .navbar-buscar kbd { display: none; }
  .navbar-tasa .e { display: none; }
  .navbar-pagina { font-size: 17px; }
}
@media (max-width: 575.98px) { .navbar-tasa { display: none; } }

/* El título va en el encabezado: se oculta el de la página y su subtítulo
   (.breadcrumb-muted) queda como bajada, igual que en el diseño. */
body.titulo-en-navbar #pageContent .page-title { display: none; }
.breadcrumb-muted { font-size: 14px; color: var(--texto2); }
#pageContent.p-md-4 { padding: 28px 32px 56px !important; }
@media (max-width: 767.98px) { #pageContent.p-md-4 { padding: 18px 14px 40px !important; } }

/* ---------- Buscador de pantallas (Ctrl K) ---------- */
.buscador-ela { position: fixed; inset: 0; z-index: 2000; background: rgba(11,31,58,.45); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.buscador-ela-caja { width: 100%; max-width: 560px; background: #fff; border-radius: 20px; box-shadow: 0 24px 60px rgba(11,31,58,.35); overflow: hidden; }
.buscador-ela-campo { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--suave); color: var(--texto3); }
.buscador-ela-campo input { flex: 1; min-width: 0; border: none; outline: none; font-size: 16px; font-weight: 500; color: var(--navy); font-family: var(--font-sans); }
.buscador-ela-lista { max-height: 50vh; overflow-y: auto; padding: 8px; }
.buscador-ela-item { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 12px; border-radius: 12px; color: var(--navy); font-weight: 600; font-size: 14px; }
.buscador-ela-item svg { width: 18px; height: 18px; color: var(--texto2); flex: none; }
.buscador-ela-item .t { flex: 1; }
.buscador-ela-item .s { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); }
.buscador-ela-item.activo, .buscador-ela-item:hover { background: var(--cian); color: var(--navy); }
.buscador-ela-item.activo svg, .buscador-ela-item.activo .s { color: var(--navy); }
.buscador-ela-vacio { padding: 28px; text-align: center; color: var(--texto3); font-size: 14px; }

/* ---------- Tarjetas ---------- */
.card { border: none; border-radius: 20px; box-shadow: none; background: #fff; }
.card > .card-header:first-child { border-radius: 20px 20px 0 0; }
.card > .card-footer:last-child { border-radius: 0 0 20px 20px; }
.card-header, .card-footer { background: #fff; border-color: var(--suave); }
.card-header { font-weight: 800; color: var(--navy); }
.stat-icon { width: 42px; height: 42px; border-radius: 13px; }
.stat-card .stat-value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-family: var(--font-sans); }
.stat-card .stat-label { font-size: 13px; font-weight: 600; color: var(--texto2); }
.bg-soft-primary { background: #e8f0ff; color: var(--azul); }
.bg-soft-success { background: #e7f6ee; color: #17804a; }
.bg-soft-danger  { background: #fdeceb; color: #c2372f; }
.bg-soft-warning { background: #fdf1dc; color: #b7741a; }
.bg-soft-info    { background: #dff4fb; color: #0e86ab; }

/* ---------- Botones ---------- */
.btn { border-radius: 12px; font-weight: 700; font-size: 14px; padding: .55rem 1.1rem; }
.btn-sm { border-radius: 10px; font-size: 12.5px; padding: .35rem .8rem; }
.btn-lg { border-radius: 16px; padding: .8rem 1.4rem; }
.btn-primary, .btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover, .btn-primary:focus, .btn-dark:hover, .btn-dark:focus { background: #13305a; border-color: #13305a; color: #fff; }
.btn-primary:disabled, .btn-dark:disabled { background: var(--navy); border-color: var(--navy); }
.btn-info { background: var(--cian); border-color: var(--cian); color: var(--navy); }
.btn-info:hover { background: #0fa3cf; border-color: #0fa3cf; color: var(--navy); }
.btn-success { background: #1e9e5a; border-color: #1e9e5a; }
.btn-outline-primary, .btn-outline-dark, .btn-outline-secondary, .btn-light {
  background: #fff; color: var(--navy); border: 1.5px solid var(--border-color);
}
.btn-outline-primary:hover, .btn-outline-dark:hover, .btn-outline-secondary:hover, .btn-light:hover {
  background: #fff; color: var(--azul); border-color: var(--cian);
}
.btn-outline-danger { border-width: 1.5px; border-color: #f5c2bf; color: #c2372f; }
.btn-outline-danger:hover { background: #fdeceb; color: #c2372f; border-color: #f5c2bf; }
.btn-link { font-weight: 700; color: var(--azul); }

/* ---------- Formularios ---------- */
.form-control, .form-select { border: 1.5px solid var(--border-color); border-radius: 12px; min-height: 44px; font-size: 15px; font-weight: 500; color: var(--navy); }
.form-control-sm, .form-select-sm { min-height: 36px; border-radius: 10px; font-size: 13px; }
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--cian); box-shadow: 0 0 0 3px rgba(18,181,229,.18); }
.form-label { font-size: 13px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.input-group-text { border: 1.5px solid var(--border-color); background: var(--body-bg); color: var(--texto2); font-weight: 600; border-radius: 12px; }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; color: var(--navy); }
.table > :not(caption) > * > * { border-bottom-color: var(--suave); padding: .8rem .75rem; }
.table thead th, .table-card thead th { font-size: 12px; font-weight: 700; color: var(--texto3); text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--suave); }
.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: #f7f9fb; }

/* ---------- Insignias, avisos, pestañas y ventanas ---------- */
.badge { border-radius: 999px; font-weight: 700; padding: .4em .75em; }
.badge.bg-primary { background-color: var(--azul) !important; }
.badge.bg-success { background-color: #1e9e5a !important; }
.badge.bg-danger { background-color: #e5484d !important; }
.badge.bg-warning { background-color: #f5a524 !important; color: var(--navy); }
.badge.bg-info { background-color: var(--cian) !important; color: var(--navy); }
.alert { border: none; border-radius: 16px; font-weight: 500; }
.alert-info { background: #e8f6fc; color: #0e5f7a; }
.alert-success { background: #e7f6ee; color: #17804a; }
.alert-warning { background: #fff4db; color: #8a5a00; }
.alert-danger { background: #fdeceb; color: #991b1b; }
.nav-tabs { border-bottom: 1px solid var(--border-color); gap: 4px; }
.nav-tabs .nav-link { border: none; border-radius: 10px 10px 0 0; color: var(--texto2); font-weight: 700; }
.nav-tabs .nav-link.active { color: var(--navy); background: transparent; box-shadow: inset 0 -3px 0 var(--cian); }
.nav-pills .nav-link { border-radius: 10px; font-weight: 700; color: var(--texto2); }
.nav-pills .nav-link.active { background: var(--navy); color: #fff; }
.modal-content { border: none; border-radius: 22px; box-shadow: 0 24px 60px rgba(11,31,58,.3); }
.modal-header { border-bottom-color: var(--suave); padding: 18px 22px; }
.modal-header .modal-title { font-weight: 800; color: var(--navy); }
.modal-body { padding: 20px 22px; }
.modal-footer { border-top-color: var(--suave); padding: 14px 22px; }
.dropdown-menu { border: none; border-radius: 14px; box-shadow: 0 14px 34px rgba(11,31,58,.18); padding: 6px; }
.dropdown-item { border-radius: 10px; font-weight: 600; }
.page-link { border-radius: 10px !important; margin: 0 2px; border-color: var(--border-color); color: var(--navy); }
.page-item.active .page-link { background: var(--navy); border-color: var(--navy); }

/* Inicio de sesión */
.login-page { background: var(--navy); position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; right: -160px; top: -160px; width: 460px; height: 460px; border: 1.5px solid rgba(18,181,229,.28); transform: rotate(45deg); }
.login-card { border-radius: 24px; position: relative; }

/* ---------- Caja (POS) — diseño "ELA Panel Admin" ---------- */
.pos-layout { gap: 20px; height: calc(100vh - var(--navbar-height) - 120px); }
.pos-carrito { flex: 0 0 400px; min-width: 340px; }
.pos-busqueda { display: flex; gap: 10px; }
.pos-campo-buscar { flex: 1; height: 56px; border-radius: 16px; background: #fff; border: 2px solid var(--border-color); display: flex; align-items: center; gap: 12px; padding: 0 18px; margin: 0; }
.pos-campo-buscar:focus-within { border-color: var(--cian); }
.pos-campo-buscar svg { width: 20px; height: 20px; color: var(--texto2); flex: none; }
.pos-campo-buscar input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 17px; font-weight: 500; color: var(--navy); }
.pos-btn-escanear { width: 56px; height: 56px; border-radius: 16px; border: none; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.pos-resultados-envoltura { overflow-y: auto; min-height: 0; padding: 2px; }
#posResultados { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
#posResultados > p { grid-column: 1 / -1; }
.pos-producto { position: relative; background: #fff; border: none; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; text-align: left; color: var(--navy); transition: box-shadow .12s, transform .08s; }
.pos-producto:hover { box-shadow: 0 0 0 2px var(--border-color); }
.pos-producto:active { transform: scale(.98); }
.pos-producto.en-carrito { box-shadow: 0 0 0 2px var(--cian); }
.pos-cant { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--cian); color: var(--navy); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pos-prod-nombre { display: flex; flex-direction: column; gap: 3px; padding-right: 26px; }
.pos-prod-nombre .n { font-size: 14px; font-weight: 700; line-height: 1.3; }
.pos-prod-nombre .sku { font-family: var(--font-mono); font-size: 11px; color: var(--texto3); }
.pos-prod-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.pos-stock { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: var(--suave); color: #475569; white-space: nowrap; }
.pos-stock.bajo { background: #fdf1dc; color: #b7741a; }
.pos-precio { font-size: 15px; font-weight: 800; white-space: nowrap; }
.pos-carrito > .card { border-radius: 22px; }
.pos-carrito-titulo { font-size: 17px; font-weight: 800; color: var(--navy); }
.pos-cliente { font-size: 12px; font-weight: 700; background: var(--body-bg); padding: 6px 10px; border-radius: 999px; color: var(--navy); }
.pos-carrito-item { padding: 12px 20px; border-bottom: 1px solid var(--suave); }
.pos-carrito-item .nombre { font-size: 14px; font-weight: 700; }
.pos-carrito-item input[type="number"] { width: 78px; min-height: 34px; text-align: center; font-weight: 800; }
.pos-total-bar { background: #fafbfc; border-top: 1px solid var(--suave); padding: 16px 20px 20px; border-radius: 0 0 22px 22px; }
#tipoDescuento { background: var(--suave); border-radius: 12px; padding: 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
#tipoDescuento .nav-link { width: 100%; border-radius: 9px; color: var(--texto2); font-weight: 700; font-size: 12px; }
#tipoDescuento .nav-link.active { background: #fff; color: var(--navy); }
.pos-total-oscuro { background: var(--navy); color: #fff; border-radius: 16px; padding: 14px 18px; margin: 8px 0 10px; display: flex; flex-direction: column; gap: 4px; }
.pos-total-oscuro .fila { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pos-total-oscuro .e { font-size: 13px; font-weight: 700; color: #b8c4d6; }
.pos-total-oscuro .total-grande { font-family: var(--font-sans); font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.pos-total-oscuro .total-grande.divisas { font-size: 17px; color: var(--cian); }
.pos-total-oscuro .sub { font-size: 12px; color: var(--cian); font-weight: 600; text-align: right; margin-top: -4px; }
.pos-btn-cobrar { height: 54px; border-radius: 16px; background: var(--cian); border: none; color: var(--navy); font-size: 16px; font-weight: 800; }
.pos-btn-cobrar:hover, .pos-btn-cobrar:focus { background: #0fa3cf; color: var(--navy); }
.pos-btn-cobrar:disabled { background: #cfe3ec; color: var(--navy); opacity: 1; }
@media (max-width: 991.98px) {
  .pos-layout { height: auto; }
  .pos-carrito { flex: none; min-width: 0; }
  .pos-resultados-envoltura { max-height: 420px; }
}
.pos-carrito-item > strong { width: auto !important; min-width: 80px; white-space: nowrap; font-size: 14px; color: var(--navy); }

/* .admin-only usa "display: revert !important" (ver arriba): en tarjetas
   con grid/flex propio eso les quita la distribución. Aquí se la devuelve,
   y una tarjeta oculta por JS (style="display:none", ej. Crédito al Mayor
   sin el módulo) se queda oculta. */
body.role-admin .cfg-seccion.admin-only { display: grid !important; }
body.role-admin .dash-caja.admin-only, body.role-admin .dash-tasa.admin-only { display: flex !important; }
body.role-admin .admin-only[style*="display: none"], body.role-admin .admin-only[style*="display:none"] { display: none !important; }

/* ---------- Modal Cobrar — diseño "ELA Panel Admin" (carpeta 6) ---------- */
.modal-backdrop.show { opacity: .5; background: var(--navy); }
.cobro-dialog { max-width: 900px; }
.cobro-contenido { border-radius: 28px; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 330px; max-height: calc(100vh - 48px); box-shadow: 0 40px 100px rgba(11,31,58,.45); }
.cobro-izq { padding: 28px 30px; display: flex; flex-direction: column; gap: 24px; overflow-y: auto; min-height: 0; }
.cobro-cab { display: flex; flex-direction: column; gap: 4px; }
.cobro-cab .modal-title { font-size: 26px; letter-spacing: -.02em; margin: 0; }
.cobro-cab span { font-size: 14px; color: var(--texto2); }
.cobro-bloque { display: flex; flex-direction: column; gap: 10px; }
.cobro-rotulo { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--navy); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cobro-rotulo small { font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--texto3); }
.cobro-cliente { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 8px; }
.cobro-correo { height: 46px; border-radius: 12px; border: 1.5px solid var(--border-color); display: flex; align-items: center; gap: 10px; padding: 0 14px; margin: 0; }
.cobro-correo:focus-within { border-color: var(--cian); box-shadow: 0 0 0 3px rgba(18,181,229,.18); }
.cobro-correo svg { width: 17px; height: 17px; color: var(--texto3); flex: none; }
.cobro-correo input { flex: 1; min-width: 0; border: none; outline: none; font-size: 15px; font-weight: 500; color: var(--navy); }
.cobro-mixto { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--navy); cursor: pointer; margin: 0; }
.cobro-mixto input { position: absolute; opacity: 0; pointer-events: none; }
.cobro-mixto .pista { position: relative; width: 40px; height: 22px; border-radius: 11px; background: #cbd5e1; transition: background .2s; }
.cobro-mixto .pista::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.cobro-mixto input:checked + .pista { background: var(--cian); }
.cobro-mixto input:checked + .pista::after { left: 20px; }
.cobro-mixto input:focus-visible + .pista { outline: 2px solid var(--azul); outline-offset: 2px; }
.cobro-metodos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cobro-metodos .pos-metodo-pago-btn { position: relative; height: 96px; border-radius: 16px; border: 2px solid var(--border-color); background: #fff; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px; text-align: left; color: var(--navy); box-shadow: none; }
.cobro-metodos .pos-metodo-pago-btn:hover { border-color: #9ddcf0; }
.cobro-metodos .pos-metodo-pago-btn .ico { width: 36px; height: 36px; border-radius: 11px; background: var(--body-bg); display: flex; align-items: center; justify-content: center; color: #475569; }
.cobro-metodos .pos-metodo-pago-btn .ico svg { width: 18px; height: 18px; }
.cobro-metodos .pos-metodo-pago-btn .nom { font-size: 14px; font-weight: 700; }
.cobro-metodos .pos-metodo-pago-btn .nom small { font-size: 11px; font-weight: 700; color: var(--texto3); margin-left: 4px; }
.cobro-metodos .pos-metodo-pago-btn .chk { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--cian); display: flex; align-items: center; justify-content: center; opacity: 0; }
.cobro-metodos .pos-metodo-pago-btn.selected { border-color: var(--cian); background: #f0fafe; box-shadow: none; }
.cobro-metodos .pos-metodo-pago-btn.selected .ico { background: var(--cian); color: var(--navy); }
.cobro-metodos .pos-metodo-pago-btn.selected .chk { opacity: 1; }
#cobroFilas:empty { display: none; }
#cobroFilas .pos-fila-pago { border: 1.5px solid var(--border-color); border-radius: 16px; padding: 12px; gap: 8px; background: #f7f9fb; }
#cobroFilas .pos-fila-pago .form-control, #cobroFilas .pos-fila-pago .form-select { min-height: 40px; background-color: #fff; }
#cobroFilas .fp-monto { font-size: 15px; color: var(--navy); }
.cobro-der { background: var(--navy); color: #fff; padding: 28px 26px 20px; display: flex; flex-direction: column; gap: 18px; position: relative; overflow-y: auto; overflow-x: hidden; min-height: 0; }
.cobro-der::before { content: ''; position: absolute; right: -90px; bottom: -90px; width: 260px; height: 260px; border: 1.5px solid rgba(18,181,229,.22); transform: rotate(45deg); pointer-events: none; }
.cobro-der > * { position: relative; }
.cobro-cerrar { position: absolute !important; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 11px; border: none; background: rgba(255,255,255,.1); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 2; }
.cobro-cerrar svg { width: 16px; height: 16px; }
.cobro-der .r { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #b8c4d6; }
.cobro-der .base { font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.cobro-der .fila { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.cobro-der .fila span { color: #b8c4d6; }
.cobro-barra { height: 8px; border-radius: 4px; background: rgba(255,255,255,.12); overflow: hidden; }
.cobro-barra div { height: 100%; width: 0; border-radius: 4px; background: var(--cian); transition: width .25s; }
.cobro-barra div.pasado { background: #e5484d; }
.cobro-impuestos { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.cobro-total { display: flex; flex-direction: column; gap: 4px; background: rgba(255,255,255,.06); border-radius: 16px; padding: 16px; }
.cobro-total .r { letter-spacing: 0; text-transform: none; font-size: 12px; }
.cobro-total .total-grande { font-family: var(--font-sans); font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: #fff; }
.cobro-total .bs { font-size: 12px; font-weight: 600; color: var(--cian); }
.cobro-estado { border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 700; line-height: 1.35; background: rgba(255,255,255,.08); color: #b8c4d6; }
.cobro-estado.ok { background: #e7f6ee; color: #17804a; }
.cobro-estado.falta { background: #fdf1dc; color: #8a5410; }
.cobro-estado.error { background: #fdeceb; color: #a52c25; }
.cobro-botones { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.cobro-confirmar { height: 56px; border-radius: 16px; border: none; background: rgba(255,255,255,.12); color: #6b7c95; font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; }
.cobro-confirmar.listo { background: var(--cian); color: var(--navy); }
.cobro-confirmar.listo:hover { background: #0fa3cf; color: var(--navy); }
.cobro-confirmar kbd, .cobro-cancelar kbd { font-family: var(--font-mono); font-size: 11px; font-weight: 500; padding: 3px 7px; border-radius: 6px; background: rgba(11,31,58,.12); color: inherit; box-shadow: none; }
.cobro-cancelar { height: 44px; border-radius: 14px; border: none; background: transparent; color: #b8c4d6; font-size: 14px; font-weight: 700; }
.cobro-cancelar:hover { color: #fff; }
@media (max-width: 767.98px) {
  .cobro-contenido { grid-template-columns: 1fr; max-height: none; }
  .cobro-izq { padding: 22px 18px; }
  .cobro-cliente { grid-template-columns: 1fr; }
}
#cobroAvisoDescuadre { display: none !important; } /* lo cubre .cobro-estado */
/* Un solo método (sin pago mixto): solo lo que importa — cuánto, recibido/vuelto o referencia. */
#cobroFilas.unico .fp-metodo, #cobroFilas.unico .fp-base, #cobroFilas.unico .fp-borrar { display: none; }
#cobroFilas.unico .pos-fila-pago { justify-content: space-between; }
#cobroFilas.unico .fp-monto { font-size: 17px; }

/* =====================================================================
   ELA Panel Admin - Módulos (carpeta "ELA branding design project (7)"):
   cabecera azul profunda con cifras, gráficos, pestañas en píldora,
   tablas, filtros y ventanas con panel lateral.
   ===================================================================== */
.ela-hero {
  position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 24px;
  padding: 26px 28px; display: flex; flex-direction: column; gap: 22px; margin-bottom: 18px;
}
.ela-hero-rombo { position: absolute; transform: rotate(45deg); pointer-events: none; border: 1.5px solid rgba(18,181,229,.25); }
.ela-hero-rombo.r1 { right: -120px; top: -150px; width: 360px; height: 360px; }
.ela-hero-rombo.r2 { right: 140px; bottom: -170px; width: 260px; height: 260px; border-color: rgba(59,123,255,.22); }
.ela-hero-fila { position: relative; display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ela-hero-texto { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.ela-hero-grupo { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cian); }
body.titulo-en-navbar #pageContent .ela-hero .page-title { display: block; }
.ela-hero .page-title { color: #fff; font-family: 'Space Grotesk', var(--font-sans); font-size: 34px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: 0; }
.ela-hero .breadcrumb-muted { color: #b8c4d6; font-size: 14px; max-width: 680px; line-height: 1.5; }
.ela-hero-acciones { position: relative; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ela-hero-acciones:empty { display: none; }
.ela-hero-acciones > div { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ela-hero .btn { height: 42px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 13px; white-space: nowrap; }
.ela-hero .btn:not(.btn-primary):not(.btn-info) { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.ela-hero .btn:not(.btn-primary):not(.btn-info):hover { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); }
.ela-hero .btn-primary, .ela-hero .btn-info { background: var(--cian); border-color: var(--cian); color: var(--navy); }
.ela-hero .btn-primary:hover, .ela-hero .btn-info:hover { background: #0fa3cf; border-color: #0fa3cf; color: var(--navy); }
.ela-hero .form-control, .ela-hero .form-select { background-color: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; min-height: 42px; }
.ela-hero .form-select option { color: var(--navy); }
.ela-hero-cifras { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ela-cifra { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ela-cifra .e { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--texto3); }
.ela-cifra .v { font-family: 'Space Grotesk', var(--font-sans); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.ela-cifra .v.cy { color: var(--cian); }
.ela-cifra .v.pos { color: #5dd39e; }
.ela-cifra .v.neg { color: #ff8a84; }
.ela-cifra .d { font-size: 12px; color: #b8c4d6; line-height: 1.4; }
@media (max-width: 767.98px) {
  .ela-hero { padding: 20px 18px; border-radius: 20px; gap: 16px; }
  .ela-hero .page-title { font-size: 26px; }
  .ela-hero-cifras { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ela-cifra .v { font-size: 17px; white-space: normal; overflow-wrap: anywhere; }
  .ela-cifra { padding: 12px; }
}

/* Gráficos de los módulos */
.ela-graficos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; align-items: start; }
.ela-graficos.uno { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 991.98px) { .ela-graficos { grid-template-columns: minmax(0, 1fr); } }
.ela-grafico { background: #fff; border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ela-grafico .cab { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.ela-grafico .cab b { display: block; font-size: 16px; font-weight: 800; color: var(--navy); }
.ela-grafico .cab small { display: block; font-size: 12px; color: var(--texto3); }
.ela-grafico .cab .total { font-family: 'Space Grotesk', var(--font-sans); font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: var(--navy); }
.ela-barras { height: 190px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--suave); padding: 0 4px; }
.ela-barras .col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.ela-barras .val { font-size: 11px; font-weight: 700; color: #475569; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ela-barras .b { width: 100%; max-width: 64px; min-height: 3px; border-radius: 10px 10px 4px 4px; transition: height .5s ease; }
.ela-barras-etq { display: flex; gap: 14px; padding: 0 4px; margin-top: -8px; }
.ela-barras-etq span { flex: 1; min-width: 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--texto3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ela-reparto { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 3px; background: var(--suave); }
.ela-reparto-ley { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 24px; }
.ela-reparto-ley > div { display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 0; }
.ela-reparto-ley .c { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ela-reparto-ley .l { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--navy); }
.ela-reparto-ley b { white-space: nowrap; color: var(--navy); }
.ela-reparto-ley .p { width: 40px; text-align: right; color: var(--texto3); font-weight: 600; }
.ela-grafico-vacio { padding: 26px 0; text-align: center; font-size: 13px; color: var(--texto3); }

/* Pestañas en píldora */
.nav-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; background: #fff; border: none; border-radius: 14px; padding: 4px; }
.nav-tabs .nav-link { height: 38px; padding: 0 16px; border: none; border-radius: 10px; color: var(--texto2); font-size: 13px; font-weight: 700; white-space: nowrap; margin: 0; }
.nav-tabs .nav-link:hover { color: var(--navy); background: var(--body-bg); }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { background: var(--navy); color: #fff; box-shadow: none; }

/* Filtros: tarjeta blanca con etiquetas arriba y botón azul profundo */
.card .form-label.mb-1, .card label.small { font-size: 12px; font-weight: 700; color: var(--texto2); }

/* Tablas: encabezado gris claro de borde a borde, insignias suaves */
.table thead th { background: #f7f9fb; border-top: 1px solid var(--suave); padding-top: 12px; padding-bottom: 12px; line-height: 1.35; }
.table tbody td { padding-top: 13px; padding-bottom: 13px; }
.table .badge.bg-success, .table .badge.text-bg-success { background: #e7f6ee !important; color: #17804a !important; }
.table .badge.bg-danger, .table .badge.text-bg-danger { background: #fdeceb !important; color: #c2372f !important; }
.table .badge.bg-warning, .table .badge.text-bg-warning { background: #fdf1dc !important; color: #b7741a !important; }
.table .badge.bg-info, .table .badge.text-bg-info { background: #dff4fb !important; color: #0e86ab !important; }
.table .badge.bg-primary, .table .badge.text-bg-primary { background: #e8f0ff !important; color: #1348c8 !important; }
.table .badge.bg-secondary, .table .badge.text-bg-secondary, .table .badge.bg-light { background: #eef2f6 !important; color: #475569 !important; }
.table .btn-sm { min-width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_info { font-size: 13px; font-weight: 600; color: var(--texto2); }
.dataTables_wrapper .dataTables_length select { min-height: 36px; border-radius: 10px; }
.dataTables_wrapper .dataTables_filter input {
  min-height: 40px; width: 240px !important; max-width: 100%; border-radius: 12px; padding-left: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%238A97AB' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
}
.dataTables_wrapper .dataTables_filter label { font-size: 0; }
.dataTables_wrapper .dataTables_filter input::placeholder { font-size: 13px; }
.dataTables_wrapper .pagination .page-link { min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--border-color); padding: 0 10px; }
.dataTables_wrapper .pagination .page-item.active .page-link { border-color: var(--navy); }
.dataTables_wrapper .pagination .page-item.disabled .page-link { color: var(--texto3); background: #fff; }

/* Ventanas con panel lateral (Resumen / Antes de guardar + botones) */
.modal-content.con-lado { flex-direction: row; overflow: hidden; border-radius: 26px; box-shadow: 0 40px 100px rgba(11,31,58,.45); }
.modal-principal { flex: 1; min-width: 0; display: flex; flex-direction: column; max-height: calc(100vh - 3.5rem); }
.modal-principal > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-principal .modal-body { overflow-y: auto; padding: 22px 26px; }
.con-lado .modal-header { padding: 22px 26px; gap: 14px; align-items: center; }
.con-lado .modal-cab-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.con-lado .modal-header .modal-title { font-size: 20px; letter-spacing: -.02em; margin: 0; }
.modal-bajada { font-size: 13px; color: var(--texto2); line-height: 1.4; }
.modal-icono { width: 42px; height: 42px; border-radius: 13px; background: var(--navy); color: var(--cian); display: flex; align-items: center; justify-content: center; flex: none; }
.modal-icono svg { width: 19px; height: 19px; stroke-width: 2.2; }
.con-lado .modal-header .btn-close { width: 38px; height: 38px; padding: 0; border-radius: 11px; background-color: var(--body-bg); background-size: 12px; opacity: 1; margin: 0; flex: none; }
.modal-lado { width: 300px; flex: none; background: var(--navy); color: #fff; padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 14px; position: relative; overflow: hidden; }
.modal-lado::after { content: ''; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border: 1.5px solid rgba(18,181,229,.22); transform: rotate(45deg); pointer-events: none; }
.modal-lado .t { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cian); }
.modal-lado-resumen { display: flex; flex-direction: column; gap: 10px; }
.modal-lado-resumen .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.modal-lado-resumen .fila span { flex: 1; min-width: 0; font-size: 13px; color: #b8c4d6; line-height: 1.35; }
.modal-lado-resumen .fila b { flex: none; font-family: 'Space Grotesk', var(--font-sans); font-size: 15px; font-weight: 700; color: #fff; white-space: nowrap; }
.modal-lado-resumen .fila.grande b { font-size: 24px; color: var(--cian); }
.modal-lado-consejos { display: flex; flex-direction: column; gap: 12px; }
.modal-lado .consejo { display: flex; gap: 10px; font-size: 13px; line-height: 1.5; color: #dce3ec; }
.modal-lado .punto { width: 7px; height: 7px; flex: none; margin-top: 7px; background: var(--cian); transform: rotate(45deg); }
.modal-lado-acciones { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.modal-lado-acciones .btn { width: 100%; height: 48px; justify-content: center; display: flex; align-items: center; gap: 8px; }
.modal-lado-acciones .btn:not(.modal-lado-principal) { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.18); }
.modal-lado-acciones .modal-lado-principal { height: 54px; border-radius: 16px; background: var(--cian); border-color: var(--cian); color: var(--navy); font-size: 15px; font-weight: 800; }
.modal-lado-acciones .modal-lado-principal:hover, .modal-lado-acciones .modal-lado-principal:focus { background: #0fa3cf; border-color: #0fa3cf; color: var(--navy); }
.modal-lado-acciones .modal-lado-principal:disabled { background: var(--cian); opacity: .6; }
.modal-lado-cancelar { height: 40px; border: none; background: transparent; color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 6px; }
.modal-lado-cancelar:hover { color: var(--cian); }
.modal-lado-cancelar kbd { background: transparent; color: var(--texto3); font-family: var(--font-sans); font-size: 11px; font-weight: 700; padding: 0; box-shadow: none; }
@media (min-width: 992px) {
  .modal-dialog.dialogo-con-lado { max-width: 820px; }
  .modal-dialog.dialogo-con-lado.modal-lg { max-width: 1100px; }
  .modal-dialog.dialogo-con-lado.modal-xl { max-width: 1240px; }
}
@media (max-width: 991.98px) {
  .modal-content.con-lado { flex-direction: column; }
  .modal-principal { max-height: none; }
  .modal-lado { width: auto; padding: 14px 18px; }
  .modal-lado::after, .modal-lado .t, .modal-lado-consejos { display: none; }
  .modal-lado-resumen .fila.grande b { font-size: 20px; }
  .modal-lado-acciones { margin-top: 0; padding-top: 0; flex-direction: row-reverse; }
  .modal-lado-acciones > * { flex: 1; }
  .modal-lado-acciones .modal-lado-principal { height: 48px; }
  .modal-lado-cancelar kbd { display: none; }
}
@media (max-width: 575.98px) {
  .ela-grafico { padding: 18px 14px; }
  .ela-barras, .ela-barras-etq { gap: 6px; padding: 0; }
  .ela-barras .val { font-size: 9.5px; }
  .ela-barras-etq span { font-size: 10px; }
  .dataTables_wrapper .dataTables_filter input { width: 100% !important; }
}

/* ---------------------------------------------------------------------
   Superadmin (Negocios, Gastos y Balance)
   --------------------------------------------------------------------- */
.sa-herr-icono { width: 40px; height: 40px; flex: none; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(18,181,229,.12); color: #0E86AB; }
.sa-herr-icono.verde { background: rgba(22,163,74,.1); color: #17804A; }
.sa-herr-icono svg { width: 20px; height: 20px; }
.sa-estado-respaldos > div { padding: 3px 0; }
.sa-lista { display: flex; flex-direction: column; }
.sa-lista-fila { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--suave); font-size: 13px; }
.sa-lista-fila:last-child { border-bottom: 0; }
.sa-lista-fila .n { font-weight: 600; color: var(--navy); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-lista-fila .s { display: block; font-size: 11.5px; color: var(--texto3); font-weight: 500; }
.sa-lista-fila b { white-space: nowrap; color: var(--navy); }

/* Barras dobles (ingresos vs. egresos por mes) */
.sa-barras2 { height: 200px; display: flex; align-items: flex-end; gap: 14px; border-bottom: 1px solid var(--suave); padding: 0 4px; }
.sa-barras2 .col { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 4px; cursor: default; }
.sa-barras2 .b { flex: 1; max-width: 26px; min-height: 3px; border-radius: 8px 8px 3px 3px; transition: height .5s ease; }
.sa-barras2 .col.activo .b { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(18,181,229,.35); }
.sa-barras2-etq { display: flex; gap: 14px; padding: 0 4px; margin-top: -8px; }
.sa-barras2-etq span { flex: 1; min-width: 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--texto3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-barras2-etq span.activo { color: var(--navy); }
.sa-barras2-etq span .r { display: block; font-size: 10.5px; font-weight: 700; }
.sa-barras2-etq span .r.pos { color: #17804A; }
.sa-barras2-etq span .r.neg { color: #E5484D; }
.sa-leyenda { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; font-weight: 600; color: var(--texto3); }
.sa-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.sa-leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Estado de resultado del mes */
.sa-balance .fila { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border-color); font-size: 14px; }
.sa-balance .fila span { color: var(--text-body); }
.sa-balance .fila b { font-family: 'Space Grotesk', var(--font-sans); font-size: 16px; color: var(--navy); white-space: nowrap; }
.sa-balance .fila.menos b { color: #E5484D; }
.sa-balance .fila.total { border-bottom: 0; border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 12px; }
.sa-balance .fila.total span { font-weight: 800; color: var(--navy); }
.sa-balance .fila.total b { font-size: 24px; }
.sa-balance .fila.total b.pos { color: #17804A; }
.sa-balance .fila.total b.neg { color: #E5484D; }
.ela-hero input[type="month"] { color-scheme: dark; }
@media (max-width: 575.98px) {
  .sa-barras2, .sa-barras2-etq { gap: 6px; padding: 0; }
  .sa-barras2 .b { max-width: 14px; }
}
