/* -------------------------------------------------------------------
 * Hoja de Estilos Principal (style.css)
 *
 * *** MODIFICADO (VERSIÓN v10: EDITAR TASA HISTÓRICA) ***
 * 1. (¡¡NUEVA FEATURE!!): Añadida la Sección 14 para la tabla de stats.
 * 2. (¡¡NUEVA FEATURE!!): Añadida la clase '.stats-data-table'
 * para dar estilos al lápiz de edición de la tabla.
 * 3. (¡¡FIX Z-INDEX!!): Añadido 'z-index: 60' a '#rates-modal'
 * para que aparezca ENCIMA del modal de estadísticas.
 * * *** (¡¡FIX GEMINI 2.0!!) ***
 * 4. (MODAL CONFIG/STATS): RESTAURADA la regla '.modal-content-tabs .tab-pane'
 * en la Sección 9 para ocultar pestañas inactivas.
 * 5. (TABLA STATS): REEMPLAZADOS los anchos fijos (nth-child) 
 * por reglas de 'text-align' en la Sección 14 para hacerla simétrica.
 * ------------------------------------------------------------------- */

/* --- FUENTE PRINCIPAL --- */
body {
    background-color: #1f2937; /* bg-gray-800 */
    color: #e5e7eb; /* text-gray-100 */
    font-family: 'Inter', sans-serif, system-ui;
}

/* -------------------------------------------------------------------
 * ESTILOS DE LOGIN (index.php, registro.php)
 * ------------------------------------------------------------------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background-color: #111827; /* bg-gray-900 */
}

.login-box {
    background-color: #000000;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 28rem;
}

/* -------------------------------------------------------------------
 * ESTILOS DEL DASHBOARD (dashboard.php)
 * ------------------------------------------------------------------- */

/* --- 1. BARRA SUPERIOR (HEADER) --- */

.top-bar {
    background-color: #000000;
    color: #ffffff;
    border-bottom: 1px solid #374151; /* border-gray-700 */
    /* (Responsive) Ajustado para móviles */
    padding: 0.5rem 1rem;
    height: auto;
    /* (Responsive) Cambiado a flex para móviles */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
@media (min-width: 1024px) {
    .top-bar {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        height: 85px;
        padding: 0 1rem;
    }
}


.top-bar .logo img {
    height: 60px; /* Ajustado para caber mejor */
    width: auto;
}
@media (min-width: 1024px) {
    .top-bar .logo img {
        height: 75px;
    }
}

.rates-container {
    display: none; /* Oculto en móvil por defecto */
}
@media (min-width: 768px) {
    .rates-container {
        display: flex;
    }
}

.rates-container .text-sm {
    font-size: 0.75rem; /* 12px */
}
.rates-container .text-lg {
    font-size: 1.0rem; /* 16px */
}
.user-menu .text-sm {
    font-size: 0.875rem; /* 14px */
}

/* --- 2. BOTONES DE ICONOS (HEADER) --- */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.375rem; /* rounded-md */
    color: #ffffff;
    transition: background-color 0.2s;
    background-color: #4f46e5; /* bg-indigo-600 (Morado/Azul) */
}
.btn-icon:hover {
    background-color: #4338ca; /* bg-indigo-700 */
}

.btn-icon-danger {
    background-color: #dc2626; /* bg-red-600 */
}
.btn-icon-danger:hover {
    background-color: #b91c1c; /* bg-red-700 */
}
/* Estilo secundario para botones (Consolidar, Imprimir) */
.btn-icon-secondary {
    background-color: #4b5563; /* bg-gray-600 */
}
.btn-icon-secondary:hover {
    background-color: #6b7280; /* bg-gray-500 */
}


