/* Portal de clientes (2026-12-01) — misma identidad que la página nueva (lagaresweb): rojo #b40000, ProximaNova */
@font-face { font-family: 'ProximaNova'; src: url('fonts/proximanova-regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'ProximaNova'; src: url('fonts/proximanova-semibold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'ProximaNova'; src: url('fonts/proximanova-bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root { --rojo: #b40000; --rojo-claro: #ffb3b3; --rosa: #ffcdd2; --tinta: #231f1f; --gris: #6b6262; --fondo: #faf7f4; --oscuro: #1d1717; --ancho: 1320px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'ProximaNova', system-ui, sans-serif; color: var(--tinta); background: var(--fondo); font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; }
.contenedor { max-width: var(--ancho); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* Encabezado */
.barra { background: var(--rojo); color: #fff; }
/* Igual que la página (lagaresweb/public/css/lagares.css) */
.barra .contenedor { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; }
.barra .logo img { height: 44px; display: block; }
.barra nav { display: flex; flex-wrap: wrap; gap: 8px 26px; font-size: 15px; font-weight: 600; flex: 1 1 auto; }
.barra nav a.activo, .submenu.activo > .submenu-boton { text-decoration: underline; text-underline-offset: 6px; }
.btn-portal { border: 1.5px solid #fff; border-radius: 22px; padding: 10px 20px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.submenu { position: relative; }
.submenu-boton { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.submenu-boton.btn-portal { padding: 10px 20px; border: 1.5px solid #fff; }
.submenu-boton span { font-size: 11px; margin-left: 2px; }
.submenu-opciones { display: none; position: absolute; left: -14px; top: 100%; padding-top: 10px; z-index: 20; min-width: 220px; filter: drop-shadow(0 8px 18px rgba(0,0,0,.18)); }
.submenu-opciones.derecha { left: auto; right: 0; }
.submenu-opciones a, .submenu-opciones span, .submenu-opciones button { display: block; width: 100%; text-align: left; background: #fff; color: var(--tinta); padding: 11px 16px; font: inherit; font-weight: 600; border: 0; border-bottom: 1px solid #f0e8e6; cursor: pointer; }
.submenu-opciones > :first-child { border-radius: 8px 8px 0 0; }
.submenu-opciones > :last-child, .submenu-opciones > :last-child button { border-radius: 0 0 8px 8px; border-bottom: 0; }
.submenu-opciones a:hover, .submenu-opciones a.activo, .submenu-opciones button:hover { opacity: 1; background: #fbeeee; color: var(--rojo); }
.submenu-opciones .proximamente { color: #b3a9a9; cursor: default; }
.submenu-opciones .proximamente::after { content: ' · próximamente'; font-weight: 400; font-size: 12px; }
.submenu-opciones .grupo { color: var(--gris); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; padding-bottom: 4px; cursor: default; }
.submenu-opciones .sangria { padding-left: 28px; font-weight: 400; }
.submenu-opciones .separador { border-top: 1px solid #e9dcda; }
.usuario .submenu-opciones { min-width: 310px; }
.submenu-opciones .sangria { white-space: nowrap; }
.submenu:hover .submenu-opciones, .submenu:focus-within .submenu-opciones { display: block; }

/* Textos y avisos */
.seccion { padding-top: 40px; padding-bottom: 40px; }
.seccion-titulo { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.seccion-titulo h1 { margin: 4px 0 0; font-size: 34px; line-height: 1.1; }
.antetitulo { margin: 0; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--rojo); }
.nota { color: var(--gris); font-size: 14px; }
.aviso { background: #fff; border-left: 4px solid var(--rojo); border-radius: 6px; padding: 14px 18px; margin: 18px 0; }
.aviso-ok { border-left-color: #2e7d32; }
.aviso a { color: var(--rojo); font-weight: 600; }
.btn { display: inline-block; font: inherit; font-weight: 700; font-size: 16px; padding: 12px 26px; border: 0; border-radius: 26px; background: var(--rojo); color: #fff; cursor: pointer; }
.btn-chico { font-size: 14px; padding: 9px 20px; }

/* Entrada / contraseña */
.entrada { padding-top: 56px; padding-bottom: 56px; display: flex; justify-content: center; }
.tarjeta-form { background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(60,20,20,.08); padding: 34px 36px; width: 100%; max-width: 440px; }
.tarjeta-form h1 { margin: 6px 0 8px; font-size: 28px; line-height: 1.15; }
.tarjeta-form label { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 6px; }
.tarjeta-form input { width: 100%; font: inherit; padding: 11px 14px; border: 1.5px solid #e3d9d7; border-radius: 8px; background: #fff; }
.tarjeta-form input:focus { outline: none; border-color: var(--rojo); }
.tarjeta-form .btn { width: 100%; margin-top: 22px; }
.nota-campo { font-weight: 400; color: var(--gris); }
.error { color: var(--rojo); font-weight: 600; font-size: 14px; margin: 12px 0 0; }
.liga-chica { text-align: center; margin: 18px 0 0; font-size: 14px; }
.liga-chica a { color: var(--rojo); font-weight: 600; }

/* Elegir cliente */
.elegir-cliente label { display: block; font-size: 13px; font-weight: 600; color: var(--gris); margin-bottom: 4px; }
.elegir-cliente select { font: inherit; padding: 9px 12px; border: 1.5px solid #e3d9d7; border-radius: 8px; background: #fff; min-width: 280px; max-width: 100%; }
.acciones-reporte { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }

/* Botones de reportes */
.reportes-botones { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 30px; }
.reporte-boton { background: #fff; border-radius: 10px; padding: 14px 16px; border: 1.5px solid #f0e3e1; display: flex; flex-direction: column; gap: 4px; }
.reporte-boton strong { color: var(--rojo); }
.reporte-boton span { font-size: 13px; color: var(--gris); line-height: 1.35; }
a.reporte-boton:hover { opacity: 1; border-color: var(--rojo); }
.reporte-boton.deshabilitado { opacity: .55; }
.reporte-boton.deshabilitado strong { color: var(--gris); }

/* Tarjetas de libros */
.libros { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.libros .libro { background: #fff; border-radius: 12px; padding: 16px; display: flex; gap: 16px; box-shadow: 0 4px 14px rgba(60,20,20,.05); }
.libro-portada { flex: 0 0 78px; }
.libro-portada img { width: 78px; height: 110px; object-fit: cover; border-radius: 3px; box-shadow: 0 3px 8px rgba(0,0,0,.18); background: #eee; display: block; }
.libro-datos { flex: 1; min-width: 0; }
.libros .libro h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.libro-subtitulo { margin: 3px 0 0; font-size: 14px; color: var(--gris); }
.libro-formatos { margin: 4px 0 0; font-size: 12px; font-weight: 700; color: var(--rojo); text-transform: uppercase; letter-spacing: .06em; }
.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 12px 0 0; }
.cifras div { background: var(--fondo); border-radius: 6px; padding: 6px 8px; }
.cifras dt { font-size: 11px; color: var(--gris); }
.cifras dd { margin: 0; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cifras .destacado { background: #fbeeee; }
.cifras .destacado dd { color: var(--rojo); }

/* Reportes (misma tabla que el sistema: encabezado rojo, totales en rosa) */
.tabla-reporte { background: #fff; border-radius: 12px; padding: 18px; overflow-x: auto; box-shadow: 0 4px 14px rgba(60,20,20,.05); }
.tabla-reporte h3 { margin: 0 0 12px; font-size: 18px; }
.tabla-reporte h3 span { font-weight: 400; font-size: 14px; color: var(--gris); }
table.reporte { width: 100%; border-collapse: collapse; font-size: 14px; }
.reporte th, .reporte td { padding: 5px 8px; border: 1px solid #f0e3e1; white-space: nowrap; }
.reporte thead tr:first-child th { background: var(--rojo); color: #fff; border-color: #9a0000; text-align: center; }
.reporte thead tr + tr th { background: var(--rosa); font-size: 13px; }
.reporte th.inv { text-align: center; line-height: 1.15; }
.reporte .num { text-align: right; font-variant-numeric: tabular-nums; }
.reporte .text-left { text-align: left; }
.reporte tbody tr:hover td { background: #fff8f7; }
.reporte tfoot td { font-weight: 700; background: var(--rosa); }
.reporte .vacio { text-align: center; color: var(--gris); padding: 18px; }
.reporte td.autor, .reporte th.autor { border-left: 2px solid #e0c9c6; }

/* Pie — igual que la página */
.pie { background: var(--oscuro); color: #d9d2d2; margin-top: 30px; }
.pie .contenedor { padding-top: 48px; padding-bottom: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; font-size: 15px; line-height: 1.7; }
.pie strong { color: #fff; }
.pie .logo img { height: 40px; }
.pie a.correo { color: var(--rojo-claro); }
.pie .derechos { margin: 0; text-align: center; font-size: 13px; color: #9b9090; padding: 0 24px 24px; }
.redes { list-style: none; margin: 10px 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.redes a { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: background .2s; }
.redes a:hover { opacity: 1; background: var(--rojo); }
.redes a.red-whatsapp:hover { background: #25d366; }
.redes svg { width: 20px; height: 20px; }
.btn-whatsapp { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 16px; border-radius: 22px; background: #25d366; color: #fff; font-weight: 700; font-size: 14px; }
.btn-whatsapp svg { width: 18px; height: 18px; }
.whatsapp-flotante { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 60px; height: 60px; border-radius: 50%; background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.28); transition: transform .2s; }
.whatsapp-flotante:hover { opacity: 1; transform: scale(1.08); }
.whatsapp-flotante svg { width: 32px; height: 32px; }

@media (max-width: 700px) {
    .whatsapp-flotante { right: 16px; bottom: 16px; width: 54px; height: 54px; }
    .whatsapp-flotante svg { width: 28px; height: 28px; }
    .libros { grid-template-columns: 1fr; }
    .cifras { grid-template-columns: repeat(2, 1fr); }
    .tarjeta-form { padding: 26px 22px; }
}

/* Reportes con "+" (Ventas por librería): libro → librerías → sucursales */
.hidden { display: none; }
.btn-mas { font: inherit; font-weight: 700; font-size: 13px; line-height: 1; width: 22px; height: 22px; margin-left: 6px; border: 1.5px solid var(--rojo); border-radius: 50%; background: #fff; color: var(--rojo); cursor: pointer; vertical-align: middle; }
.btn-mas:hover { background: var(--rojo); color: #fff; }
.reporte tr.libro td { border-top: 2px solid #ecdcda; }
.reporte tr.libreria td { font-size: 13px; color: #4a4242; background: #fffafa; }
.reporte tr.libreria td.nombre { padding-left: 26px; }
.reporte tr.sucursal td { font-size: 12px; color: #7a7070; background: #fffafa; }
.reporte tr.sucursal td.nombre { padding-left: 46px; }
.reporte tr.grupo th.dolares { background: #1d4f91; border-color: #163d70; }

/* Barra y pie propios del portal (Enrique 1/12 16:30: no copiar el menú de la página) */
.barra-titulo { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--rojo-claro); border-left: 1px solid rgba(255,255,255,.4); padding-left: 18px; }
.barra nav { justify-content: flex-end; }
.usuario .submenu-opciones { min-width: 230px; }
.pie-sencillo .contenedor { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 18px; padding-bottom: 18px; font-size: 14px; }
@media (max-width: 700px) { .barra-titulo { display: none; } .barra nav { justify-content: flex-start; } }

/* Saldo global y Mis servicios y pagos (1/12) */
.subtitulo-tabla { font-size: 17px; margin: 22px 0 10px; }
.tabla-reporte > .subtitulo-tabla:first-of-type, .tabla-reporte h3 + .subtitulo-tabla { margin-top: 4px; }
.reporte .fmt { color: var(--gris); font-size: 12px; font-weight: 400; }
.reporte td.debe { color: var(--rojo); font-weight: 700; }
.reporte tr.detalle td { font-size: 13px; color: #4a4242; background: #fffafa; }
.reporte tr.detalle td.nombre { padding-left: 26px; }
.reporte td.nombre { white-space: normal; }
.saldo-resumen { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 6px 0 8px; }
.saldo-caja { flex: 1 1 220px; background: var(--fondo); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.saldo-caja span { font-size: 13px; font-weight: 600; color: var(--gris); }
.saldo-caja strong { font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.saldo-caja strong.usd { font-size: 17px; }
.saldo-caja small { font-size: 12px; color: var(--gris); line-height: 1.35; }
.saldo-caja.resultado { background: #fff; border: 2px solid var(--gris); }
.saldo-caja.resultado.debe { border-color: var(--rojo); }
.saldo-caja.resultado.debe strong { color: var(--rojo); }
.saldo-caja.resultado.favor { border-color: #2e7d32; }
.saldo-caja.resultado.favor strong { color: #2e7d32; }
.saldo-signo { align-self: center; font-size: 26px; color: #b3a9a9; font-weight: 700; }
.saldo-detalle { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
@media (max-width: 700px) { .saldo-signo { display: none; } }

/* Regalías aplicadas a servicios (1/12) */
.etiqueta-regalias { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #e8f3ea; color: #2e7d32; font-size: 11px; font-weight: 700; white-space: nowrap; }
.nota-tabla { margin: -4px 0 10px; font-size: 13px; color: var(--gris); }

/* Filtros de los reportes (Ventas por periodo, Mis servicios y pagos) */
.filtros { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; background: #fff; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; box-shadow: 0 4px 14px rgba(60,20,20,.05); }
.filtros label { display: block; font-size: 13px; font-weight: 600; color: var(--gris); margin-bottom: 4px; }
.filtros input[type=date], .filtros select { font: inherit; padding: 8px 10px; border: 1.5px solid #e3d9d7; border-radius: 8px; background: #fff; }
.filtros .casilla { display: flex; align-items: center; gap: 6px; font-size: 14px; padding-bottom: 10px; margin: 0; color: var(--tinta); font-weight: 400; }

/* Botón Excel de los reportes (1/12) */
.btn-excel { background: #1d6f42; }

/* Celular (02/12): la lista de clientes no se sale de la pantalla y en las tablas anchas
   la primera columna (Libro / Título / Fecha) se queda fija al mover la tabla de lado.
   Las celdas con colspan (totales, renglones de librería/sucursal, encabezados de grupo) no se fijan.
   left: -18px = el padding de .tabla-reporte, para que la columna quede pegada a la orilla. */
@media (max-width: 700px) {
    .elegir-cliente { min-width: 0; max-width: 100%; flex: 1 1 100%; }
    .elegir-cliente select { min-width: 0; width: 100%; }
    .reporte :where(tbody td:first-child:not([colspan])) { background: #fff; }
    .reporte td:first-child:not([colspan]),
    .reporte th:first-child:not([colspan]) { position: sticky; left: -18px; z-index: 1; white-space: normal; min-width: 110px; max-width: 44vw; box-shadow: 2px 0 0 #ecdcda; }
}
