/* ===== VARIABLES CSS ===== */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #0f172a;
    --bg-card: #ffffff;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    
    --container-max-width: 1400px;
    --header-height: 80px;
    --nav-height: 70px;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER CORREGIDO ===== */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    height: auto;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: var(--container-max-width);
    width: 100%;
    text-align: center;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: blue !important;
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    color: blue !important;
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
}

/* ===== NAVEGACIÓN CORREGIDA ===== */
.navigation {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 2rem;
    height: auto;
    min-height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: var(--header-height);
    z-index: 90;
}

.nav-container {
    max-width: var(--container-max-width);
    width: 100%;
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: fit-content;
    text-decoration: none;
    border: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.2);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.nav-item i {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.nav-item span {
    font-weight: 500;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: var(--container-max-width);
    margin: 0 auto;
    width: 100%;
}

/* ===== SECTIONS ===== */
.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-header i {
    color: var(--primary-color);
}

/* ===== CARDS ===== */
.form-card,
.data-card,
.filters-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.data-card h3 {
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== FORMS ===== */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.conditional-form {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.conditional-form h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ===== COMBOS GRID ===== */
.combos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.combo-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.combo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--info-color));
    transform: scaleX(0);
    transition: var(--transition);
}

.combo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.combo-card:hover::before {
    transform: scaleX(1);
}

.combo-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
    box-shadow: var(--shadow-xl);
}

.combo-card.selected::before {
    transform: scaleX(1);
    background: rgba(255, 255, 255, 0.3);
}

.combo-title {
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.combo-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--success-color);
    margin: 0.75rem 0;
}

.combo-card.selected .combo-price {
    color: #fbbf24;
}

.combo-services {
    list-style: none;
    margin: 1rem 0;
}

.combo-services li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.combo-services li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
}

.combo-card.selected .combo-services li::before {
    color: #fbbf24;
}

/* ===== TABLES ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.data-table th,
.data-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* ===== FILTERS ===== */
.filters-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
}

.filters-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-expiring {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.status-expired {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-income .stat-icon {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.stat-expense .stat-icon {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
}

.stat-profit .stat-icon {
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
}

.stat-accounts .stat-icon {
    background: linear-gradient(135deg, var(--info-color), #0891b2);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== ALERTS ===== */
.alert-container {
    margin: 1.5rem 0;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

.alert-info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    color: #0c4a6e;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.alert-success::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
}

.alert-danger::before {
    content: '✕';
    color: var(--danger-color);
    font-weight: bold;
}

.alert-info::before {
    content: 'ℹ';
    color: var(--info-color);
    font-weight: bold;
}

.alert-warning::before {
    content: '⚠';
    color: var(--warning-color);
    font-weight: bold;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ESTILOS PARA REPORTES ===== */
.report-summary {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.report-summary h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

.report-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-button {
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    transition: var(--transition);
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-button:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    background: white;
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* ===== RESUMEN DETALLADO CORREGIDO ===== */
#resumenDetallado {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

#resumenDetallado .resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

#resumenDetallado .resumen-item {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: var(--transition);
}

#resumenDetallado .resumen-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.15);
}

#resumenDetallado .resumen-valor {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: block;
    line-height: 1.1;
}

#resumenDetallado .resumen-label {
    color: #6c757d;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Colores específicos para diferentes tipos */
#resumenDetallado .resumen-item:nth-child(1) {
    border-left: 4px solid #28a745;
}

#resumenDetallado .resumen-item:nth-child(1) .resumen-valor {
    color: #28a745 !important;
}

#resumenDetallado .resumen-item:nth-child(2) {
    border-left: 4px solid #dc3545;
}

#resumenDetallado .resumen-item:nth-child(2) .resumen-valor {
    color: #dc3545 !important;
}

#resumenDetallado .resumen-item:nth-child(3) {
    border-left: 4px solid var(--primary-color);
}

#resumenDetallado .utilidad-positiva {
    color: #28a745 !important;
}

#resumenDetallado .utilidad-negativa {
    color: #dc3545 !important;
}

/* Estilo para el análisis del período */
#resumenDetallado .analisis-periodo {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

#resumenDetallado .analisis-periodo h4 {
    color: #343a40;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

#resumenDetallado .analisis-periodo p {
    color: #495057;
    margin: 1rem 0;
    font-size: 1rem;
    line-height: 1.6;
    padding: 0.5rem 0;
}