/* --- 3. PANELES PRINCIPALES (CARD) --- */
.card-dark {
    background-color: #111827; /* bg-gray-900 */
    border: 1px solid #374151; /* Borde sutil */
    border-radius: 0.5rem; /* rounded-lg */
    padding: 1rem; /* p-4 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 600; /* font-semibold */
    color: #ffffff;
    padding-bottom: 0.5rem; /* pb-2 */
    border-bottom: 1px solid #374151; /* border-b border-gray-700 */
}

/* --- 4. ESTILOS DE FORMULARIO (COL 1 Y FILTROS) --- */

.form-label {
    display: block;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    color: #d1d5db; /* text-gray-300 */
    margin-bottom: 0.25rem;
}

.form-label-sm {
    display: block;
    font-size: 0.75rem; /* text-xs */
    font-weight: 500; /* font-medium */
    color: #9ca3af; /* text-gray-400 */
    margin-bottom: 0.25rem;
}

.form-input,
.filter-select {
    display: block;
    background-color: #374151; /* bg-gray-700 */
    border: 1px solid #4b5563; /* border-gray-600 */
    color: #ffffff;
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem; /* text-sm */
    padding: 0.4rem 0.75rem;
}

.form-input[rows="2"] {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.form-input:focus,
.filter-select:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #4f46e5; /* border-indigo-600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

.form-input:disabled,
.form-input[readonly] {
    background-color: #4b5563; /* bg-gray-600 */
    color: #9ca3af; /* text-gray-400 */
    cursor: not-allowed;
}

.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; 
}

.form-radio {
    width: 1rem;
    height: 1rem;
    border-radius: 100%;
    border: 2px solid #4b5563;
    background-color: #374151;
    appearance: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.form-radio:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}
.form-radio:focus {
     box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
     outline: none;
}

/* Checkbox genérico (para consolidar y stats) */
.form-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem; /* rounded */
    border: 2px solid #4b5563;
    background-color: #374151;
    appearance: none;
    cursor: pointer;
}
.form-checkbox:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}
.form-checkbox:focus {
     box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
     outline: none;
}


.form-input-file {
    display: block;
    font-size: 0.875rem;
    color: #9ca3af; /* text-gray-400 */
}
.form-input-file::file-selector-button {
    font-weight: 500;
    color: #ffffff;
    background-color: #4b5563; /* bg-gray-600 */
    border: none;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    margin-right: 0.75rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.form-input-file::file-selector-button:hover {
    background-color: #6b7280; /* bg-gray-500 */
}


/* --- 5. BOTONES (Primario, Secundario) --- */

.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #4f46e5; /* bg-indigo-600 */
    color: #ffffff;
    font-weight: 600;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-primary:hover {
    background-color: #4338ca; /* bg-indigo-700 */
}
.btn-primary:disabled {
    background-color: #3730a3; /* bg-indigo-900 */
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-secondary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #4b5563; /* bg-gray-600 */
    color: #ffffff;
    font-weight: 600;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-secondary:hover {
    background-color: #6b7280; /* bg-gray-500 */
}

.btn-danger {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: #dc2626; /* bg-red-600 */
    color: #ffffff;
    font-weight: 600;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-danger:hover {
    background-color: #b91c1c; /* bg-red-700 */
}

/* --- 6. ESTILOS DE MODAL (Genérico) --- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50; /* z-index base */
    overflow-y: auto;
    padding: 1rem;
}

/* (¡¡FIX Z-INDEX!!) El modal de tasas debe estar ENCIMA (z-index 60) */
.modal-backdrop#rates-modal {
    z-index: 60;
}

.modal-content {
    background-color: #1f2937; /* bg-gray-800 */
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 1.5rem; /* p-6 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 32rem; /* md:max-w-md */
    margin: auto;
    transition: max-width 0.3s ease-in-out, width 0.3s ease-in-out; 
}

/* Para modales con formularios largos */
.modal-content-scrollable {
    max-height: 90vh; /* Límite de altura */
    display: flex;
    flex-direction: column;
}
.modal-content-scrollable form {
    overflow-y: auto;
    padding-right: 0.5rem;
}

.form-input-modal {
    display: block;
    background-color: #111827; /* Fondo oscuro */
    border: 1px solid #374151; /* Borde */
    color: #ffffff; /* Texto blanco */
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
}
.form-input-modal:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}


