/* ===================== General ===================== */
html, body {
    margin: 0;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.cargando {
    padding: 3rem;
    text-align: center;
    color: #5b6b7b;
}

.contexto-barra {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
    text-transform: none;
}

.contexto-barra small {
    opacity: .85;
    font-size: .75rem;
}

.boton-salir {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    background: none;
    border: 0;
    padding: .5rem .75rem;
    font: inherit;
    color: #c62828;
    cursor: pointer;
    border-radius: 4px;
}

.boton-salir:hover { background: rgba(198, 40, 40, .08); }

.tarjeta-modulo {
    cursor: pointer;
    transition: transform .1s ease, box-shadow .1s ease;
}

.tarjeta-modulo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

/* ===================== Páginas de cuenta ===================== */
.cuenta-fondo {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background: radial-gradient(1200px 600px at 15% 20%, rgba(29, 233, 200, .16), transparent 60%), linear-gradient(135deg, #0B1622 0%, #0E3550 100%);
}

.cuenta-tarjeta {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .2);
    box-sizing: border-box;
}

.cuenta-marca {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    color: #0D6A9F;
    margin-bottom: 1.25rem;
}

.cuenta-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #0D6A9F;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
}

.cuenta-tarjeta h1 {
    font-size: 1.5rem;
    margin: 0 0 .5rem;
    color: #1d2a36;
}

.cuenta-tarjeta .subtitulo {
    color: #5b6b7b;
    margin: 0 0 1.25rem;
}

.cuenta-tarjeta form { display: flex; flex-direction: column; }

.cuenta-tarjeta fieldset {
    border: 1px solid #e0e5eb;
    border-radius: 8px;
    padding: 12px 16px 16px;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
}

.cuenta-tarjeta legend {
    font-weight: 600;
    color: #0D6A9F;
    padding: 0 6px;
}

.cuenta-tarjeta label {
    font-size: .875rem;
    font-weight: 600;
    color: #33414e;
    margin: 12px 0 4px;
}

