:root {
    --azul-principal: #163b66;
    --azul-oscuro: #102b4d;
    --azul-brillante: #2457db;
    --fondo: #f3f6fb;
    --texto: #101828;
    --gris: #667085;
    --borde: #dbe4f0;
    --blanco: #ffffff;
    --rojo: #ef233c;
    --verde: #16a34a;
    --amarillo: #f59e0b;
    --sombra: 0 10px 25px rgba(16, 43, 77, .10);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fondo);
    color: var(--texto);
}

a {
    text-decoration: none;
}

.topbar {
    height: 70px;
    background: var(--blanco);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.btn-menu {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 12px;
    background: #eef2f7;
    color: var(--azul-oscuro);
    font-size: 22px;
    cursor: pointer;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 22px;
    font-weight: 800;
    color: var(--texto);
}

.brand img {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.usuario-top {
    margin-left: auto;
    background: linear-gradient(135deg, var(--azul-principal), var(--azul-brillante));
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.usuario-top i {
    background: rgba(255,255,255,.18);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}

.layout {
    display: flex;
    padding-top: 70px;
    min-height: 100vh;
}

.sidebar {
    width: 275px;
    background: var(--azul-principal);
    color: white;
    min-height: calc(100vh - 70px);
    position: fixed;
    top: 70px;
    left: 0;
    padding: 28px 12px;
    transition: .25s ease;
    z-index: 50;
}

.bienvenida {
    padding: 0 4px 20px;
    line-height: 1.6;
}

.bienvenida small,
.bienvenida strong {
    display: block;
}

.menu-link {
    color: #eaf2ff;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 17px 16px;
    margin: 8px 0;
    border-radius: 14px;
    font-weight: 700;
    transition: .2s;
}

.menu-link i {
    width: 24px;
    text-align: center;
    font-size: 20px;
}

.menu-link:hover,
.menu-link.activo {
    background: var(--azul-oscuro);
    color: white;
}

.contenido {
    width: calc(100% - 275px);
    margin-left: 275px;
    padding: 28px;
}

.card {
    background: var(--blanco);
    border-radius: 18px;
    padding: 26px;
    box-shadow: var(--sombra);
    margin-bottom: 24px;
}

.card h1,
.card h2,
.card h3 {
    color: var(--azul-brillante);
    margin-top: 0;
}

.grid {
    display: grid;
    gap: 18px;
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat {
    background: white;
    border-radius: 18px;
    padding: 24px;
    box-shadow: var(--sombra);
    border-left: 6px solid var(--azul-brillante);
}

.stat small {
    color: var(--gris);
    font-weight: 700;
}

.stat strong {
    display: block;
    font-size: 30px;
    margin-top: 8px;
}

.formulario {
    display: grid;
    gap: 16px;
}

.campo label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: #27364b;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 13px 14px;
    font-size: 15px;
    outline: none;
    background: white;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: var(--azul-brillante);
    box-shadow: 0 0 0 4px rgba(36, 87, 219, .12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 12px;
    padding: 13px 18px;
    font-weight: 800;
    cursor: pointer;
    color: white;
    background: var(--azul-brillante);
    transition: .2s;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(.95);
}

.btn-secundario {
    background: var(--azul-principal);
}

.btn-rojo {
    background: var(--rojo);
}

.btn-verde {
    background: var(--verde);
}

.tabla-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid var(--borde);
}

th {
    background: #f8fbff;
    color: #27364b;
}

.badge {
    display: inline-block;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.activo,
.badge.aprobado {
    background: #dcfce7;
    color: #166534;
}

.badge.vencido,
.badge.pendiente {
    background: #fef3c7;
    color: #92400e;
}

.badge.cortado,
.badge.rechazado,
.badge.cancelado {
    background: #fee2e2;
    color: #991b1b;
}

.alerta {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.alerta.azul {
    background: #eaf1ff;
    color: #1e3a8a;
    border-left: 5px solid var(--azul-brillante);
}

.alerta.verde {
    background: #dcfce7;
    color: #166534;
    border-left: 5px solid var(--verde);
}

.alerta.roja {
    background: #fee2e2;
    color: #991b1b;
    border-left: 5px solid var(--rojo);
}

.anuncio {
    border-left: 5px solid var(--rojo);
    background: #fbfdff;
    padding: 18px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.anuncio h3 {
    color: var(--texto);
    margin: 0 0 8px;
}

.sugerencias {
    position: relative;
}

.sugerencia {
    width: 100%;
    display: block;
    text-align: left;
    background: white;
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
}

.sugerencia:hover {
    border-color: var(--azul-brillante);
    background: #f7faff;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;

    background: 
        linear-gradient(rgba(16, 43, 77, 0.45), rgba(16, 43, 77, 0.45)),
        url("../img/logos/fondo.png") !important;

    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    padding: 32px;
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(0,0,0,.18);
}

.login-card h1 {
    margin-top: 0;
    color: var(--azul-principal);
}

.pago-publico {
    width: 100%;
    max-width: 850px;
}

@media (max-width: 900px) {
    .brand span {
        font-size: 18px;
    }

    .usuario-top span {
        display: none;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.abierto {
        transform: translateX(0);
    }

    .contenido {
        width: 100%;
        margin-left: 0;
        padding: 18px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .topbar {
        padding: 0 12px;
    }

    .brand img {
        width: 38px;
        height: 38px;
    }

    .brand span {
        font-size: 15px;
    }

    .card,
    .login-card {
        padding: 20px;
    }
}

/* Mejoras visuales para que los módulos no se vean tan blancos */
body {
    background:
        radial-gradient(circle at top right, rgba(36, 87, 219, .12), transparent 28%),
        linear-gradient(180deg, #eef4ff 0%, #f7f9fc 48%, #edf3fb 100%);
}

.contenido {
    background: transparent;
}

.card {
    border: 1px solid rgba(22, 59, 102, .08);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.card-hero {
    background:
        linear-gradient(135deg, rgba(36, 87, 219, .08), rgba(255, 255, 255, .96)),
        #ffffff;
    border-top: 5px solid var(--azul-brillante);
}

.card-header-line {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.subtexto {
    color: var(--gris);
    margin-top: -4px;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

.panel-desplegable {
    display: none;
    margin-top: 18px;
    padding: 20px;
    border: 1px solid rgba(36, 87, 219, .18);
    border-radius: 18px;
    background: #f4f8ff;
}

.panel-desplegable.abierto {
    display: block;
    animation: desplegarPanel .18s ease-in-out;
}

@keyframes desplegarPanel {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.acciones-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.acciones-tabla {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-mini {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.btn-amarillo {
    background: var(--amarillo);
}

.filtro-linea {
    max-width: 760px;
}

.ayuda {
    display: block;
    color: var(--gris);
    margin-top: 6px;
}

.info-cliente-seleccionado {
    margin-top: 10px;
}

tr:nth-child(even) td {
    background: rgba(238, 244, 255, .45);
}

.ticket-termico {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto 30px;
    background: white;
    color: #111827;
    padding: 14px;
    border-radius: 10px;
    border: 1px dashed #9aa8bd;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.35;
    box-shadow: var(--sombra);
}

.ticket-termico p {
    margin: 6px 0;
}

.ticket-centro {
    text-align: center;
}

.ticket-linea {
    border-top: 1px dashed #111827;
    margin: 9px 0;
}

.ticket-total {
    font-size: 15px;
    text-align: right;
}

@media print {
    body {
        background: white !important;
    }

    .topbar,
    .sidebar,
    .no-print,
    .menu-link,
    .btn {
        display: none !important;
    }

    .layout {
        display: block;
        padding-top: 0;
    }

    .contenido {
        width: 100%;
        margin-left: 0;
        padding: 0;
    }

    .ticket-termico {
        width: 80mm;
        box-shadow: none;
        border: 0;
        margin: 0;
        padding: 6px;
    }
}

@media (max-width: 760px) {
    .card-header-line {
        flex-direction: column;
    }

    .card-header-line .btn,
    .acciones-form .btn {
        width: 100%;
    }
}

.badge.inactivo {
    background: #e5e7eb;
    color: #374151;
}
.solo-impresion {
    display: none;
}

@media print {
    .solo-impresion {
        display: block !important;
    }

    .historial-impresion {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .encabezado-reporte {
        text-align: center;
        margin-bottom: 15px;
    }

    .encabezado-reporte h2 {
        margin-bottom: 5px;
        color: #000 !important;
    }

    .encabezado-reporte p {
        margin: 3px 0;
        color: #000 !important;
        font-size: 13px;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        font-size: 11px;
    }

    table th,
    table td {
        border: 1px solid #000 !important;
        padding: 5px !important;
        color: #000 !important;
        background: #fff !important;
    }

    table th {
        font-weight: bold;
        text-align: left;
    }

    .alerta.azul {
        border: 1px solid #000 !important;
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
}
/* Diseño reorganizado 2026: botones más claros y secciones más intuitivas */
:root {
    --azul-principal: #0f2544;
    --azul-oscuro: #0b1b31;
    --azul-brillante: #2563eb;
    --fondo: #eef3f9;
    --borde: #d7e0ec;
    --sombra: 0 14px 35px rgba(15, 37, 68, .11);
}

.topbar {
    height: 76px;
    border-bottom: 1px solid rgba(15, 37, 68, .08);
}

.layout {
    padding-top: 76px;
}

.sidebar {
    top: 76px;
    min-height: calc(100vh - 76px);
    background: linear-gradient(180deg, var(--azul-oscuro), var(--azul-principal));
    padding: 20px 14px;
}

.bienvenida {
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 16px;
}

.menu-link {
    margin: 6px 0;
    padding: 14px 15px;
}

.contenido {
    padding: 32px;
}

.card {
    border-radius: 22px;
}

.card-hero {
    border-top: 0;
    border-left: 6px solid var(--azul-brillante);
}

.card-header-line {
    align-items: center;
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat {
    border-left: 0;
    border-top: 5px solid var(--azul-brillante);
}

.stat strong {
    font-size: 27px;
}

.acciones-dashboard {
    margin: 18px 0;
}

.acciones-dashboard .btn,
.card-header-line .btn,
.acciones-form .btn {
    min-width: 150px;
}

.acciones-tabla {
    min-width: 230px;
}

.acciones-tabla .btn-mini {
    min-width: 86px;
}

.boton-filtro {
    display: flex;
    align-items: end;
}

.resumen-stats {
    margin-bottom: 10px;
}

@media (max-width: 1180px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .contenido {
        padding: 18px;
    }
}

@media print {
    .resumen-impresion {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .resumen-stats {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }

    .resumen-stats .stat {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        padding: 8px !important;
    }

    .resumen-stats .stat strong,
    .resumen-stats .stat small {
        color: #000 !important;
        font-size: 11px !important;
    }
}