/* --- 7. GRILLA DE MOVIMIENTOS --- */

.table-container-scroll {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem; /* 14px */
    table-layout: auto;
    min-width: 900px; /* Ancho mínimo para la grilla principal */
}

.data-table thead {
    background-color: #374151;
    color: #d1d5db;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th,
.data-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #374151;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table td.truncate-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}


.data-table tbody tr:hover {
    background-color: #374151;
}

/* Iconos de Acción de la Grilla (Lápiz, Borrar) */
.grid-action-icon {
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0 2px;
    font-size: 1rem; 
    transition: transform 0.2s, color 0.2s;
    width: 28px;
    height: 28px;
}
.grid-action-icon:hover {
    transform: scale(1.2);
}
.grid-action-icon.view { color: #38bdf8; } 
.grid-action-icon.view:hover { color: #0ea5e9; } 
.grid-action-icon.edit { color: #4ade80; } 
.grid-action-icon.edit:hover { color: #22c55e; } 
.grid-action-icon.delete { color: #f87171; } 
.grid-action-icon.delete:hover { color: #ef4444; } 

/* --- 8. TABLA DE TOTALES PARCIALES --- */
.data-table-totals {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem; /* 12px, más pequeño */
    table-layout: fixed; 
}
.data-table-totals th,
.data-table-totals td {
    padding: 0.25rem 0.25rem; 
    border-bottom: 1px solid #4b5563; /* border-gray-600 */
    text-align: right; 
}
.data-table-totals th {
    font-weight: 500;
}
.data-table-totals th:first-child,
.data-table-totals td:first-child {
    text-align: left;
    font-weight: 500;
}

/* --- 9. ESTILOS DE MODAL DE CONFIGURACIÓN Y GESTIÓN --- */

.config-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-bottom: 1px solid #374151; /* border-gray-700 */
}

.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem; /* text-sm */
    font-weight: 600; /* font-semibold */
    color: #9ca3af; /* text-gray-400 */
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px; /* Solapa el borde inferior del contenedor */
    transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover {
    color: #e5e7eb; /* text-gray-100 */
}
.tab-btn.active {
    color: #a78bfa; /* text-purple-400 */
    border-bottom-color: #a78bfa; /* border-purple-400 */
}

.tab-pane {
    display: none; /* Oculto por defecto */
}
.tab-pane.active {
    display: block; /* Visible si está activo */
}
.modal-content-tabs .tab-pane.active.flex {
    display: flex;
}

/* --- INICIO DE LA CORRECCIÓN (MODAL CONFIG/STATS) --- */
/* Esta regla es necesaria para anular el 'display: flex'
 * de Tailwind en las pestañas que NO están activas.
 * Mi error anterior fue comentarla.
 */
.modal-content-tabs .tab-pane {
    display: none;
}
/* Esta regla asegura que la pestaña ACTIVA SÍ se muestre */
.modal-content-tabs .tab-pane.active {
    display: block;
}
/* Esta regla es para el gráfico, que necesita 'flex' */
.modal-content-tabs .tab-pane.active.flex {
    display: flex;
}
/* --- FIN DE LA CORRECCIÓN (MODAL CONFIG/STATS) --- */


.shared-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #374151; /* bg-gray-700 */
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem; /* text-sm */
}
.btn-unshare {
    background-color: #dc2626; /* bg-red-600 */
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.btn-unshare:hover {
    background-color: #b91c1c; /* bg-red-700 */
}
.btn-unshare:disabled {
    background-color: #4b5563; /* bg-gray-600 */
    opacity: 0.7;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #374151; /* bg-gray-700 */
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem; /* text-sm */
}
.category-name {
    font-weight: 500;
}
.category-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af; /* text-gray-400 */
    margin-left: 0.5rem;
    transition: color 0.2s;
}
.category-actions button:hover {
    color: #ffffff;
}


/* --- 10. ESTILOS DEL MODAL DE ESTADÍSTICAS (GRÁFICO) --- */
#rates-chart-container {
    width: 100%;
    height: 100%; 
}

.chart-legend-item {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
}


/* --- 11. ESTILOS DE CALCULADORA Y GRILLA --- */

.converter-item {
    display: flex;
    align-items: center;
    background-color: #111827; 
    border: 1px solid #4b5563; /* border-gray-600 */
    border-radius: 0.375rem; /* rounded-md */
    transition: border-color 0.2s;
}
.converter-item:focus-within {
    border-color: #4f46e5; /* border-indigo-600 */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.5);
}

.converter-symbol {
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    color: #9ca3af; /* text-gray-400 */
    padding-left: 0.5rem; /* px-2 */
}

.converter-input {
    background-color: transparent; 
    border: none;
    color: #ffffff;
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    padding: 0.25rem 0.5rem; /* py-1 px-2 */
    width: 120px; /* (FIX) Tu ancho ideal */
    text-align: right;
}
.converter-input:focus {
    outline: none; /* El resaltado lo maneja .converter-item */
    box-shadow: none;
}
.converter-input::placeholder {
    color: #9ca3af; /* text-gray-400 */
    font-weight: 400;
}

.converter-input::-webkit-outer-spin-button,
.converter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.converter-input[type=text] {
  -moz-appearance: textfield;
}

.converter-clear-btn {
    display: flex; /* Para centrar el icono */
    align-items: center;
    justify-content: center;
    height: 31px; /* (FIX) Alinear altura con los inputs */
    width: 24px;  /* (FIX) Ancho para el botón X */
    background-color: #111827;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    color: #9ca3af; /* text-gray-400 */
    cursor: pointer;
    font-size: 0.875rem; /* text-sm */
    transition: all 0.2s;
}
.converter-clear-btn:hover {
    color: #ffffff;
    border-color: #9ca3af;
}

.grid-title-select {
    width: 100%;
    background-color: transparent; /* Fondo del thead */
    border: none;
    color: #d1d5db; /* Color del texto del thead */
    font-size: 0.75rem; /* text-xs */
    font-weight: 700; /* bold */
    text-transform: uppercase;
    appearance: none;
    cursor: pointer;
    padding: 0;
    
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23d1d5db' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%e");
    background-position: right 0.25rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 1.75rem;
}
.grid-title-select:focus {
    outline: none;
}
.grid-title-select option {
    background-color: #1f2937; /* bg-gray-800 */
    color: #ffffff;
}

/* --- 12. ESTILOS MODAL CONSOLIDAR E IMPRESIÓN --- */

.consolidate-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem; /* p-2 p-3 */
    background-color: #374151; /* bg-gray-700 */
    border-radius: 0.375rem; /* rounded-md */
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.875rem; /* text-sm */
}
.consolidate-item:hover {
    background-color: #4b5563; /* bg-gray-600 */
}
.consolidate-item .form-checkbox {
    margin-right: 0.75rem;
}

#consolidate-caja-names {
    font-size: 0.75rem; /* text-xs */
    color: #9ca3af; /* text-gray-400 */
    font-style: italic;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Estilos de Impresión */
@media print {
    body.print-active > *:not(#app-container) {
        display: none !important;
    }
    #app-container > *:not(main) {
        display: none !important;
    }
    main > #main-content-column { 
        display: none !important;
    }
    .modal-backdrop {
        display: none !important;
    }

    body.print-active {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .print-active main {
        display: block !important;
        padding: 0 !important;
        gap: 0 !important;
    }
    .print-active main > #saldo-column { 
        display: block !important;
        width: 100% !important;
        flex: none !important;
        grid-column: span 12 / span 12 !important;
    }
    
    .print-active .card-dark {
        border: none !important;
        box-shadow: none !important;
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    
    .print-active .text-white,
    .print-active .text-gray-300,
    .print-active .text-gray-400,
    .print-active .text-green-400,
    .print-active .text-orange-400,
    .print-active .font-medium,
    .print-active .font-semibold,
    .print-active #balance-caja-name,
    .print-active #consolidate-caja-names {
        color: #000000 !important;
    }
    
    .print-active #open-consolidate-modal-btn,
    .print-active #print-saldo-btn {
        display: none !important;
    }
    
    .print-active .bg-gray-700,
    .print-active .bg-gray-600,
    .print-active .bg-gray-900 {
        background-color: #f3f4f6 !important; /* un gris muy claro */
        border: 1px solid #cccccc !important;
    }
}

