/**
 * 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;
}

@media (min-width: 1200px) {
    .sun-analytics-row > [class*="col-"] {
        display: flex;
        min-height: 0;
    }

    .sun-analytics-row .sun-panel {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        min-height: 0;
        width: 100%;
    }

    .sun-trace-panel {
        min-height: 0;
    }

    .sun-trace-panel .sun-trace {
        display: flex;
        flex: 1 1 0;
        flex-direction: column;
        max-height: none;
        min-height: 0;
    }
}

.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-panel-header-tabs {
    align-items: flex-start;
}

.sun-chart-tabs {
    background: #f8fafc;
    border: 1px solid #dce5f0;
    border-radius: 999px;
    gap: 6px;
    padding: 4px;
}

.sun-chart-tabs .nav-link {
    border-radius: 999px;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 7px 14px;
    text-transform: uppercase;
}

.sun-chart-tabs .nav-link.active,
.sun-chart-tabs .show > .nav-link {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    box-shadow: 0 10px 20px rgba(37, 99, 235, .18);
    color: #fff;
}

.sun-chart-tab-content {
    padding: 12px 16px 16px;
}

.sun-chart-copy {
    padding-bottom: 8px;
}

.sun-chart-copy h4 {
    color: #1f2a3d;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.sun-chart-copy 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-concar-diagnostic {
    background: #f8fbff;
    border-bottom: 1px solid #e5edf7;
    padding: 14px 16px;
}

.sun-concar-diagnostic-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sun-concar-diagnostic-head strong {
    color: #152238;
    display: block;
    font-size: 13px;
}

.sun-concar-diagnostic-head small {
    color: #64748b;
    display: block;
    margin-top: 2px;
}

.sun-concar-summary {
    display: grid;
    gap: 8px;
}

.sun-concar-summary-row {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sun-concar-summary-chip {
    background: #fff;
    border: 1px solid #dbe7f5;
    border-radius: 8px;
    color: #334155;
    padding: 10px 12px;
}

.sun-concar-summary-chip span {
    color: #64748b;
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
    text-transform: uppercase;
}

.sun-concar-summary-chip strong {
    color: #152238;
    display: block;
    font-size: 18px;
    line-height: 1.1;
}

.sun-concar-summary-note {
    color: #64748b;
    font-size: 12px;
}

.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-trace-data {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.sun-trace-data span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #475569;
    font-size: 11px;
    padding: 3px 8px;
}

.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-responsive {
    padding: 14px 16px 16px;
}

.sun-table-panel .dataTables_wrapper .row:first-child {
    align-items: center;
    margin-bottom: 10px;
}

.sun-table-panel .dataTables_wrapper .dataTables_length,
.sun-table-panel .dataTables_wrapper .dataTables_filter,
.sun-table-panel .dataTables_wrapper .dataTables_info,
.sun-table-panel .dataTables_wrapper .dataTables_paginate {
    margin-bottom: 0;
}

.sun-table-panel .dataTables_wrapper .dataTables_filter input {
    margin-left: .35rem;
}

.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;
}

.sun-concar-detail-section + .sun-concar-detail-section {
    margin-top: 18px;
}

.sun-concar-detail-section h6 {
    color: #152238;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 10px;
}

.sun-concar-detail-empty {
    background: #f8fafc;
    border: 1px dashed #d8e1ec;
    border-radius: 8px;
    color: #64748b;
    margin: 0;
    padding: 12px;
}

.sun-concar-detail-table {
    margin-bottom: 0;
}

.sun-concar-detail-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
}

.sun-concar-detail-table td {
    font-size: 12px;
    vertical-align: top;
}

.sun-concar-detail-table td small {
    color: #64748b;
    display: block;
}

.sun-concar-doc-cell strong,
.sun-concar-entity-cell strong {
    color: #152238;
    display: block;
    font-size: 12px;
}

.sun-concar-doc-cell small,
.sun-concar-entity-cell small {
    color: #64748b;
    display: block;
    line-height: 1.35;
}

.sun-concar-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 6px 9px;
    white-space: nowrap;
}

.sun-concar-badge-filtered {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
}

.sun-concar-badge-omitted {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

@media (max-width: 991.98px) {
    .sun-concar-summary-row {
        grid-template-columns: 1fr;
    }

    .sun-concar-diagnostic-head {
        align-items: stretch;
        flex-direction: column;
    }
}

@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-chart-tabs {
        width: 100%;
    }

    .sun-chart-tabs .nav-item,
    .sun-chart-tabs .nav-link {
        width: 100%;
    }

    .sun-chart-tab-content {
        padding: 12px;
    }

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

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

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