/* =========================================================
   MONITOR DE DOCUMENTOS
   estilos.css
   ========================================================= */

:root {
    --azul: #3498db;
    --azul-oscuro: #217dbb;
    --azul-claro: #eaf5fc;
    --borde: #d7e2ea;
    --texto: #34495e;
    --gris: #7f8c8d;
    --rojo: #e74c3c;
    --verde: #27ae60;
    --naranja: #f39c12;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f7f9;
    color: var(--texto);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

/* ---------------------------------------------------------
   ENCABEZADO
   --------------------------------------------------------- */

.page-header {
    min-height: 55px;
    background: #ffffff;
    border: 1px solid var(--borde);
    border-left: 5px solid var(--azul);
    border-radius: 5px;
    padding: 10px 15px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header h4 {
    color: #2c3e50;
    font-size: 19px;
    font-weight: 600;
}

.page-header h4 i {
    color: var(--azul);
    margin-right: 5px;
}

.subtitle {
    color: #8a9aa5;
    font-size: 12px;
}

.header-actions .btn {
    min-width: 100px;
}

/* ---------------------------------------------------------
   FILTROS
   --------------------------------------------------------- */

.filter-card {
    border: 1px solid var(--borde);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.filter-card .card-body {
    padding: 13px;
}

.form-label {
    margin-bottom: 4px;
    color: #566573;
    font-size: 12px;
    font-weight: 600;
}

.form-control,
.form-select {
    border-color: #ccd8df;
    color: #34495e;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 0.15rem rgba(52, 152, 219, 0.15);
}

.search-wrapper {
    position: relative;
}

.search-wrapper i {
    position: absolute;
    left: 10px;
    top: 8px;
    color: #9aa8b1;
    z-index: 2;
}

.search-wrapper input {
    padding-left: 30px;
}

/* ---------------------------------------------------------
   RESUMEN
   --------------------------------------------------------- */

.summary-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.summary-card {
    background: #ffffff;
    border: 1px solid var(--borde);
    border-left: 4px solid var(--azul);
    border-radius: 4px;
    padding: 9px 12px;
    min-height: 65px;
}

.summary-card.warning {
    border-left-color: var(--naranja);
}

.summary-card.success {
    border-left-color: var(--verde);
}

.summary-card.danger {
    border-left-color: var(--rojo);
}

.summary-title {
    color: #8a9aa5;
    font-size: 11px;
    text-transform: uppercase;
}

.summary-value {
    margin-top: 2px;
    color: #34495e;
    font-size: 21px;
    font-weight: bold;
}

/* ---------------------------------------------------------
   TABLA
   --------------------------------------------------------- */

.table-card {
    border: 1px solid var(--borde);
    overflow: hidden;
}

.monitor-scroll {
    max-height: calc(100vh - 330px);
    min-height: 350px;
    overflow: auto;
}

.monitor-table {
    width: 100%;
    min-width: 1250px;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
}

.monitor-table th,
.monitor-table td {
    border-right: 1px solid #d9e4eb;
    border-bottom: 1px solid #d9e4eb;
    vertical-align: middle;
    text-align: center;
    white-space: nowrap;
    padding: 7px 6px;
}

/* Cabecera principal */
.monitor-table thead th {
    position: sticky;
    z-index: 10;
}

.monitor-table thead .header-main th {
    top: 0;
    height: 30px;
    background: var(--azul);
    color: #ffffff;
    font-weight: 600;
    border-color: #8bc5e9;
}

.monitor-table thead .header-sub th {
    top: 30px;
    height: 27px;
    background: #2d8dcc;
    color: #ffffff;
    font-weight: 600;
    border-color: #8bc5e9;
}

.monitor-table thead .group-header {
    font-size: 11px;
    letter-spacing: 0.3px;
}

.monitor-table thead .no-autorizado {
    background: #2f91cf;
}

.monitor-table thead .no-insertado {
    background: #2788c4;
}

/* Anchos */
.col-empresa {
    min-width: 145px;
}

.col-ruc {
    min-width: 120px;
}

.col-sucursal {
    min-width: 75px;
}

.col-fecha {
    min-width: 105px;
}

.col-estado {
    min-width: 135px;
}

/* Filas */
.monitor-table tbody td {
    background: #ffffff;
    height: 35px;
    color: #4b5d68;
}

.monitor-table tbody tr:hover td {
    background: #f1f8fd;
}

.monitor-table tbody tr.row-revisado td {
    background: #f6fbf7;
}

.monitor-table tbody tr.row-revisado:hover td {
    background: #edf8f0;
}

/* ---------------------------------------------------------
   FILA DE EMPRESA
   --------------------------------------------------------- */

.monitor-table tbody tr.company-row td {
    background: #eef8fd;
    color: #263b48;
    font-weight: 600;
    height: 38px;
    border-top: 1px solid #b8dced;
}

.company-row .company-name {
    text-align: left;
}

.company-summary {
    color: #6c7e88;
    font-size: 10px;
    font-weight: normal;
    margin-left: 10px;
}

.company-total {
    color: #3498db;
}

.company-review {
    color: #f39c12;
}

.company-reviewed {
    color: #27ae60;
}

.company-toggle {
    border: none;
    background: #2d8dcc;
    color: #ffffff;
    width: 20px;
    height: 20px;
    line-height: 18px;
    padding: 0;
    border-radius: 3px;
    margin-right: 7px;
    cursor: pointer;
}

.company-toggle:hover {
    background: #217dbb;
}

/* ---------------------------------------------------------
   ESTADOS
   --------------------------------------------------------- */

.estado-revisar,
.estado-revisado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    cursor: pointer;
    border: none;
}

.estado-revisar {
    background: #f39c12;
}

.estado-revisar:hover {
    background: #df8b0a;
}

.estado-revisado {
    background: #27ae60;
}

.estado-revisado:hover {
    background: #219653;
}

.estado-check {
    margin-right: 5px;
}

/* ---------------------------------------------------------
   VALORES
   --------------------------------------------------------- */

.valor-normal {
    color: #657681;
}

.valor-alerta {
    color: var(--rojo) !important;
    font-weight: bold;
}

.valor-cero {
    color: #98a6ad !important;
}

.numero-click {
    cursor: pointer;
}

.numero-click:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   CHECKBOX
   --------------------------------------------------------- */

.check-revisado {
    width: 16px;
    height: 16px;
    cursor: pointer;
    vertical-align: middle;
    accent-color: var(--verde);
}

.check-todos {
    margin-right: 5px;
}

/* ---------------------------------------------------------
   ESTADO VACÍO
   --------------------------------------------------------- */

.empty-state {
    min-height: 280px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #9aa8b1;
    font-size: 14px;
}

.empty-state:not(.d-none) {
    display: flex;
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 10px;
}

/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */

.footer-info {
    display: flex;
    justify-content: space-between;
    color: #8a9aa5;
    font-size: 11px;
}

.footer-info i {
    color: var(--azul);
}

/* ---------------------------------------------------------
   MODAL
   --------------------------------------------------------- */

.modal-content {
    border: none;
    box-shadow: 0 10px 35px rgba(0,0,0,0.18);
}

.modal-header {
    background: #f7fafc;
    border-bottom: 1px solid #e4ebef;
}

.modal-title {
    font-size: 16px;
}

.modal-title i {
    color: var(--verde);
    margin-right: 5px;
}

/* ---------------------------------------------------------
   SCROLLBAR
   --------------------------------------------------------- */

.monitor-scroll::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

.monitor-scroll::-webkit-scrollbar-track {
    background: #eef2f4;
}

.monitor-scroll::-webkit-scrollbar-thumb {
    background: #b7c6ce;
    border-radius: 5px;
}

.monitor-scroll::-webkit-scrollbar-thumb:hover {
    background: #91a5b0;
}

/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 900px) {

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

    .page-header {
        align-items: flex-start;
        gap: 10px;
    }

    .footer-info {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 576px) {

    .summary-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        width: 100%;
    }
}
