/* ==========================================================================
   PLUGIN CONTABILIDAD - ESTILOS PRINCIPALES
   ========================================================================== */

/* Variables CSS */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --accent-color: #007aff;
    --border-color: #e0e0e0;
    --hover-color: #f7f7f7;
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    font-weight: 500;
    overflow-x: hidden;
}

#wpfooter {
    display: none;
}

/* ==========================================================================
   KEYFRAMES (Animaciones)
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    20%, 60% { transform: rotate(-5deg); }
    40%, 80% { transform: rotate(5deg); }
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

@keyframes girar {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes particleAnimation {
    0% { transform: rotate(0deg); opacity: 0; }
    20% { opacity: 0.2; }
    100% { transform: rotate(360deg); opacity: 0; }
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #fff, 0 0 10px #fff, 0 0 15px #00a0e9, 0 0 20px #00a0e9;
    }
    to {
        text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #00a0e9, 0 0 40px #00a0e9;
    }
}

/* ==========================================================================
   COMPONENTES UI
   ========================================================================== */

/* Formularios */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 15px;
    overflow: visible;
    position: relative;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    width: 70%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: #397eef;
    outline: none;
}

/* Botones principales */
.btn-principal,
.btn-filtrar {
    background-color: #397eef;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.btn-principal:hover,
.btn-filtrar:hover {
    background-color: #0242ab;
}

.btn-filtrar {
    padding: 0.5rem 1rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-filtrar:hover {
    background: #218838;
}

.btn-quitar-filtros {
    width: 100%;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
    margin-top: 1rem;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-quitar-filtros:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.btn-quitar-filtros i {
    font-size: 1rem;
}

/* Botones de editar/borrar */
.btn-editar,
.editar-gasto {
    background-color: #008CBA;
    color: white;
    padding: 5px 10px;
    margin: 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-editar:hover,
.editar-gasto:hover {
    background-color: #007B9A;
}

.btn-borrar,
.eliminar-gasto {
    background-color: #f44336;
    color: white;
    padding: 5px 10px;
    margin: 2px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-borrar:hover,
.eliminar-gasto:hover {
    background-color: #da190b;
}

/* Botón de salir */
#btn-salir {
    background: linear-gradient(to right, #ff4b4b, #d63638);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

#btn-salir:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(214, 54, 56, 0.2);
}

/* Botones de loading */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
    cursor: not-allowed;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
}

#abrir-modal-categorias {
    margin-right: 20px;
}

/* ==========================================================================
   MODALES
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-contenido {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}

.cerrar-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}

.modal-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.confirm-button {
    background-color: #d63638;
    color: white;
    margin-right: 10px;
}

.cancel-button {
    background-color: #6c757d;
    color: white;
}

/* ==========================================================================
   NOTIFICACIONES AVANZADAS
   ========================================================================== */

.notificacion-avanzada {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    width: 80%;
    max-width: 300px;
}

.notificacion-avanzada.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.notificacion-avanzada .contenido {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.notificacion-avanzada .icono-container {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.notificacion-avanzada .icono {
    font-size: 48px;
}

.notificacion-avanzada .papelera-icono {
    width: 100%;
    height: 100%;
    stroke: #ff4136;
}

.notificacion-avanzada .mensaje {
    font-size: 18px;
    font-weight: 500;
    color: white;
}

.notificacion-avanzada.success .icono {
    color: #4CAF50;
}

.notificacion-avanzada.error .icono {
    color: #f44336;
}

.notificacion-avanzada.visible .icono {
    animation: pulse 0.5s ease-in-out infinite;
}

.notificacion-avanzada.visible .papelera-icono {
    animation: shake 0.5s ease-in-out;
}

.notificacion-avanzada.visible .papelera-icono line {
    animation: fadeInOut 1s ease-in-out infinite;
}

/* ==========================================================================
   TABLAS
   ========================================================================== */

.table-responsive {
    margin: 2rem 0;
    overflow-x: auto;
}

.table-gastos {
    width: 100%;
    border-collapse: collapse;
}

.table-header th {
    font-weight: 600;
    text-align: left;
    padding: 1rem 0.5rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-gastos td {
    padding: 1rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-gastos td[data-label="Fecha"] {
    min-width: 100px;
    font-weight: 600;
    color: #000000;
    white-space: nowrap;
    text-align: center;
    font-size: 1rem;
}

.table-gastos tr:hover {
    background-color: var(--hover-color);
    transition: background-color 0.2s ease;
}

.table-gastos i {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    margin-right: 0.5rem;
    font-size: 1.1em;
    color: var(--accent-color);
}

.table-gastos .action-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.5rem;
    transition: opacity 0.2s ease;
}

.table-gastos .action-btn:hover {
    opacity: 0.7;
}

.table-gastos .action-btn:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.table-gastos td:empty::before {
    content: '—';
    color: var(--border-color);
}

.table-gastos tbody tr {
    animation: fadeIn 0.5s ease-out;
}

/* Filas especiales */
.traspaso-bancario {
    background-color: #e6f7ff;
}

.ingreso-bancario {
    background-color: #e6ffe6;
}

.ingreso-bancario:hover {
    background-color: #d4ffd4;
}

/* ==========================================================================
   FILTROS
   ========================================================================== */

.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 auto 2rem auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
}

.filter-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

.filter-header:hover {
    color: #3498db;
}

.toggle-filter-icon {
    transition: transform 0.3s ease;
    font-size: 0.9em;
}

.filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding: 0 1rem 1rem 1rem;
    box-sizing: border-box;
    width: 100%;
}

.filter-section:not(.expanded) .filter-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: 0;
}

.filter-section.expanded .filter-content {
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
    overflow: visible;
}

.filter-section.expanded .toggle-filter-icon {
    transform: rotate(180deg);
}

#filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    overflow: visible;
}

/* Grupo de rango de fechas */
.date-range-group {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fb 100%);
    border: 2px solid #e3e8ee;
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.date-range-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #26de81 0%, #10ac84 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.date-range-group:hover::before {
    opacity: 1;
}

.date-range-group:hover {
    border-color: #26de81;
    box-shadow: 0 8px 25px rgba(38, 222, 129, 0.12);
    transform: translateY(-2px);
}

.date-range-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.date-range-label i {
    color: #26de81;
    font-size: 1.1rem;
}

.date-inputs-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 1.25rem;
}

