/* ============================================================
   LIEN TV
   Estilos globales
   Archivo:
   Estilos/Core/styles.css
   ============================================================ */


/* ============================================================
   RESET BÁSICO
   ============================================================ */

*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    margin: 0;
    padding: 0;
}


body {
    margin: 0;
    padding: 0;

    min-height: 100vh;

    background: #f5f7fb;

    color: #1f2937;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    font-size: 14px;

    line-height: 1.5;
}


button,
input,
select,
textarea {
    font: inherit;
}


button {
    cursor: pointer;
}


a {
    color: inherit;
}


/* ============================================================
   CONTENEDOR GENERAL
   ============================================================ */

.pagina-contenedor {
    width: min(
        1450px,
        calc(100% - 40px)
    );

    margin: 0 auto;

    padding: 28px 0 40px;
}


/* ============================================================
   CABECERA DE PÁGINA
   ============================================================ */

.pagina-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}


.pagina-cabecera-titulos {
    min-width: 0;
}


.pagina-cabecera-titulos h1 {
    margin: 0;

    color: #111827;

    font-size: 28px;
    font-weight: 700;

    letter-spacing: -0.4px;
}


.pagina-cabecera-titulos p {
    margin: 5px 0 0;

    color: #6b7280;

    font-size: 14px;
}


.pagina-cabecera-derecha {
    display: flex;
    align-items: center;

    gap: 14px;

    flex-wrap: wrap;
}


/* ============================================================
   USUARIO CONECTADO
   ============================================================ */

.usuario-conectado {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 8px 12px;

    border: 1px solid #e5e7eb;

    border-radius: 10px;

    background: #ffffff;
}


.usuario-avatar {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #2563eb;

    color: #ffffff;

    font-weight: 700;
}


.usuario-datos {
    min-width: 0;

    display: flex;
    flex-direction: column;
}


.usuario-datos strong {
    max-width: 220px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #111827;

    font-size: 13px;
}


.usuario-datos small {
    max-width: 220px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #6b7280;

    font-size: 11px;
}


/* ============================================================
   BOTONES
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 7px;

    min-height: 40px;

    padding: 9px 15px;

    border: 1px solid transparent;

    border-radius: 8px;

    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        transform 0.08s ease;
}


.btn:active {
    transform: translateY(1px);
}


.btn:disabled {
    opacity: 0.6;

    cursor: not-allowed;
}


.btn-primary {
    background: #2563eb;

    border-color: #2563eb;

    color: #ffffff;
}


.btn-primary:hover {
    background: #1d4ed8;

    border-color: #1d4ed8;
}


.btn-secondary {
    background: #ffffff;

    border-color: #d1d5db;

    color: #374151;
}


.btn-secondary:hover {
    background: #f9fafb;

    border-color: #9ca3af;
}


.btn-light {
    background: #f9fafb;

    border-color: #e5e7eb;

    color: #374151;
}


.btn-light:hover {
    background: #f3f4f6;
}


.btn-danger {
    background: #dc2626;

    border-color: #dc2626;

    color: #ffffff;
}


.btn-danger:hover {
    background: #b91c1c;

    border-color: #b91c1c;
}


.btn-sm {
    min-height: 34px;

    padding: 6px 10px;

    font-size: 12px;
}


/* ============================================================
   FORMULARIOS
   ============================================================ */

.form-grupo {
    display: flex;
    flex-direction: column;

    gap: 7px;
}


.form-grupo label,
.filtro-grupo label {
    color: #374151;

    font-size: 13px;
    font-weight: 600;
}


input,
select,
textarea,
.campo-select {
    width: 100%;

    border: 1px solid #d1d5db;

    border-radius: 8px;

    background: #ffffff;

    color: #111827;

    outline: none;
}


input,
select,
.campo-select {
    min-height: 40px;

    padding: 8px 11px;
}


textarea {
    min-height: 100px;

    padding: 10px 11px;

    resize: vertical;
}


