@page {
    margin: 20px 25px;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #2c3e50;
    margin: 0;
    padding: 0;
}

/* ===== Header ===== */
.barra-superior {
    background: linear-gradient(90deg, #1e3a5f 0%, #2c5282 100%);
    height: 6px;
    margin-bottom: 14px;
}

.header-wrap {
    padding: 0 4px 10px 4px;
    border-bottom: 2px solid #1e3a5f;
    margin-bottom: 14px;
}

.titulo-reporte {
    font-size: 24px;
    font-weight: bold;
    color: #1e3a5f;
    margin: 0 0 4px 0;
    letter-spacing: 0.3px;
}

.subtitulo-empresa {
    font-size: 13px;
    margin: 0;
    color: #64748b;
    font-weight: 500;
}

.meta-box {
    text-align: right;
    font-size: 11px;
    color: #475569;
    line-height: 1.5;
}

.meta-box .label {
    color: #94a3b8;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

.meta-box .valor {
    color: #1e3a5f;
    font-weight: bold;
}

/* ===== Filtros como chips ===== */
.filtros-wrap {
    margin: 4px 0 14px 0;
    padding: 8px 10px;
    background: #f1f5f9;
    border-left: 4px solid #1e3a5f;
    border-radius: 2px;
}

.filtros-label {
    font-size: 10px;
    font-weight: bold;
    color: #1e3a5f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 6px;
}

.chip {
    display: inline-block;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 3px 11px;
    font-size: 11px;
    margin: 2px 3px 2px 0;
    color: #334155;
}

.chip strong {
    color: #1e3a5f;
}

/* ===== Tabla ===== */
table.tabla-reporte {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin-top: 4px;
}

table.tabla-reporte thead tr {
    background: #1e3a5f;
    color: #ffffff;
}

table.tabla-reporte thead th {
    padding: 10px 7px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #0f2640;
}

table.tabla-reporte tbody td {
    padding: 8px 7px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

table.tabla-reporte tbody tr:nth-child(even) {
    background: #f8fafc;
}

table.tabla-reporte tbody tr:hover {
    background: #eef5ff;
}

table.tabla-reporte tfoot tr {
    background: #1e3a5f;
    color: #ffffff;
    font-weight: bold;
}

table.tabla-reporte tfoot td {
    padding: 11px 7px;
    border-top: 2px solid #0f2640;
    font-size: 12px;
}

.col-numero {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #1e3a5f;
    font-weight: bold;
}

/* ===== Badges de estado ===== */
.badge-estado {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-aprobado { background: #d1fae5; color: #065f46; }
.badge-borrador { background: #e5e7eb; color: #374151; }
.badge-anulado  { background: #fee2e2; color: #991b1b; }
.badge-default  { background: #e0e7ff; color: #3730a3; }

/* ===== Celdas numéricas ===== */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-left   { text-align: left; }

.num {
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

.positivo { color: #047857; font-weight: bold; }
.negativo { color: #b91c1c; font-weight: bold; }

tfoot .positivo { color: #86efac; }
tfoot .negativo { color: #fca5a5; }

/* ===== Footer ===== */
.pie-pagina {
    margin-top: 18px;
    padding-top: 10px;
    font-size: 10px;
    color: #64748b;
    border-top: 1px solid #cbd5e1;
}

.pie-pagina .brand {
    color: #1e3a5f;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Evitar cortes feos en tablas largas */
table.tabla-reporte tr {
    page-break-inside: avoid;
}

table.tabla-reporte thead {
    display: table-header-group;
}

table.tabla-reporte tfoot {
    display: table-row-group;
}