.date-input-wrapper {
    position: relative;
}

.date-sublabel {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #333333;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.date-input-wrapper input[type="date"] {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e3e8ee;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #000000;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.date-input-wrapper input[type="date"]:focus {
    outline: none;
    border-color: #26de81;
    box-shadow: 0 0 0 3px rgba(38, 222, 129, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.date-input-wrapper input[type="date"]:hover {
    border-color: #26de81;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.date-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #26de81;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    font-weight: 600;
}

/* ==========================================================================
   BALANCE Y ESTADÍSTICAS
   ========================================================================== */

#balance-mensual-container {
    width: 300px;
    height: auto;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.balance-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.balance-header i {
    color: #3182ce;
    font-size: 24px;
    margin-right: 10px;
}

.balance-header h3 {
    color: #000000;
    font-weight: 700;
    font-size: 20px;
    margin: 0;
}

.balance-total {
    font-size: 36px;
    font-weight: bold;
    color: #38a169;
    margin-bottom: 20px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.balance-item span:first-child {
    font-weight: 500;
}

.ingresos {
    background-color: #f0fff4;
    color: #38a169;
}

.gastos {
    background-color: #fff5f5;
    color: #e53e3e;
}

.gastos-bancarios,
.gastos-diarios {
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    background-color: #f7fafc;
}

.balance-positivo {
    color: #28a745 !important;
    font-weight: bold;
}

.balance-negativo {
    color: #dc3545 !important;
    font-weight: bold;
}

#total-gastos-container,
#balance-mensual-container,
#resumen-filtros-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#resumen-filtros-container {
    border: 2px solid #3498db;
    background: linear-gradient(135deg, #f8faff 0%, #e3f2fd 100%);
}

#resumen-filtros-container .balance-header i {
    color: #3498db;
}

#total-gastos-mes {
    color: #000000;
    font-weight: 700;
    margin-bottom: 1rem;
}

#total-gastos {
    font-size: 2rem;
    font-weight: bold;
    color: #dc3545;
    margin: 1rem 0;
}