/* --- 13. ESTILOS RESPONSIVE Y FIX SCROLL --- */

.data-table {
    min-width: 900px; 
}

@media (max-width: 767px) {
    #rate-converter-container {
        display: none;
    }
    .p-3 .grid-cols-1 {
        grid-template-columns: 1fr;
    }
    .p-3 .md\:grid-cols-5 {
        grid-template-columns: 1fr 1fr; 
    }
    .p-3 .md\:grid-cols-5 > div:nth-child(3) {
        grid-column: span 2 / span 2;
    }
}
@media (min-width: 768px) and (max-width: 1200px) {
    #rate-converter-container {
        display: none;
    }
}

/* --- 14. (¡¡NUEVO!!) ESTILOS MODAL ESTADÍSTICAS (v10) --- */

/* (FIX v11) Ancho dinámico para el modal de stats */
.modal-content.modal-width-graph {
    max-width: 80vw !important; /* Ancho para el gráfico */
    height: 80vh;
}
.modal-content.modal-width-table {
    /* (FIX v12) Se encoge al contenido de la tabla */
    width: fit-content !important; 
    max-width: 80vw !important;
    height: 80vh;
}


#stats-tab-tabla {
    flex: 1 1 0%;
    min-height: 0;
    /* Ya tiene 'display: flex' y 'flex-col' por Tailwind (desde dashboard.php) */
}