.cuenta-tarjeta .opcional { font-weight: 400; color: #8795a1; }

.cuenta-tarjeta input,
.cuenta-tarjeta select {
    font: inherit;
    padding: 10px 12px;
    border: 1px solid #c9d2db;
    border-radius: 6px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.cuenta-tarjeta input:focus,
.cuenta-tarjeta select:focus {
    outline: 2px solid rgba(31, 78, 121, .35);
    border-color: #0D6A9F;
}

.boton-principal {
    margin-top: 20px;
    padding: 12px;
    border: 0;
    border-radius: 6px;
    background: #0D6A9F;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.boton-principal:hover { background: #0A5683; }

.boton-secundario {
    margin-top: 12px;
    padding: 8px;
    border: 1px solid #0D6A9F;
    border-radius: 6px;
    background: #fff;
    color: #0D6A9F;
    cursor: pointer;
}

.form-salir { margin-top: 12px; align-items: center; }

.boton-enlace {
    background: none;
    border: 0;
    color: #5b6b7b;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.alerta {
    padding: 10px 12px;
    border-radius: 6px;
    margin: 0 0 12px;
    font-size: .9rem;
}

.alerta.error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c2c0; }
.alerta.exito { background: #e8f5e9; color: #1b5e20; border: 1px solid #b9dfbc; }
.alerta.aviso { background: #fff8e1; color: #7a5300; border: 1px solid #f3dc9b; }

.ayuda { font-size: .8rem; color: #6b7a88; margin: 8px 0 0; }
.centro { text-align: center; }

/* ===================== Error de conexión de Blazor ===================== */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
    box-sizing: border-box;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===================== Configuración ===================== */
.fila-grupo td {
    background: #f4f6f9;
    color: #0D6A9F;
}

.json-auditoria {
    background: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 10px;
    font-size: .8rem;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===================== Catálogos ===================== */
.texto-secundario { color: #6b7a88; font-size: .8rem; }
.texto-alerta { color: #c62828; font-weight: 600; }
.cursor-pointer { cursor: pointer; }

/* ===================== Ventas y caja ===================== */
.tarjeta-destacada { border-left: 4px solid #0D6A9F; background: #eef4fb; }

.pos-total { font-size: 2rem; font-weight: 700; color: #0D6A9F; line-height: 1.1; }
.pos-carrito td { vertical-align: middle; }
.pos-carrito .mud-input-control { margin-top: 0; }
.venta-anulada { text-decoration: line-through; color: #9e9e9e; }

/* Ticket para impresora térmica de 80 mm */
.ticket {
    font-family: "Courier New", monospace;
    font-size: 12px;
    width: 72mm;
    margin: 0 auto;
    color: #000;
    background: #fff;
}
.ticket .centro { text-align: center; }
.ticket .derecha { text-align: right; }
.ticket-marco { max-height: 55vh; overflow: auto; border: 1px solid #e0e0e0; padding: 8px; }
.ticket hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.ticket table { width: 100%; border-collapse: collapse; }
.ticket td { padding: 0; vertical-align: top; font-size: 12px; }
.ticket .grande { font-size: 15px; font-weight: 700; }

/* La impresión del ticket se hace en un marco aparte (wwwroot/js/ventas.js) */

/* Punto de venta: barra para agregar el producto elegido */
.pos-entrada { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #cfd8e3; border-radius: 8px; background: #f7fafd; }
.pos-entrada-producto { flex: 1 1 220px; min-width: 180px; }
.pos-entrada-unidad { flex: 0 0 120px; }
.pos-entrada-num { flex: 0 0 110px; }
.pos-entrada-total { display: flex; flex-direction: column; align-items: flex-end; min-width: 90px; }
.pos-linea-activa td { background: #eef4fb; }
.pos-carrito tbody tr { cursor: pointer; }

/* ===================== Factura A5 + conduce ===================== */
.doc-a5-vista { max-height: 65vh; overflow: auto; background: #eef1f5; padding: 12px; }
.doc-a5 { position: relative; box-sizing: border-box; width: 148mm; min-height: 200mm; margin: 0 auto 12px auto; padding: 8mm; background: #fff; color: #000;
          font-family: Arial, sans-serif; font-size: 9pt; line-height: 1.3; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.doc-a5 .num { text-align: right; }
.doc-a5-encabezado { border-bottom: 1.5px solid #000; padding-bottom: 4px; margin-bottom: 6px; }
.doc-a5-empresa { font-size: 13pt; font-weight: 700; }
.doc-a5-fila { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.doc-a5-cliente { flex: 1 1 55%; }
.doc-a5-datos { flex: 1 1 45%; text-align: right; }
.doc-a5-titulo { font-size: 12pt; font-weight: 700; }
.doc-a5-ncf { font-weight: 700; }
.doc-a5-sin-valor { font-weight: 700; color: #c62828; }
.doc-a5-etiqueta { font-weight: 700; font-size: 8pt; text-transform: uppercase; }
.doc-a5-tabla { width: 100%; border-collapse: collapse; margin: 4px 0 6px 0; }
.doc-a5-tabla th { background: #e6e6e6; border: 1px solid #000; padding: 2px 4px; font-size: 8pt; text-align: left; }
.doc-a5-tabla th.num { text-align: right; }
.doc-a5-tabla td { border: 1px solid #000; padding: 2px 4px; font-size: 8.5pt; vertical-align: top; }
.doc-a5-tabla thead { display: table-header-group; }
.doc-a5-tabla tr { page-break-inside: avoid; }
.doc-a5-casilla { width: 18mm; }
.doc-a5-pie { align-items: flex-start; }
.doc-a5-despacho { flex: 1 1 55%; border: 1px solid #000; padding: 4px; min-height: 16mm; }
.doc-a5-despacho-destacado { margin-bottom: 6px; font-size: 10pt; }
.doc-a5-resumen { flex: 0 0 52mm; border-collapse: collapse; border: 1px solid #000; }
.doc-a5-resumen th { background: #e6e6e6; border-bottom: 1px solid #000; font-size: 8pt; padding: 2px; }
.doc-a5-resumen td { padding: 1px 4px; }
.doc-a5-total td { font-weight: 700; font-size: 10pt; border-top: 1px solid #000; }
.doc-a5-firmas { display: flex; justify-content: space-around; gap: 8mm; margin-top: 14mm; text-align: center; font-weight: 700; font-size: 8.5pt; }
.doc-a5-firmas > div { flex: 1 1 0; }
.doc-a5-linea { border-top: 1px solid #000; margin-bottom: 2px; }
.doc-a5-chico { font-size: 7.5pt; font-weight: 400; }
.doc-a5-centro { text-align: center; margin-top: 4mm; }
.doc-a5-sello { position: absolute; top: 45%; left: 0; right: 0; text-align: center; font-size: 40pt; font-weight: 700; color: rgba(198,40,40,.25);
                transform: rotate(-20deg); pointer-events: none; }

/* Pedidos por zona */
.zonas-resumen { display: flex; flex-wrap: wrap; gap: 10px; }
.zona-tarjeta { min-width: 140px; padding: 8px 14px; border: 1px solid #cfd8e3; border-radius: 8px; background: #fff; cursor: pointer; }
.zona-tarjeta:hover { border-color: #0D6A9F; }
.zona-activa { border: 2px solid #0D6A9F; background: #eef4fb; }
.zona-vacia { opacity: .6; }
.zona-nombre { font-weight: 600; }
.zona-num { font-size: 1.4rem; font-weight: 700; color: #0D6A9F; line-height: 1.2; }

/* Documentos en carta (estado de cuenta, reportes): mismas reglas del A5 con más ancho */
.doc-a5.doc-carta { width: 200mm; min-height: 0; }
.doc-a5.doc-carta .doc-a5-tabla td { font-size: 8pt; }
.fila-seleccionada { background: rgba(25, 118, 210, .08); }
.texto-tachado td { text-decoration: line-through; color: #9e9e9e; }
.texto-tachado td:last-child { text-decoration: none; }
.oculto-pantalla { display: none; }
.fila-error td { background: rgba(198, 40, 40, .07); }
.grafico-barras { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 4px 0; border-bottom: 1px solid #e0e0e0; overflow-x: auto; }
.grafico-barra { flex: 1 1 0; min-width: 14px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.grafico-relleno { width: 100%; background: var(--mud-palette-primary); border-radius: 3px 3px 0 0; opacity: .85; }
.grafico-barra span { font-size: 10px; color: #757575; margin-top: 2px; }

/* =====================================================================
   Formatos carta (8.5 x 11) de ventas: factura, conduce, cotización, nota de crédito,
   muestra, promoción y reposición. Prefijo fc- (ventas.imprimir copia solo estas reglas).
   ===================================================================== */
.fc-vista { max-height: 70vh; overflow: auto; background: #eef1f5; padding: 12px; }
.fc-hoja { position: relative; box-sizing: border-box; width: 200mm; min-height: 262mm; margin: 0 auto 12px auto; padding: 6mm 7mm;
           background: #fff; color: #000; font-family: Verdana, Tahoma, Arial, sans-serif; font-size: 8.5pt; line-height: 1.3;
           box-shadow: 0 1px 4px rgba(0,0,0,.25); display: flex; flex-direction: column; }
.fc-hoja * { box-sizing: border-box; }
.fc-num { text-align: right; white-space: nowrap; }
.fc-centro { text-align: center; }
.fc-negrita { font-weight: 700; }
.fc-chico { font-size: 7pt; }
.fc-rojo { color: #c62828; font-weight: 700; }
.fc-sello { position: absolute; top: 42%; left: 0; right: 0; text-align: center; font-size: 54pt; font-weight: 700; color: rgba(198,40,40,.22);
            transform: rotate(-20deg); pointer-events: none; }

/* Cabecera con logo */
.fc-cabecera { display: grid; grid-template-columns: 78mm 1fr 1fr; gap: 3mm; align-items: start; }
.fc-empresa { text-align: center; font-size: 8pt; }
.fc-logo { max-width: 70mm; max-height: 22mm; object-fit: contain; display: block; margin: 0 auto 1mm auto; }
.fc-empresa-nombre { font-size: 17pt; font-weight: 800; font-style: italic; letter-spacing: -.5px; line-height: 1.1; }
.fc-eslogan { font-style: italic; font-size: 7.5pt; margin-bottom: 1mm; }
.fc-titulo-centro { text-align: center; padding-top: 6mm; }
.fc-titulo { font-size: 11pt; font-weight: 700; letter-spacing: .5px; }
.fc-numero { font-size: 14pt; font-weight: 700; letter-spacing: 1px; font-family: "Courier New", monospace; }
.fc-fiscal { text-align: center; padding-top: 2mm; }
.fc-fiscal-titulo { font-size: 10pt; font-weight: 700; }
.fc-pares { display: grid; grid-template-columns: auto 1fr; column-gap: 2mm; row-gap: .5mm; font-size: 8pt; }
.fc-pares > b { font-weight: 700; white-space: nowrap; }
.fc-subcabecera { display: grid; grid-template-columns: 78mm 1fr 1fr; gap: 3mm; margin-top: 1mm; }

/* Líneas de datos del cliente (etiqueta + valor subrayado) */
.fc-campos { margin-top: 2mm; }
.fc-campo { display: flex; align-items: baseline; gap: 2mm; margin-top: 1.2mm; }
.fc-campo > b { font-size: 9.5pt; white-space: nowrap; }
.fc-campo > span { flex: 1 1 auto; border-bottom: 1px solid #000; min-height: 4.2mm; padding-left: 1mm; }
.fc-campo-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
.fc-caja { border: 1px solid #000; border-radius: 4mm; padding: 1.5mm 4mm 2mm 4mm; }

/* Tabla de productos con columnas que bajan hasta el pie */
.fc-tabla-marco { flex: 1 1 auto; display: flex; flex-direction: column; border: 1px solid #000; margin-top: 3mm; min-height: 95mm; }
.fc-tabla { width: 100%; border-collapse: collapse; }
.fc-tabla th { border-bottom: 1px solid #000; border-right: 1px solid #000; padding: 1.5mm 2mm; font-size: 9pt; text-align: left; font-weight: 700; }
.fc-tabla th:last-child, .fc-tabla td:last-child { border-right: 0; }
.fc-tabla td { border-right: 1px solid #000; padding: .8mm 2mm; font-family: "Courier New", monospace; font-size: 8.5pt; vertical-align: top; }
.fc-tabla thead { display: table-header-group; }
.fc-tabla tr { page-break-inside: avoid; }
.fc-tabla .fc-relleno td { height: 100%; }
.fc-tabla-alto { flex: 1 1 auto; height: 100%; }
.fc-fin { text-align: center; font-size: 7.5pt; letter-spacing: 1px; margin-top: .5mm; }

/* Pie: totales y firmas */
.fc-pie { display: grid; grid-template-columns: 1fr 1fr 70mm; gap: 4mm; align-items: end; margin-top: 2mm; }
.fc-totales { border-collapse: collapse; width: 100%; }
.fc-totales td { padding: .5mm 1.5mm; font-weight: 700; font-size: 9pt; }
.fc-totales td.fc-num { border: 1px solid #000; font-weight: 400; font-family: "Courier New", monospace; }
.fc-totales tr.fc-total td { font-size: 10pt; }
.fc-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 12mm; margin-top: 10mm; text-align: center; font-size: 9pt; }
.fc-firmas-3 { grid-template-columns: 1fr 1fr 1fr; gap: 1mm; }
.fc-linea { border-top: 1px solid #000; padding-top: .8mm; }
.fc-despacho { margin-top: 4mm; }
.fc-despacho .fc-campo > span { font-size: 8pt; }
.fc-nota { margin-top: 1.5mm; font-size: 7.5pt; }
.fc-qr { font-size: 7pt; }

/* Formato de entrega (muestra, promoción, reposición): sin logo, como el sistema anterior */
.fc-entrega .fc-num-doc { font-size: 12pt; font-weight: 700; margin-bottom: 1.5mm; }
.fc-entrega-datos { display: grid; grid-template-columns: 22mm 70mm 26mm 1fr; row-gap: .6mm; font-size: 8.5pt; }
.fc-entrega-datos > b { font-weight: 700; }
.fc-entrega-cliente { margin-top: 3mm; font-size: 8.5pt; }
.fc-entrega-cliente .fc-nombre { font-weight: 700; font-size: 9.5pt; }
.fc-doble-linea { border-bottom: 3px double #000; margin-top: .8mm; }
.fc-entrega-tabla { width: 100%; border-collapse: collapse; margin-top: 1.5mm; font-size: 8pt; }
.fc-entrega-tabla th { font-weight: 700; text-align: left; border-bottom: 1px solid #000; border-top: 1px solid #000; padding: .8mm 1.5mm; }
.fc-entrega-tabla td { padding: .8mm 1.5mm; vertical-align: top; }
.fc-entrega-tabla .fc-subtotal td { border-top: 1px solid #000; font-size: 7.5pt; }
.fc-entrega-direccion { margin-top: 4mm; font-size: 8.5pt; }
.fc-entrega-direccion .fc-etiqueta { font-family: "Courier New", monospace; font-weight: 700; letter-spacing: .5px; }
.fc-url { word-break: break-all; margin-top: 2.5mm; }
.fc-espaciador { flex: 1 1 auto; }
.fc-entrega-tabla th.fc-num { text-align: right; }

/* Textos largos (enlaces, direcciones sin espacios): se parten para no salirse de la hoja */
.fc-hoja div, .fc-hoja span, .fc-hoja td { overflow-wrap: anywhere; word-break: normal; }
.fc-campo > span { min-width: 0; }
.fc-campo-doble > .fc-campo { min-width: 0; }
.fc-despacho-con-mapa { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 4mm; align-items: center; }
.fc-despacho-datos { min-width: 0; }
.fc-ubicacion { display: flex; align-items: center; gap: 2.5mm; max-width: 100%; }
.fc-qr-mapa { width: 21mm; height: 21mm; flex: 0 0 21mm; image-rendering: pixelated; }
.fc-ubicacion-texto { font-size: 7.5pt; line-height: 1.25; min-width: 0; max-width: 55mm; }
.fc-ubicacion-texto b { font-size: 8pt; }

/* ===================== Imagen del producto ===================== */
.producto-mini {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    border-radius: 6px; overflow: hidden; background: #f1f3f6; border: 1px solid #e3e7ec; color: #9aa4b2;
}
.producto-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.producto-imagen-grande {
    width: 160px; height: 160px; border-radius: 10px; overflow: hidden; flex: 0 0 auto;
    display: flex; align-items: center; justify-content: center; background: #f1f3f6; border: 1px solid #e3e7ec;
}
.producto-imagen-grande img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* =====================================================================
   Dashboard y gráficos. Colores de serie en orden fijo (paleta validada para daltonismo).
   ===================================================================== */
:root {
    --serie-1: #1688C9; --serie-2: #eb6834; --serie-3: #17C6B0; --serie-4: #eda100;
    --serie-5: #e87ba4; --serie-6: #008300; --serie-7: #6250d6; --serie-8: #e34948;
    --dash-borde: #e4e8ee; --dash-texto: #1d2733; --dash-suave: #5f6b7a; --dash-tenue: #8a95a3;
}

.dash-cabecera { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.dash-periodos { display: inline-flex; background: #fff; border: 1px solid var(--dash-borde); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.dash-periodos button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: .85rem; color: var(--dash-suave); cursor: pointer; }
.dash-periodos button:hover { background: #f1f4f8; color: var(--dash-texto); }
.dash-periodos button.activo { background: var(--mud-palette-primary); color: #fff; }

.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { display: block; background: #fff; border: 1px solid var(--dash-borde); border-radius: 12px; padding: 16px 18px; color: var(--dash-texto);
       text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
a.kpi:not(.kpi-sin-enlace):hover { box-shadow: 0 6px 18px rgba(16, 42, 67, .08); transform: translateY(-1px); }
.kpi-cabeza { display: flex; justify-content: space-between; align-items: center; }
.kpi-titulo { font-size: .8rem; color: var(--dash-suave); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.kpi-icono { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.kpi-valor { font-size: 1.6rem; font-weight: 700; margin: 8px 0 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi-pie { display: flex; gap: 8px; align-items: center; font-size: .8rem; color: var(--dash-tenue); min-height: 20px; }
.kpi-sube, .kpi-baja { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; padding: 1px 6px; border-radius: 6px; }
.kpi-sube { color: #0f7a4f; background: #e5f5ee; }
.kpi-baja { color: #b3261e; background: #fbe9e8; }

.dash-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 12px; }
.dash-mini a { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--dash-borde);
               color: var(--dash-texto); text-decoration: none; }
.dash-mini a:hover { border-color: #c9d3df; }
.dash-mini span { font-size: .78rem; color: var(--dash-suave); }
.dash-mini b { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.dash-mini small { font-size: .75rem; color: var(--dash-tenue); }
.dash-mini small.dash-alerta { color: #b3261e; font-weight: 600; }

.dash-panel { background: #fff; border: 1px solid var(--dash-borde); border-radius: 12px; padding: 16px 18px; height: 100%; }
.dash-panel-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.dash-panel-titulo span { font-weight: 600; color: var(--dash-texto); }
.dash-panel-titulo small { color: var(--dash-tenue); font-size: .78rem; }
.dash-panel-titulo a { font-size: .8rem; color: var(--mud-palette-primary); text-decoration: none; }

.dash-pendientes { display: flex; flex-direction: column; }
.dash-pendientes a { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #f0f2f5; color: var(--dash-texto); text-decoration: none; }
.dash-pendientes a:last-child { border-bottom: 0; }
.dash-pendientes a:hover { background: #f7f9fb; }
.dash-pendientes span { flex: 1; }
.dash-pendientes b { background: #eef4fb; color: var(--mud-palette-primary); border-radius: 10px; padding: 1px 9px; font-size: .85rem; }

/* Gráficos SVG: el tooltip aparece con :hover (sin ir al servidor) */
.graf { width: 100%; }
.graf-svg { width: 100%; height: auto; display: block; overflow: visible; }
.graf-guia { stroke: #eef1f5; stroke-width: 1; }
.graf-base { stroke: #c9d1db; stroke-width: 1; }
.graf-eje { fill: var(--dash-tenue); font-size: 11px; }
.graf-zona { fill: transparent; }
.graf-grupo:hover .graf-zona { fill: rgba(31, 78, 121, .05); }
.graf-cruz { stroke: #9aa7b6; stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.graf-punto { opacity: 0; stroke: #fff; stroke-width: 2; }
.graf-grupo:hover .graf-cruz, .graf-grupo:hover .graf-punto { opacity: 1; }
.graf-tip { opacity: 0; pointer-events: none; transition: opacity .1s; }
.graf-grupo:hover .graf-tip { opacity: 1; }
.graf-tip rect { fill: #1d2733; opacity: .94; }
.graf-tip text { fill: #e8edf3; font-size: 11px; }
.graf-tip .graf-tip-titulo { font-weight: 600; fill: #fff; }
.graf-tip .graf-tip-valor { font-weight: 600; fill: #fff; font-variant-numeric: tabular-nums; }
.graf-leyenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; color: var(--dash-suave); margin-bottom: 6px; }
.graf-leyenda span, .graf-dona-leyenda div { display: inline-flex; align-items: center; gap: 6px; }
.graf-leyenda i, .graf-dona-leyenda i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.graf-vacio { color: var(--dash-tenue); font-size: .9rem; padding: 28px 0; text-align: center; }

.graf-dona { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.graf-dona-svg { width: 170px; height: 170px; flex: 0 0 auto; }
.graf-dona-parte { stroke: #fff; stroke-width: 1; transition: opacity .1s; }
.graf-dona-svg:hover .graf-dona-parte { opacity: .55; }
.graf-dona-svg .graf-dona-parte:hover { opacity: 1; }
.graf-dona-total { font-size: 22px; font-weight: 700; fill: var(--dash-texto); }
.graf-dona-leyenda { display: flex; flex-direction: column; gap: 7px; font-size: .85rem; flex: 1 1 160px; min-width: 0; }
.graf-dona-leyenda div { width: 100%; }
.graf-dona-nombre { flex: 1; color: var(--dash-texto); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.graf-dona-leyenda b { font-variant-numeric: tabular-nums; }
.graf-dona-pct { color: var(--dash-tenue); width: 48px; text-align: right; font-variant-numeric: tabular-nums; }

.graf-ranking { display: flex; flex-direction: column; gap: 11px; }
.graf-ranking-texto { display: flex; justify-content: space-between; gap: 10px; font-size: .87rem; }
.graf-ranking-texto span, .graf-ranking-texto a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--dash-texto); text-decoration: none; }
.graf-ranking-texto b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.graf-ranking-pista { height: 8px; background: #f0f3f7; border-radius: 4px; margin-top: 4px; overflow: hidden; }
.graf-ranking-barra { height: 100%; border-radius: 4px; }
.graf-ranking-detalle { font-size: .75rem; color: var(--dash-tenue); margin-top: 2px; }

/* ===================== Menú lateral ===================== */
.mud-drawer .mud-navmenu .mud-nav-link { border-radius: 8px; margin: 1px 8px; width: auto; }
.mud-drawer .mud-navmenu .mud-nav-link.active,
.mud-drawer .mud-navmenu .mud-nav-link.active:not(.mud-nav-link-disabled) { background: rgba(255, 255, 255, .16) !important; color: #fff !important; font-weight: 600; }
.mud-drawer .mud-navmenu .mud-nav-link.active .mud-nav-link-icon,
.mud-drawer .mud-navmenu .mud-nav-link.active .mud-nav-link-text { color: #fff !important; }
.mud-drawer .mud-navmenu .mud-nav-link:hover:not(.active) { background: rgba(255, 255, 255, .07); }
.mud-drawer .mud-nav-group > .mud-nav-link { font-weight: 600; }
.menu-marca { display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; color: #fff; }
.menu-marca-logo { width: 34px; height: 34px; border-radius: 9px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; }
.menu-marca b { display: block; font-size: .95rem; line-height: 1.2; }
.menu-marca small { display: block; font-size: .75rem; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }

.subida-sin-lista .mud-chip { display: none; }

/* Saldo a favor del cliente (anticipos y notas de crédito) */
.pos-saldo-favor { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 10px; border-radius: 8px;
                   background: #e8f6ef; color: #0f6b45; font-size: .85rem; }
.pos-saldo-favor .mud-switch { margin: 0; }

.dash-tabla { width: 100%; border-collapse: collapse; font-size: .87rem; }
.dash-tabla th { text-align: left; font-weight: 600; color: var(--dash-suave); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em;
                 padding: 6px 6px; border-bottom: 1px solid var(--dash-borde); }
.dash-tabla td { padding: 7px 6px; border-bottom: 1px solid #f0f2f5; color: var(--dash-texto); }
.dash-tabla tr:last-child td { border-bottom: 0; }
.dash-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-tabla a { color: var(--mud-palette-primary); text-decoration: none; font-weight: 600; }
.dash-tabla-nombre { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-vencida { color: #b3261e; font-weight: 600; }
.dash-pronto { color: #a35a00; font-weight: 600; }


/* ===================== Página pública y registro ===================== */
a.cuenta-marca { text-decoration: none; }
.cuenta-tarjeta:has(.registro-form) { max-width: 640px; }
.campo-trampa { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fila-dos { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.fila-dos > div { display: flex; flex-direction: column; }
@media (max-width: 560px) { .fila-dos { grid-template-columns: 1fr; } }
.cuenta-tarjeta label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: #33414e; margin-top: 4px; }
.cuenta-tarjeta label.check input { width: auto; margin-top: 3px; }
.enlace-boton { display: block; text-decoration: none; margin-top: 16px; }
.cuenta-tarjeta a { color: #0D6A9F; }

.pub { min-height: 100vh; background: #f6f8fb; color: #1d2733; display: flex; flex-direction: column; }
.pub-barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px clamp(16px, 4vw, 48px);
             background: #fff; border-bottom: 1px solid #e4e8ee; position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.pub-marca { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #0D6A9F; text-decoration: none; font-size: 1.05rem; }
.pub-barra nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-enlace { color: #0D6A9F; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
.pub-enlace:hover { background: #eef4fb; }
.pub-boton, .pub-boton-borde { display: inline-block; text-decoration: none; font-weight: 600; padding: 9px 16px; border-radius: 8px; }
.pub-boton { background: #0D6A9F; color: #fff; }
.pub-boton:hover { background: #0A5683; }
.pub-boton-borde { border: 1.5px solid #0D6A9F; color: #0D6A9F; background: #fff; }
.pub-boton-borde:hover { background: #eef4fb; }
.pub-boton.grande, .pub-boton-borde.grande { padding: 13px 22px; font-size: 1rem; }

.pub-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(24px, 4vw, 56px); align-items: center;
            padding: clamp(32px, 6vw, 80px) clamp(16px, 4vw, 48px); background: radial-gradient(1200px 600px at 15% 20%, rgba(29, 233, 200, .16), transparent 60%), linear-gradient(135deg, #0B1622 0%, #0E3550 100%); color: #fff; }
.pub-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); line-height: 1.15; margin: 14px 0 16px; letter-spacing: -.01em; }
.pub-hero p { font-size: 1.05rem; line-height: 1.6; color: #dbe7f3; max-width: 620px; margin: 0; }
.pub-etiqueta { display: inline-block; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 4px 12px; font-size: .82rem; }
.pub-acciones { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.pub-hero .pub-boton { background: #fff; color: #0D6A9F; }
.pub-hero .pub-boton:hover { background: #eef4fb; }
.pub-hero .pub-boton-borde { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.pub-hero .pub-boton-borde:hover { background: rgba(255,255,255,.1); }
.pub-mock { background: #fff; border-radius: 14px; box-shadow: 0 24px 48px rgba(0,0,0,.25); padding: 14px 16px 18px; color: #1d2733; }
.pub-mock-barra { display: flex; gap: 6px; margin-bottom: 14px; }
.pub-mock-barra i { width: 10px; height: 10px; border-radius: 50%; background: #e4e8ee; }
.pub-mock-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pub-mock-kpis div { border: 1px solid #e4e8ee; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.pub-mock-kpis small { color: #5f6b7a; font-size: .7rem; text-transform: uppercase; letter-spacing: .03em; }
.pub-mock-kpis b { font-size: .95rem; }
.pub-mock-barras { display: flex; align-items: flex-end; gap: 6px; height: 140px; margin-top: 16px; padding-top: 8px; border-top: 1px solid #f0f2f5; }
.pub-mock-barras span { flex: 1; background: #1688C9; border-radius: 4px 4px 0 0; opacity: .85; }
.pub-mock-barras span:last-child { background: #17C6B0; opacity: 1; }

.pub-seccion { padding: clamp(32px, 5vw, 64px) clamp(16px, 4vw, 48px); }
.pub-seccion h2 { text-align: center; font-size: clamp(1.4rem, 2.4vw, 1.9rem); margin: 0 0 28px; }
.pub-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; }
.pub-funcion { background: #fff; border: 1px solid #e4e8ee; border-radius: 12px; padding: 18px; }
.pub-funcion h3 { font-size: 1rem; margin: 10px 0 6px; }
.pub-funcion p { margin: 0; color: #5f6b7a; font-size: .9rem; line-height: 1.5; }
.pub-icono { font-size: 1.5rem; }
.pub-pasos-fondo { background: #fff; border-top: 1px solid #e4e8ee; }
.pub-pasos { list-style: none; counter-reset: paso; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
             max-width: 1000px; margin: 0 auto 28px; padding: 0; }
.pub-pasos li { counter-increment: paso; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px; background: #f6f8fb; }
.pub-pasos li::before { content: counter(paso); width: 32px; height: 32px; border-radius: 50%; background: #0D6A9F; color: #fff;
                        display: inline-flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 4px; }
.pub-pasos span { color: #5f6b7a; font-size: .92rem; line-height: 1.5; }
.pub-pie { margin-top: auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px clamp(16px, 4vw, 48px);
           color: #8a95a3; font-size: .85rem; border-top: 1px solid #e4e8ee; background: #fff; }
@media (max-width: 860px) { .pub-hero { grid-template-columns: 1fr; } .pub-hero-panel { display: none; } }

/* ===================== Panel de suscripciones ===================== */
.sus-filtros { display: flex; flex-wrap: wrap; gap: 6px; }
.sus-filtros button { border: 1px solid var(--dash-borde); background: #fff; border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .85rem;
                      color: var(--dash-suave); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.sus-filtros button b { background: #eef1f5; border-radius: 99px; padding: 0 7px; font-size: .78rem; color: var(--dash-texto); }
.sus-filtros button.activo { background: var(--mud-palette-primary); border-color: var(--mud-palette-primary); color: #fff; }
.sus-filtros button.activo b { background: rgba(255,255,255,.25); color: #fff; }
.sus-estado { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.sus-estado.pendiente { background: #fff4d6; color: #7a5300; }
.sus-estado.activa { background: #e3f4ea; color: #146c3a; }
.sus-estado.aviso { background: #fff0e0; color: #8a4500; }
.sus-estado.gracia { background: #ffe3e0; color: #a1251b; }
.sus-estado.vencida, .sus-estado.rechazada { background: #fde7e7; color: #8f1d1d; }
.sus-estado.inhabilitada { background: #eceff3; color: #4a5562; }
.sus-clave { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem; letter-spacing: .08em; background: #f3f6fa; border: 1px dashed #b9c6d4;
             border-radius: 8px; padding: 10px 14px; text-align: center; user-select: all; }
.aviso-suscripcion b { font-weight: 600; }
.lista-motivos { margin: 0 0 8px; padding-left: 20px; color: #a1251b; font-weight: 500; }
.clave-manual { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; font-size: 1rem; user-select: all; }
.pub-legal { max-width: 820px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 32px); line-height: 1.6; }
.pub-legal h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 4px; }
.pub-legal h2 { font-size: 1.1rem; margin: 26px 0 8px; color: #0D6A9F; }
.pub-legal-fecha { color: #8a95a3; font-size: .9rem; margin: 0 0 18px; }
.pub-legal a, .pub-pie a { color: #0D6A9F; }
.captcha { margin-top: 14px; }


/* ===================== Marca ECodePOS ===================== */
.marca-logo { width: 38px; height: 38px; border-radius: 9px; display: block; flex: none; }
img.menu-marca-logo { background: none; object-fit: cover; }
.cuenta-autor { text-align: center; color: rgba(255, 255, 255, .7); font-size: .8rem; margin: 16px 0 0; }
.cuenta-autor a { color: #5FE7D3; text-decoration: none; }
.cuenta-autor a:hover { text-decoration: underline; }
.pub-pie a { color: inherit; }
.pub-hero .pub-etiqueta { border-color: rgba(29, 233, 200, .45); color: #bff6ec; }

/* Blazor enfoca el título al navegar: sin recuadro visible */
h1:focus, h1:focus-visible { outline: none; }