#balance-mensual {
    font-size: 2rem;
    font-weight: bold;
    color: #28a745;
    margin: 1rem 0;
}

#contenedor-principal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */

.contabilidad-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
}

/* ==========================================================================
   TARJETAS Y BOTONES
   ========================================================================== */

.botones-contabilidad {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: #000000;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-card {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-card:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

#abrir-modal-gasto,
#abrir-modal-camara,
#abrir-modal-categorias,
#abrir-modal-bancos,
#ver-grafica,
#ver-grafica-anual,
#analisis-ia {
    background: linear-gradient(45deg, var(--accent-color), #0056b3);
}

/* Colores específicos para botones */
#abrir-modal-gasto { background: linear-gradient(45deg, #ff6b6b, #feca57); }
#abrir-modal-camara { background: linear-gradient(45deg, #54a0ff, #5f27cd); }
#abrir-modal-categorias { background: linear-gradient(45deg, #26de81, #10ac84); }
#abrir-modal-bancos { background: linear-gradient(45deg, #4b7bec, #3867d6); }
#ver-grafica { background: linear-gradient(45deg, #ff9ff3, #f368e0); }
#ver-grafica-anual { background: linear-gradient(45deg, #ff9a9e, #fad0c4); }
#analisis-ia { background: linear-gradient(45deg, #0073aa, #00a0e9); }

.btn-ia {
    box-shadow: 0 10px 30px rgba(0, 115, 170, 0.5);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.btn-ia:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 115, 170, 0.6);
}

.btn-ia:hover .btn-brain svg {
    transform: translateY(-50%) scale(1.2) rotate(10deg);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}

.btn-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.btn-particles:before,
.btn-particles:after {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, #ffffff 10%, transparent 10%),
                radial-gradient(circle, #ffffff 10%, transparent 10%);
    background-size: 20px 20px;
    opacity: 0;
    animation: particleAnimation 8s linear infinite;
}

.btn-particles:after {
    animation-delay: -4s;
}

.btn-text {
    display: inline-block;
    animation: glow 2s ease-in-out infinite alternate;
}

/* ==========================================================================
   HEADER & MENÚ HAMBURGUESA
   ========================================================================== */

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    gap: 1rem;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    justify-content: flex-end;
    margin-right: 1rem;
}

.header-btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    min-width: 100px;
}

.header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#abrir-modal-gasto.header-btn {
    background: linear-gradient(45deg, #ff6b6b, #feca57);
}

#abrir-modal-camara.header-btn {
    background: linear-gradient(45deg, #54a0ff, #5f27cd);
}