#stats-table-wrapper {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto; 
    overflow-x: hidden; /* (FIX v13) Eliminar scroll horizontal */
    -webkit-overflow-scrolling: touch;
}

/* (FIX v13) Tabla de Stats compacta */
.stats-data-table {
    min-width: 0 !important;
    table-layout: auto !important; /* Cambiado a 'auto' para que se ajuste */
    width: 100% !important; 
}

/* --- INICIO DE LA CORRECCIÓN (TABLA SIMÉTRICA) --- */
/* Estas reglas anulan los anchos fijos y aplican
 * la alineación correcta para que sea compacta y simétrica.
 */

/* 1. Cabeceras (TH) y Celdas (TD) alineadas a la DERECHA por defecto */
.stats-data-table th,
.stats-data-table td {
    text-align: right;
    padding-left: 1rem;
    padding-right: 1rem;
    width: auto; /* Anulamos los anchos fijos */
}

/* 2. EXCEPCIÓN: Primera columna (Fecha) a la IZQUIERDA */
.stats-data-table th:first-child,
.stats-data-table td:first-child {
    text-align: left;
    white-space: nowrap; /* Evita que la fecha se parta */
}

/* 3. EXCEPCIÓN: Última columna (Acción) al CENTRO y ANGOSTA */
.stats-data-table th:last-child,
.stats-data-table td:last-child {
    text-align: center;
    width: 60px; /* Ancho fijo y pequeño para el botón */
}
/* --- FIN DE LA CORRECCIÓN (TABLA SIMÉTRICA) --- */


/* Estilos para los botones de filtro de la tabla */
.stats-range-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem; /* text-xs */
}