/**
 * sun.css - Estilos del modulo SIRE SUNAT
 * @version 3.0.0
 * @author Equipo ERP
 * @date 2026-06-04
 */

.sun-page {
    background: #f6f8fb;
}

.sun-commandbar,
.sun-panel,
.sun-kpi {
    background: #fff;
    border: 1px solid #dfe5ee;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .06);
}

.sun-commandbar {
    padding: 16px;
    margin-bottom: 14px;
}

.sun-commandbar label {
    color: #465568;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.sun-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.sun-actions .btn {
    border-radius: 6px;
    min-height: 38px;
}

.sun-actions .btn span {
    margin-left: 6px;
}

.sun-kpis {
    margin-bottom: 14px;
}

.sun-kpi {
    min-height: 112px;
    padding: 16px;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}

.sun-kpi::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
}

.sun-kpi span,
.sun-kpi small {
    display: block;
    color: #64748b;
}

.sun-kpi span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.sun-kpi strong {
    display: block;
    color: #152238;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
    margin: 8px 0 4px;
    overflow-wrap: anywhere;
}

.sun-kpi.is-blue::before {
    background: #2563eb;
}

.sun-kpi.is-green::before {
    background: #16a34a;
}

.sun-kpi.is-amber::before {
    background: #d97706;
}

.sun-kpi.is-red::before {
    background: #dc2626;
}

.sun-panel {
    margin-bottom: 14px;
}

.sun-panel-header {
    min-height: 64px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8edf4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sun-panel-header h3 {
    color: #1f2a3d;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.sun-panel-header small {
    color: #64748b;
}

.sun-chart {
    width: 100%;
    height: 320px;
}

.sun-trace {
    list-style: none;
    margin: 0;
    max-height: 320px;
    overflow-y: auto;
    padding: 14px 16px;
}

.sun-trace li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 10px;
    padding-bottom: 12px;
    position: relative;
}

.sun-trace li::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 16px;
    bottom: 0;
    width: 1px;
    background: #dbe3ef;
}

.sun-trace li:last-child::before {
    display: none;
}

.sun-trace li > span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #94a3b8;
    margin-top: 3px;
    z-index: 1;
}

.sun-trace li.is-ok > span {
    background: #16a34a;
}

.sun-trace li.is-error > span {
    background: #dc2626;
}

.sun-trace li.is-process > span {
    background: #2563eb;
}

.sun-trace strong {
    color: #243044;
    display: block;
    font-size: 13px;
}

.sun-trace small {
    color: #64748b;
    display: block;
    font-size: 12px;
}

.sun-table-tools {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.sun-selection-count {
    background: #f8fafc;
    border: 1px solid #dce5f0;
    border-radius: 999px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 10px;
}

.sun-table-tools > .btn {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    gap: 5px;
}

.sun-bulk-actions {
    gap: 4px;
}

.sun-bulk-actions .btn {
    align-items: center;
    border-radius: 6px !important;
    display: inline-flex;
    gap: 5px;
}

.sun-table-panel .table {
    margin-bottom: 0;
}

#tblSun {
    table-layout: auto;
}

#tblSun th,
#tblSun td {
    vertical-align: middle;
}

.sun-check-col,
.sun-select-cell {
    width: 34px;
}

#tblSun input[type="checkbox"] {
    cursor: pointer;
    height: 16px;
    width: 16px;
}

#tblSun thead th {
    background: #f8fafc;
    border-bottom: 1px solid #dce5f0;
    color: #334155;
    font-size: 12px;
    text-transform: uppercase;
}

#tblSun tfoot th {
    background: #f8fafc;
    color: #0f172a;
    font-size: 12px;
}

.sun-status-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    justify-content: center;
    letter-spacing: 0;
    min-width: 82px;
    padding: 4px 9px;
    text-transform: uppercase;
}

.sun-status-badge.is-aceptado {
    background: #dcfce7;
    color: #166534;
}

.sun-status-badge.is-rechazado {
    background: #fee2e2;
    color: #991b1b;
}

.sun-status-badge.is-anulado {
    background: #e2e8f0;
    color: #334155;
}

.sun-status-badge.is-pendiente {
    background: #fef3c7;
    color: #92400e;
}

.sun-row-actions {
    display: inline-flex;
    gap: 4px;
    justify-content: center;
    min-width: 134px;
}

.sun-row-actions .btn {
    align-items: center;
    border-radius: 6px;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 30px;
}

.sun-modal .modal-header {
    border-bottom: 1px solid #e6edf5;
}

.sun-detail-grid > div {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 12px;
    padding-top: 12px;
}

.sun-detail-grid span {
    color: #64748b;
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.sun-detail-grid strong {
    color: #152238;
    display: block;
    font-size: 14px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.sun-download-feedback {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.sun-download-icon {
    align-items: center;
    background: #eef6ff;
    border: 1px solid #cfe5ff;
    border-radius: 8px;
    color: #0d6efd;
    display: inline-flex;
    flex: 0 0 42px;
    font-size: 22px;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.sun-download-copy {
    min-width: 0;
}

.sun-download-copy strong {
    color: #152238;
    font-size: 14px;
    margin-bottom: 2px;
}

.sun-download-progress {
    height: 6px;
    margin-bottom: 8px;
}

.sun-batch-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sun-batch-summary span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    font-size: 12px;
    padding: 5px 8px;
}

.sun-batch-errors {
    margin: 10px 0 0;
    max-height: 120px;
    overflow: auto;
    padding-left: 18px;
}

@media (max-width: 767.98px) {
    .sun-actions {
        justify-content: stretch;
    }

    .sun-actions .btn {
        flex: 1 1 auto;
    }

    .sun-actions .btn span {
        display: inline;
    }

    .sun-panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .sun-table-tools {
        justify-content: flex-start;
        width: 100%;
    }

    .sun-bulk-actions .btn span {
        display: none;
    }

    .sun-chart {
        height: 280px;
    }
}