.hamburger-menu-btn {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.hamburger-menu-btn:hover {
    background-color: #f0f0f0;
    color: #3498db;
}

.main-hamburger-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

.main-hamburger-menu.show {
    display: block;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100%;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.main-hamburger-menu.show .menu-content {
    transform: translateX(0);
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

.menu-header h3 {
    margin: 0;
    color: #000000;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-menu-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-menu-btn:hover {
    background-color: #e9ecef;
    color: #000000;
}

.menu-items {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.menu-item {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #26de81, #10ac84);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    box-sizing: border-box;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.menu-item:nth-child(2) {
    background: linear-gradient(45deg, #4b7bec, #3867d6);
}

.menu-item-logout {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52) !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    border-top: 1px solid #eee;
    padding-top: 1rem !important;
    text-decoration: none;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
}

.menu-item-logout:hover {
    background: linear-gradient(45deg, #ff5252, #d32f2f) !important;
    text-decoration: none;
    color: white !important;
}

.menu-section {
    margin-bottom: 2rem;
}

.menu-section-title {
    margin: 0 0 1rem 0;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.menu-item-analysis:nth-child(1) {
    background: linear-gradient(45deg, #ff9ff3, #f368e0);
}

.menu-item-analysis:nth-child(2) {
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
}

.menu-item-analysis:nth-child(3) {
    background: linear-gradient(45deg, #0073aa, #00a0e9);
}

/* ==========================================================================
   SECCIONES DE CATEGORÍAS
   ========================================================================== */

.categoria-section {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.categoria-section.diarias {
    border-color: #26de81;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
}

.categoria-section.banco {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f4ff 0%, #e6f0ff 100%);
}

.categoria-section h3 {
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 16px 16px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.categoria-section.diarias h3 {
    background: linear-gradient(135deg, #26de81 0%, #10ac84 100%);
    box-shadow: 0 4px 12px rgba(38, 222, 129, 0.3);
}

.categoria-section.banco h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.categoria-section.diarias h3::before {
    content: "💰";
    font-size: 1.2rem;
}

.categoria-section.banco h3::before {
    content: "🏦";
    font-size: 1.2rem;
}

.categoria-section table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.categoria-section table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.categoria-section table th {
    color: white;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.categoria-section table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f4;
}

.categoria-section table tbody tr:hover {
    background: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.categoria-section table td {
    padding: 1rem;
    font-size: 0.9rem;
    color: #000000;
    font-weight: 500;
}

.categoria-section table td:first-child {
    font-weight: 600;
}

.categoria-section .btn-editar,
.categoria-section .btn-borrar {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.categoria-section .btn-editar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.categoria-section .btn-editar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.categoria-section .btn-borrar {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.categoria-section .btn-borrar:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

/* ==========================================================================
   GESTIÓN DE BANCOS (SweetAlert2)
   ========================================================================== */

.swal2-html-container h3 {
    text-align: center;
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    margin: -1rem -1rem 1.5rem -1rem;
    padding: 1.2rem;
    background: linear-gradient(135deg, #2c5aa0 0%, #1e3a5f 100%);
    border-radius: 12px 12px 0 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
    position: relative;
}

.swal2-html-container h3::before {
    content: "🏦";
    font-size: 1.3rem;
    margin-right: 0.5rem;
}

.swal2-html-container .swal2-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid #e3f2fd;
}

.swal2-html-container .swal2-table thead {
    background: linear-gradient(135deg, #2c5aa0 0%, #1565c0 100%);
}

.swal2-html-container .swal2-table th {
    color: white;
    font-weight: 700;
    padding: 1.2rem;
    text-align: left;
    font-size: 1rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: none;
}

.swal2-html-container .swal2-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e3f2fd;
}

.swal2-html-container .swal2-table tbody tr:hover {
    background: linear-gradient(135deg, #f3f8ff 0%, #e8f4f8 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.15);
}

.swal2-html-container .swal2-table tbody tr:last-child {
    border-bottom: none;
}

.swal2-html-container .swal2-table td {
    padding: 1.2rem;
    font-size: 1rem;
    color: #000000;
    font-weight: 600;
    border: none;
}

.swal2-html-container .swal2-table td:first-child {
    font-weight: 700;
    position: relative;
}

.swal2-html-container .swal2-table td:first-child::before {
    content: "💳";
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

.btn-editar-banco,
.btn-borrar-banco {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: 0.75rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-editar-banco {
    background: linear-gradient(135deg, #2c5aa0 0%, #1565c0 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
}

.btn-editar-banco:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(44, 90, 160, 0.4);
}

.btn-borrar-banco {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    box-shadow: 0 4px 8px rgba(211, 47, 47, 0.3);
}

.btn-borrar-banco:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #880e4f 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 16px rgba(211, 47, 47, 0.4);
}

#btn-anadir-banco {
    background: linear-gradient(135deg, #2c5aa0 0%, #1565c0 100%) !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 1rem 2rem !important;
    font-weight: 700 !important;
    margin: 1.5rem auto 0 auto !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
    color: white !important;
    text-align: center !important;
    font-size: 1.1rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    box-shadow: 0 6px 12px rgba(44, 90, 160, 0.3) !important;
}

#btn-anadir-banco:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    transform: translateY(-3px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(44, 90, 160, 0.4) !important;
}

#btn-anadir-banco::before {
    content: "➕ ";
    margin-right: 0.5rem;
}

/* ==========================================================================
   MES Y GRÁFICAS
   ========================================================================== */

.meses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 20px;
}

.btn-mes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-mes:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.mes-nombre {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.mes-total {
    font-size: 14px;
    color: #0073aa;
}

.meses-modal-popup {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.meses-modal-title {
    font-size: 24px;
    color: #000000;
    font-weight: 700;
}

.meses-modal-close {
    color: #666;
}

.meses-modal-content {
    padding: 0;
}

.total-anual {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin-top: 20px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 10px;
    color: #0073aa;
}

.total-anual span {
    color: #d63638;
}

.grafica-container {
    width: 100%;
    height: 70vh;
    margin: 0 auto;
    padding: 1rem;
    min-height: 500px;
}

.grafica-container canvas {
    max-width: 100%;
    height: 70vh !important;
    min-height: 500px !important;
}

/* ==========================================================================
   TABLA DE GASTOS PRINCIPAL
   ========================================================================== */

.gastos-table {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-top: 2rem;
}

#gastos-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#gastos-table th {
    background: #f8f9fa;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: #000000;
    border-bottom: 2px solid #dee2e6;
}

#gastos-table td {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

#gastos-table tr:hover {
    background: #f8f9fa;
}

/* ==========================================================================
   IMAGEN DE FAMILIA
   ========================================================================== */

.imagen-familia {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 1rem auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s;
}

.imagen-familia:hover {
    transform: scale(1.1);
}

#imagen-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
}

/* ==========================================================================
   ANÁLISIS FINANCIERO
   ========================================================================== */

.analisis-financiero {
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    line-height: 1.6;
}

.saludo {
    font-size: 24px;
    color: #0073aa;
    margin-bottom: 25px;
}

.titulo-seccion {
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 8px;
    margin-top: 30px;
    margin-bottom: 20px;
}

.resumen-gastos {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.lista-categorias {
    list-style-position: inside;
    padding-left: 0;
}

.lista-categorias li {
    margin-bottom: 12px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.lista-consejos {
    list-style-type: none;
    padding-left: 0;
}

.lista-consejos li {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.lista-consejos li::before {
    margin-right: 10px;
}

.despedida {
    font-style: italic;
    color: #000000;
    font-weight: 600;
    margin-top: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

/* ==========================================================================
   CHOSEN.JS (Select mejorado)
   ========================================================================== */

.chosen-container-single .chosen-drop {
    max-height: 200px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
    border: 1px solid #ccc !important;
}

.chosen-container .chosen-results {
    max-height: 180px !important;
    overflow-y: auto !important;
    padding: 0 !important;
    margin: 0 !important;
}

#categoria_filtro_chosen .chosen-drop {
    max-height: 200px !important;
    overflow-y: auto !important;
    position: absolute !important;
    z-index: 99999 !important;
}

#categoria_filtro_chosen .chosen-results {
    max-height: 180px !important;
    overflow-y: auto !important;
}

.chosen-container .chosen-results li {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.chosen-container .chosen-results li:last-child {
    border-bottom: none;
}

.chosen-container .chosen-results li.highlighted {
    background-color: #3498db !important;
    color: white !important;
}

.chosen-container {
    position: relative;
    z-index: 1000;
}

.chosen-container.chosen-with-drop {
    z-index: 9999;
}

.chosen-container .chosen-results::-webkit-scrollbar {
    width: 6px;
}

.chosen-container .chosen-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chosen-container .chosen-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chosen-container .chosen-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==========================================================================
   ÚLTIMOS TICKETS
   ========================================================================== */

#ultimos-tickets-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    overflow: hidden;
}

.ultimos-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ultimos-tickets-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-cerrar-seccion {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-cerrar-seccion:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ultimos-tickets-content {
    padding: 20px;
    min-height: 200px;
}

.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.ticket-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ticket-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ticket-fecha {
    font-weight: bold;
    color: #495057;
    font-size: 0.95rem;
}

.ticket-tipo {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.ticket-tipo.badge-diario {
    background: #e3f2fd;
    color: #1976d2;
}

.ticket-tipo.badge-bancario {
    background: #f3e5f5;
    color: #7b1fa2;
}

.ticket-body {
    margin-bottom: 10px;
}

.ticket-concepto {
    font-weight: 500;
    color: #212529;
    margin-bottom: 5px;
    font-size: 1rem;
}

.ticket-precio {
    font-size: 1.3rem;
    font-weight: bold;
    color: #dc3545;
}

.ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.ticket-categoria {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ticket-creado {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8rem;
}

.ticket-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ticket-card:hover .ticket-actions {
    opacity: 1;
}

.btn-ticket-editar,
.btn-ticket-eliminar {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-ticket-editar {
    background: #e3f2fd;
    color: #1976d2;
}

.btn-ticket-editar:hover {
    background: #1976d2;
    color: white;
}

.btn-ticket-eliminar {
    background: #ffebee;
    color: #c62828;
}

.btn-ticket-eliminar:hover {
    background: #c62828;
    color: white;
}

.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.sin-tickets {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #ffebee;
    border-radius: 8px;
}

/* ==========================================================================
   RESPONSIVE MÓVILES
   ========================================================================== */

@media (max-width: 768px) {
    /* Contenedor */
    .contabilidad-container {
        padding: 0 0.5rem;
        margin: 1rem auto;
        width: 100%;
        max-width: 100vw;
    }

    /* Botones contabilidad */
    .botones-contabilidad {
        grid-template-columns: 1fr;
    }

    /* Header buttons */
    .header-buttons {
        gap: 0.25rem;
    }

    .header-btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
        min-width: 80px;
    }

    .header-btn i {
        font-size: 0.9rem;
    }

    /* Menu hamburguesa */
    .menu-content {
        width: 280px;
    }

    /* Filtros */
    .filter-section {
        padding: 1rem;
        margin: 0 auto 1rem auto;
        max-width: 100%;
        width: calc(100vw - 2rem);
        box-sizing: border-box;
    }

    .filter-content {
        padding: 0 0.5rem 1rem 0.5rem;
        width: 100%;
    }

    .date-range-group {
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        padding: 1rem;
    }

    .date-inputs-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 1rem;
        text-align: center;
    }

    .date-separator {
        grid-row: 2;
        transform: rotate(90deg);
        font-size: 1rem;
        margin: 0.25rem 0;
    }

    .date-input-wrapper:last-child {
        grid-row: 3;
    }

    /* Formularios */
    #filter-form {
        grid-template-columns: 1fr;
    }

    .form-group {
        width: 100%;
        box-sizing: border-box;
    }

    .form-group select,
    .form-group input {
        width: 95%;
        max-width: 95%;
        box-sizing: border-box;
    }

    #categoria_filtro_chosen {
        width: 100% !important;
        max-width: 100% !important;
    }

    .form-group select[multiple] {
        height: 120px;
    }

    /* Botones filtro */
    .btn-filtrar,
    .btn-quitar-filtros {
        width: 100%;
        margin-bottom: 0.5rem;
        justify-content: center;
    }

    /* Tabla gastos */
    .table-responsive {
        margin: 1rem 0;
    }

    .table-gastos {
        font-size: 0.875rem;
    }

    .table-header th {
        padding: 0.75rem 0.25rem;
        font-size: 0.75rem;
    }

    .table-gastos td {
        padding: 0.75rem 0.25rem;
    }

    .table-gastos i {
        font-size: 1em;
        margin-right: 0.25rem;
    }

    .table-gastos .action-btn {
        padding: 0.25rem;
        margin-right: 0.25rem;
        font-size: 0.75rem;
    }

    /* Tabla principal en móvil */
    #gastos-table {
        border: 0;
    }

    #gastos-table thead {
        display: none;
    }

    #gastos-table tr {
        margin-bottom: 1rem;
        display: block;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 1rem;
        background: white;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    #gastos-table td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
        position: relative;
        padding-left: 130px;
        min-height: 25px;
        font-size: 1rem;
        color: #000000;
        font-weight: 500;
    }

    #gastos-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 120px;
        font-weight: 700;
        color: #000000;
        font-size: 0.9rem;
    }

    #gastos-table td.fecha {
        color: #000000;
        font-weight: 700;
        font-size: 1.1rem;
    }

    #gastos-table td.precio {
        color: #dc3545;
        font-weight: 700;
        font-size: 1.1rem;
    }

    #gastos-table td.concepto {
        font-weight: 700;
        color: #000000;
        font-size: 1rem;
    }

    #gastos-table td.categoria {
        color: #28a745;
        font-weight: 600;
    }

    #gastos-table td.numero-gasto {
        text-align: center;
        font-weight: 700;
        color: #000000;
        font-size: 1.1rem;
        padding-left: 0;
        margin-bottom: 0.5rem;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.5rem;
    }

    #gastos-table td.numero-gasto:before {
        display: none;
    }

    #gastos-table tr + tr {
        margin-top: 1rem;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    /* Contenedores */
    #contenedor-principal {
        gap: 1rem;
        margin: 1rem 0;
        grid-template-columns: 1fr;
    }

    #balance-mensual-container {
        padding: 1rem;
    }

    #balance-mensual-container h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }

    .balance-mensual-item {
        padding: 0.4rem 0;
        font-size: 0.9rem;
    }

    .balance-positivo {
        font-size: 1.3rem !important;
        margin-bottom: 0.8rem;
    }

    .balance-negativo {
        font-size: 1.3rem !important;
        margin-bottom: 0.8rem;
    }

    /* Tickets */
    .tickets-grid {
        grid-template-columns: 1fr;
    }

    .ticket-actions {
        opacity: 1;
    }

    .ultimos-tickets-header h2 {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* Date range */
    .date-range-group {
        padding: 1rem;
        border-radius: 12px;
    }

    .date-inputs-container {
        gap: 0.75rem;
    }

    .date-separator {
        display: none;
    }

    .date-range-label {
        font-size: 0.95rem;
        margin-bottom: 0.75rem;
    }

    .date-input-wrapper input[type="date"] {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Tabla estilo card */
    .table-gastos {
        font-size: 0.8125rem;
    }

    .table-gastos,
    .table-gastos tbody,
    .table-gastos tr,
    .table-gastos td {
        display: block;
    }

    .table-header {
        display: none;
    }

    .table-gastos tr {
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 0.5rem;
    }

    .table-gastos td {
        border: none;
        position: relative;
        padding-left: 50%;
        min-height: 2.5em;
        display: flex;
        align-items: center;
    }

    .table-gastos td:before {
        content: attr(data-label);
        position: absolute;
        left: 0.5rem;
        width: 45%;
        padding-right: 0.5rem;
        white-space: nowrap;
        font-weight: bold;
        display: flex;
        align-items: center;
    }

    .table-gastos i {
        margin-right: 0.5rem;
    }

    .table-gastos .action-btn {
        padding: 0.5rem;
        margin: 0.25rem 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .table-gastos .action-btn i {
        margin-right: 0.5rem;
    }
}

/* Loading modal para análisis de IA */
.analisis-loading-modal {
    padding: 2rem !important;
}

.analisis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #26de81;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.analisis-loading p {
    margin: 0;
    font-size: 1rem;
    color: #555;
    text-align: center;
}
