/* =============================================================================
   Gestión DTE · Estado del SII — estilos del helper compartido
   Prefijo dedicado `es-`. Se carga globalmente (head.php) porque las insignias se
   pintan en tablas de varios módulos (Libro DTE, Ventas Diarias).
   ========================================================================== */

.es-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.es-badge i {
    font-size: 10.5px;
}

.es-ok {
    background: #e3f5eb;
    color: #1e7e46;
}

.es-critico {
    background: #fbe6e3;
    color: #c0392b;
}

.es-alerta {
    background: #fdf3dd;
    color: #a06800;
}

.es-pendiente {
    background: #e7f0f9;
    color: #2f6fb3;
}

.es-neutro {
    background: #eceef0;
    color: #55606b;
}

/* Botón de reconsulta dentro de la celda */
.es-btn-refrescar {
    border: none;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    line-height: 1;
    vertical-align: middle;
}

.es-btn-refrescar:hover {
    background: #eceef0;
    color: #2f6fb3;
}

/* =============================================================================
   Panel "Documentos con problema"
   ========================================================================== */

.es-wrap {
    padding: 18px 20px 40px;
}

.es-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 18px;
}

.es-header-titulo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.es-header-titulo i {
    font-size: 26px;
    color: #c0392b;
}

.es-header-h5 {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: #2d3748;
}

.es-header-sub {
    display: block;
    font-size: 12.5px;
    color: #6c757d;
    margin-top: 2px;
}

.es-toolbar {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 18px;
}

.es-campo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.es-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #6c757d;
}

.es-select {
    min-width: 190px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #ced4da;
    border-radius: 7px;
    background: #fff;
    font-size: 13.5px;
    color: #2d3748;
}

.es-acciones {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.es-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.es-btn:hover:not(:disabled) {
    filter: brightness(.94);
}

.es-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.es-btn-primario {
    background: #2f6fb3;
    color: #fff;
}

.es-btn-secundario {
    background: #fff;
    color: #2d3748;
    border-color: #ced4da;
}

.es-btn-mini {
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

/* Tarjetas de conteo */
.es-tarjetas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.es-tarjeta {
    background: #fff;
    border: 1px solid #e9ecef;
    border-left: 5px solid #adb5bd;
    border-radius: 10px;
    padding: 14px 16px;
}

.es-tarjeta.t-rechazado {
    border-left-color: #c0392b;
}

.es-tarjeta.t-reparo {
    border-left-color: #c78100;
}

.es-tarjeta.t-pendiente {
    border-left-color: #2f6fb3;
}

.es-tarjeta.t-sindato {
    border-left-color: #adb5bd;
}

.es-tarjeta-numero {
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: #2d3748;
}

.es-tarjeta.t-rechazado .es-tarjeta-numero {
    color: #c0392b;
}

.es-tarjeta-texto {
    font-size: 12.5px;
    color: #6c757d;
    margin-top: 6px;
}

/* Tabla del panel */
.es-bloque {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.es-bloque-header {
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
}

.es-tabla-wrap {
    overflow-x: auto;
}

.es-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.es-tabla thead th {
    background: #f1f3f5;
    color: #495057;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-align: left;
    padding: 9px 11px;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.es-tabla tbody td {
    padding: 9px 11px;
    border-bottom: 1px solid #f1f3f5;
    color: #2d3748;
    vertical-align: middle;
}

.es-tabla tbody tr:hover {
    background: #f8f9fa;
}

.es-glosa {
    color: #55606b;
    font-size: 12.5px;
    max-width: 380px;
    display: block;
    line-height: 1.5;
}

.es-vacio {
    text-align: center;
    padding: 34px 16px;
    color: #868e96;
    font-size: 13.5px;
}

.es-vacio i {
    display: block;
    font-size: 34px;
    margin-bottom: 10px;
    color: #ced4da;
}

.es-spinner {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 34px 16px;
    color: #6c757d;
    font-size: 13.5px;
}

.es-spinner.activo {
    display: flex;
}

/* ── Nota técnica (solo ROOT) ───────────────────────────────────────────── */
/* Contenido interno, no una función del sistema: se distingue con borde punteado
   para que no se confunda con el resto de la pantalla. */
.es-nota-root {
    border-style: dashed;
    border-color: #ced4da;
    background: #fcfcfd;
    margin-bottom: 20px;
}

.es-nota-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #6c757d;
    margin: 0 0 5px;
}

.es-nota-code {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #2d3748;
    border-radius: 7px;
    padding: 9px 11px;
    margin-bottom: 14px;
    overflow-x: auto;
}

.es-nota-code code {
    flex: 1;
    color: #e2e8f0;
    font-size: 12.5px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    white-space: nowrap;
    background: none;
    padding: 0;
}

.es-nota-code .es-btn {
    flex-shrink: 0;
}

.es-nota-lista {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.75;
    color: #55606b;
}

.es-nota-lista code {
    background: #eceef0;
    color: #2d3748;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

@media (max-width: 768px) {
    .es-wrap {
        padding: 12px 10px 30px;
    }

    .es-acciones {
        margin-left: 0;
        width: 100%;
    }

    .es-tabla thead {
        display: none;
    }

    .es-tabla tbody tr {
        display: block;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 10px;
        padding: 6px 4px;
    }

    .es-tabla tbody td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        width: auto !important;
        text-align: right;
    }

    .es-tabla tbody td::before {
        content: attr(data-label);
        font-size: 11.5px;
        font-weight: 700;
        text-transform: uppercase;
        color: #868e96;
        text-align: left;
    }

    .es-glosa {
        max-width: none;
    }
}