input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;

    box-shadow:
        0 0 0 3px rgba(37, 99, 235, 0.12);
}


input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}


/* ============================================================
   PANELES
   ============================================================ */

.panel-filtros,
.panel-tabla {
    background: #ffffff;

    border: 1px solid #e5e7eb;

    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, 0.04);
}


.panel-filtros {
    margin-bottom: 18px;

    padding: 18px;
}


.panel-tabla {
    overflow: hidden;
}


/* ============================================================
   FILTROS
   ============================================================ */

.form-filtros {
    display: grid;

    grid-template-columns:
        minmax(180px, 240px)
        minmax(180px, 1fr)
        minmax(180px, 1fr)
        auto;

    gap: 14px;

    align-items: end;
}


.filtro-grupo {
    display: flex;
    flex-direction: column;

    gap: 6px;
}


.filtro-acciones {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}


/* ============================================================
   RESUMEN DE LISTADO
   ============================================================ */

.listado-resumen {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin: 14px 0;

    color: #6b7280;
}


.listado-resumen strong {
    color: #111827;
}


.ayuda-orden {
    color: #6b7280;
}


/* ============================================================
   TABLAS
   ============================================================ */

.tabla-responsive {
    width: 100%;

    overflow-x: auto;
}


table {
    width: 100%;

    border-collapse: collapse;
}


th,
td {
    padding: 12px 14px;

    border-bottom: 1px solid #e5e7eb;

    text-align: left;

    vertical-align: middle;
}


th {
    background: #f9fafb;

    color: #374151;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
}


td {
    color: #374151;
}


tbody tr:hover {
    background: #fafafa;
}


/* ============================================================
   ALERTAS / MENSAJES
   ============================================================ */

.alerta {
    padding: 12px 14px;

    border-radius: 8px;

    font-size: 13px;
}


.alerta-error {
    border: 1px solid #fecaca;

    background: #fef2f2;

    color: #991b1b;
}


.alerta-exito {
    border: 1px solid #bbf7d0;

    background: #f0fdf4;

    color: #166534;
}


.form-mensaje {
    padding: 10px 12px;

    border-radius: 8px;

    font-size: 13px;
}


.form-mensaje-error {
    background: #fef2f2;

    color: #991b1b;

    border: 1px solid #fecaca;
}


.form-mensaje-exito {
    background: #f0fdf4;

    color: #166534;

    border: 1px solid #bbf7d0;
}


/* ============================================================
   PAGINACIÓN
   ============================================================ */

.paginacion {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 6px;

    margin-top: 20px;
}


.paginacion-boton,
.paginacion-numero {
    min-width: 36px;
    min-height: 36px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 6px 10px;

    border: 1px solid #d1d5db;

    border-radius: 7px;

    background: #ffffff;

    color: #374151;

    text-decoration: none;
}


.paginacion-boton:hover,
.paginacion-numero:hover {
    background: #f9fafb;
}


.paginacion-numero.activo {
    background: #2563eb;

    border-color: #2563eb;

    color: #ffffff;
}


.paginacion-boton.deshabilitado {
    opacity: 0.45;

    cursor: default;
}


.paginacion-puntos {
    padding: 0 4px;

    color: #9ca3af;
}


/* ============================================================
   UTILIDADES
   ============================================================ */

.tabla-sin-dato {
    color: #9ca3af;
}


.oculto,
[hidden] {
    display: none !important;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 950px) {

    .form-filtros {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    .filtro-acciones {
        grid-column: 1 / -1;
    }
}


@media (max-width: 700px) {

    .pagina-contenedor {
        width: min(
            100% - 24px,
            1450px
        );

        padding-top: 18px;
    }


    .pagina-cabecera {
        align-items: flex-start;

        flex-direction: column;
    }


    .pagina-cabecera-derecha {
        width: 100%;
    }


    .form-filtros {
        grid-template-columns: 1fr;
    }


    .filtro-acciones {
        grid-column: auto;
    }


    .listado-resumen {
        align-items: flex-start;

        flex-direction: column;
    }
}