#resumenDetallado .analisis-periodo strong {
    color: #212529;
    font-weight: 600;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    #resumenDetallado .resumen-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    #resumenDetallado .resumen-valor {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
        height: auto;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    .navigation {
        padding: 0.5rem 1rem;
        height: auto;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
    
    .nav-item {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        justify-content: center;
        border-radius: 8px;
    }
    
    .nav-item span {
        display: inline;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-card,
    .data-card,
    .filters-card {
        padding: 1.5rem;
    }
    
    .form-row,
    .filters-row {
        grid-template-columns: 1fr;
    }
    
    .combos-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-footer {
        justify-content: stretch;
        flex-direction: column;
    }
    
    .report-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        border-radius: var(--border-radius);
        border-bottom: none;
        margin-bottom: 0.5rem;
    }
    
    .tab-button.active {
        background: var(--primary-color);
        color: white;
    }
    
    #resumenDetallado {
        padding: 1.5rem;
    }
    
    #resumenDetallado .resumen-grid {
        grid-template-columns: 1fr;
    }
    
    #resumenDetallado .resumen-valor {
        font-size: 1.8rem;
    }
    
    #resumenDetallado .analisis-periodo {
        padding: 1.5rem;
    }
    
    #resumenDetallado .analisis-periodo h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .header {
        height: 60px;
    }
    
    .header h1 {
        font-size: 1.25rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .navigation {
        height: 50px;
    }
    
    .nav-item {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    .nav-item span {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .combo-title {
        font-size: 1.1rem;
    }
    
    .combo-price {
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    #resumenDetallado .resumen-valor {
        font-size: 1.5rem;
    }
    
    #resumenDetallado .resumen-label {
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}

/* ===== DARK MODE PREPARATION ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1e293b;
        --bg-secondary: #334155;
        --bg-card: #1e293b;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #374151;
    }
    
    body {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    }
    
    #resumenDetallado {
        background: linear-gradient(135deg, #334155 0%, #475569 100%);
    }
    
    #resumenDetallado .resumen-item {
        background: #1e293b;
        border-color: #475569;
    }
    
    #resumenDetallado .analisis-periodo {
        background: #1e293b;
        border-color: #475569;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

.animate-bounce-in {
    animation: bounceIn 0.5s ease-out;
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center !important;
}

.text-left {
    text-align: left !important;
}

.text-right {
    text-align: right !important;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.5rem !important; }
.mb-2 { margin-bottom: 1rem !important; }
.mb-3 { margin-bottom: 1.5rem !important; }
.mb-4 { margin-bottom: 2rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.5rem !important; }
.mt-2 { margin-top: 1rem !important; }
.mt-3 { margin-top: 1.5rem !important; }
.mt-4 { margin-top: 2rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.5rem !important; }
.p-2 { padding: 1rem !important; }
.p-3 { padding: 1.5rem !important; }
.p-4 { padding: 2rem !important; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.justify-center { justify-content: center !important; }
.justify-start { justify-content: flex-start !important; }
.justify-end { justify-content: flex-end !important; }
.justify-between { justify-content: space-between !important; }

.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }

.w-full { width: 100% !important; }
.h-full { height: 100% !important; }

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .navigation,
    .btn,
    .action-buttons,
    .modal {
        display: none !important;
    }
    
    .main-content {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
    }
    
    .data-card,
    .form-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }
    
    .data-table {
        font-size: 12px !important;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem !important;
    }
}

/* ===== FIN DE ESTILOS ===== */

/* ===== ESTILOS PARA VISTA PREVIA DEL RESUMEN DETALLADO ===== */
#resumenDetallado {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

#resumenDetallado .resumen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

#resumenDetallado .resumen-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#resumenDetallado .resumen-valor {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: block;
}

#resumenDetallado .resumen-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Colores específicos para diferentes tipos */
#resumenDetallado .resumen-item:nth-child(1) .resumen-valor {
    color: #28a745; /* Verde para ingresos */
}

#resumenDetallado .resumen-item:nth-child(2) .resumen-valor {
    color: #dc3545; /* Rojo para egresos */
}

#resumenDetallado .utilidad-positiva {
    color: #28a745 !important; /* Verde para utilidad */
}

#resumenDetallado .utilidad-negativa {
    color: #dc3545 !important; /* Rojo para pérdida */
}

/* Estilo para el análisis del período */
#resumenDetallado div[style*="text-align: center"] {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#resumenDetallado h4 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

#resumenDetallado p {
    color: #6c757d;
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

#resumenDetallado strong {
    color: #343a40;
    font-weight: 600;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    #resumenDetallado .resumen-grid {
        grid-template-columns: 1fr;
    }
    
    #resumenDetallado .resumen-valor {
        font-size: 1.5rem;
    }
}

/* Estilos para campos de fecha y hora */
input[type="datetime-local"] {
    font-family: inherit;
    font-size: 0.95rem;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    border-radius: 4px;
    margin-left: 8px;
    opacity: 0.7;
    transition: var(--transition);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background-color: rgba(59, 130, 246, 0.1);
}