/* ==================== VARIABLES ==================== */
:root {
    --primary: var(--primary);
    --primary-dark: #5568d3;
    --secondary: var(--secondary);
    --accent: #f093fb;
    --accent-2: #f5576c;
    --success: #43e97b;
    --warning: #fee140;
    --danger: #f5576c;

    --bg-main: #f8f9fa;
    --bg-card: #ffffff;
    --bg-sidebar: #1a1a2e;
    --bg-sidebar-light: #2a2a3e;

    --text-dark: #1a1a2e;
    --text-light: #ffffff;
    --text-muted: #6c757d;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== DARK MODE VARIABLES ==================== */
body.dark-mode {
    --bg-main: #0d1117;
    --bg-card: #161b22;
    --bg-sidebar: #010409;
    --bg-sidebar-light: #161b22;

    --text-dark: #e6edf3;
    --text-light: #ffffff;
    --text-muted: #8b949e;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.7);
}

/* Dark mode specific styles */
body.dark-mode .sidebar {
    background: linear-gradient(180deg, #010409 0%, #0d1117 100%);
    border-right: 1px solid #30363d;
}

body.dark-mode .main-content {
    background: var(--bg-main);
}

body.dark-mode .metrica-card,
body.dark-mode .tab-content,
body.dark-mode .mes-header {
    background: var(--bg-card);
    border: 1px solid #30363d;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: #0d1117;
    border-color: #30363d;
    color: var(--text-dark);
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
    border-color: var(--primary);
    background: #161b22;
}

body.dark-mode .select-mes,
body.dark-mode .user-menu-button {
    background: var(--bg-card);
    border-color: #30363d;
    color: var(--text-dark);
}

body.dark-mode .user-name {
    color: var(--text-dark);
}

body.dark-mode .user-dropdown {
    background: var(--bg-card);
    border-color: #30363d;
}

body.dark-mode .persona-card,
body.dark-mode .config-card {
    background: #0d1117;
    border-color: #30363d;
}

body.dark-mode .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

body.dark-mode .btn-secondary {
    background: #21262d;
    border-color: #30363d;
    color: var(--text-dark);
}

body.dark-mode .btn-secondary:hover {
    background: #30363d;
}

body.dark-mode table {
    border-color: #30363d;
}

body.dark-mode th {
    background: #161b22;
    border-color: #30363d;
}

body.dark-mode td {
    border-color: #30363d;
}

body.dark-mode tr:hover {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
}

body.dark-mode .modal-content {
    background: var(--bg-card);
    border: 1px solid #30363d;
}

body.dark-mode .tabs button {
    color: var(--text-muted);
}

body.dark-mode .tabs button.active {
    color: var(--text-light);
    border-bottom-color: var(--primary);
}

body.dark-mode .stat-label,
body.dark-mode .stat-explicacion {
    color: var(--text-muted);
}

body.dark-mode .resumen-personal {
    background: linear-gradient(135deg, var(--bg-card) 0%, #0d1117 100%);
    border-color: #30363d;
}

body.dark-mode .stat-card {
    background: #0d1117;
    border-color: #30363d;
}

body.dark-mode .stat-card:hover {
    background: #161b22;
    border-color: var(--primary);
}

body.dark-mode .stat-destacada {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border-color: var(--primary);
}

body.dark-mode .stat-icon {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, transparent) 0%, color-mix(in srgb, var(--secondary) 20%, transparent) 100%);
}

body.dark-mode .info-card {
    background: #0d1117;
    border-color: #30363d;
}

body.dark-mode .info-card:hover {
    background: #161b22;
    border-color: var(--success);
}

body.dark-mode .info-valor {
    color: #e6edf3 !important;
}

body.dark-mode .chart-container {
    background: var(--bg-card);
    border-color: #30363d;
}

body.dark-mode .persona-division {
    background: var(--bg-card);
    border-color: #30363d;
}

body.dark-mode .persona-division:hover {
    border-color: var(--primary);
}

body.dark-mode .tabla-comparacion {
    background: var(--bg-card);
    border-color: #30363d;
}

body.dark-mode .tabla-comparacion tbody tr {
    border-bottom: 1px solid #30363d;
}

body.dark-mode .tabla-comparacion tbody tr:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent) 0%, color-mix(in srgb, var(--secondary) 10%, transparent) 100%);
}

body.dark-mode .tabla-comparacion table {
    color: #e6edf3;
}

body.dark-mode .tabla-comparacion td {
    color: #e6edf3 !important;
}

body.dark-mode .tabla-comparacion td:first-child {
    color: var(--primary) !important;
}

body.dark-mode .tabla-comparacion th {
    color: #ffffff !important;
}

body.dark-mode .tabla-comparacion button {
    color: #ffffff !important;
}

body.dark-mode .balance-deudas {
    background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
    border: 1px solid #30363d;
}

body.dark-mode .balance-deudas h2 {
    color: var(--text-dark);
}

body.dark-mode .balance-card {
    background: #0d1117;
    border: 1px solid #30363d;
}

body.dark-mode .balance-titulo {
    color: var(--text-muted);
}

body.dark-mode .balance-detalle {
    color: var(--text-dark);
}

body.dark-mode .division-justa h2 {
    color: var(--text-dark);
}

body.dark-mode .persona-division h3 {
    color: var(--text-dark);
}

body.dark-mode .chart-container h2 {
    color: var(--text-dark);
}

body.dark-mode .division-label {
    color: var(--text-muted);
}

body.dark-mode .division-valor {
    color: var(--text-dark);
}

body.dark-mode .division-row {
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    border-color: #30363d;
}

body.dark-mode .division-row:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 15%, transparent) 0%, color-mix(in srgb, var(--secondary) 15%, transparent) 100%);
}

body.dark-mode .division-persona {
    background: #0d1117;
    border: 1px solid #30363d;
}

body.dark-mode .division-persona:hover {
    background: #161b22;
    border-color: var(--primary);
}

body.dark-mode .division-nombre {
    color: var(--text-dark);
}

body.dark-mode .division-monto {
    color: var(--text-dark);
}

body.dark-mode .filtro-select {
    background: rgba(22, 27, 34, 0.95) !important;
    color: var(--text-dark);
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .filtro-select:hover {
    background: #161b22 !important;
}

body.dark-mode .filtro-select:focus {
    background: #161b22 !important;
    border-color: var(--primary);
}

body.dark-mode .gasto-item {
    background: #0d1117;
    border-color: #30363d;
}

body.dark-mode .gasto-item:hover {
    background: #161b22;
    border-color: var(--primary);
}

body.dark-mode .gasto-detalles {
    background: #0d1117;
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

body.dark-mode .gasto-detalle {
    color: #e6edf3;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent) 0%, color-mix(in srgb, var(--secondary) 10%, transparent) 100%);
}

body.dark-mode .gasto-detalle:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 20%, transparent) 0%, color-mix(in srgb, var(--secondary) 20%, transparent) 100%);
}

body.dark-mode .gasto-notas {
    background: linear-gradient(135deg, #1a1f2e 0%, #1e1a2e 100%);
    color: #e6edf3;
    border-left-color: var(--secondary);
}

body.dark-mode .gasto-pagado-por {
    background: linear-gradient(135deg, #0d1a2e 0%, #0d1520 100%);
    color: #e6edf3;
}

body.dark-mode .gasto-item h4 {
    color: #e6edf3;
}

body.dark-mode .gasto-division {
    background: linear-gradient(135deg, #1a1f2e 0%, #161b26 100%);
}

body.dark-mode .gasto-division h4 {
    color: #e6edf3;
}

body.dark-mode .division-personas {
    background: transparent;
}

body.dark-mode .gasto-actions {
    border-top-color: #30363d;
}

body.dark-mode .btn-editar,
body.dark-mode .btn-eliminar {
    color: #e6edf3;
}

body.dark-mode .btn-editar:hover {
    background: color-mix(in srgb, var(--primary) 20%, transparent);
}

body.dark-mode .btn-eliminar:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* ==================== RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 320px;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #16213e 100%);
    color: var(--text-light);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

/* Sidebar Toggle Button */
.sidebar-toggle-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 2px solid #e0e0e0;
    color: var(--text-dark);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.sidebar-toggle-btn:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-light);
    transform: scale(1.05);
}

.sidebar-toggle-btn:active {
    transform: scale(0.95);
}

/* Desktop: mostrar botón al inicio del header, ocultar en header-actions */
.sidebar-toggle-desktop {
    display: flex;
}

.sidebar-toggle-mobile {
    display: none;
}

.sidebar-toggle-btn .toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.sidebar-toggle-btn.sidebar-hidden .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.sidebar-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Collapsible Configuration Section */
.config-collapsible {
    margin-bottom: 1.5rem;
}

.config-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-sidebar-light);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-toggle-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    transform: translateX(2px);
}

.config-toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

.config-toggle-btn.collapsed .config-toggle-icon {
    transform: rotate(-90deg);
}

.config-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 1rem;
}

.config-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.sidebar-subsection {
    margin-bottom: 1.5rem;
}

.sidebar-subsection:last-child {
    margin-bottom: 0;
}

.persona-card {
    background: var(--bg-sidebar-light);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.input-nombre, .input-sueldo {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.input-nombre:focus, .input-sueldo:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.input-nombre::placeholder, .input-sueldo::placeholder {
    color: rgba(255,255,255,0.5);
}

.select-sidebar {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    background: var(--bg-sidebar-light);
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.select-sidebar:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

.config-extra {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-sm);
}

.config-extra label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.config-extra input[type="range"] {
    width: 100%;
    margin: 0.5rem 0;
}

.config-extra input[type="number"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.05);
    color: var(--text-light);
}

.hidden {
    display: none !important;
}

/* ==================== BUTTONS ==================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--primary) 40%, transparent);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-guardar {
    width: 100%;
    margin-top: 1rem;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-dark);
    border: 2px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--text-light);
    transform: translateY(-2px);
}

.btn-icon {
    background: var(--bg-card);
    border: 2px solid #e0e0e0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--text-light);
    transform: scale(1.05);
}

.btn-delete-mes {
    border-color: #ffcdd2;
    color: var(--danger);
    font-weight: bold;
}

.btn-delete-mes:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: var(--text-light);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    width: 100%;
}

.btn-danger {
    background: var(--danger);
    color: var(--text-light);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: #e04454;
    transform: translateY(-1px);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: 320px;
    flex: 1;
    padding: 2rem;
    max-width: calc(100% - 320px);
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

.main-content.sidebar-hidden {
    margin-left: 0;
    max-width: 100%;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.mes-selector {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.select-mes {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.select-mes:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

.select-mes:hover {
    border-color: var(--primary);
}

/* ==================== USER MENU ==================== */
.user-menu-container {
    position: relative;
}

.user-menu-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.user-menu-button:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
}

.user-icon {
    font-size: 1.2rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

body.dark-mode .dropdown-item {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.dropdown-item:hover {
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 10%, transparent) 0%, color-mix(in srgb, var(--secondary) 10%, transparent) 100%);
    padding-left: 1.5rem;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.dropdown-icon {
    font-size: 1.2rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-divider {
    height: 1px;
    background: rgba(0,0,0,0.1);
    margin: 0.5rem 0;
}

body.dark-mode .dropdown-divider {
    background: rgba(255,255,255,0.2);
}

/* ==================== MÉTRICAS ==================== */
.metricas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metrica-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.metrica-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.metrica-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-md);
}

.metrica-info {
    flex: 1;
}

.metrica-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.metrica-valor {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.tab {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.tab:hover {
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    box-shadow: var(--shadow-sm);
}

/* ==================== TAB CONTENT ==================== */
.tab-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    min-height: 500px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: slideInFade 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInFade {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tab-panel h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

/* ==================== DIVISIÓN JUSTA ==================== */
.division-justa {
    margin-bottom: 3rem;
}

.division-justa h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.personas-division {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.persona-division {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.persona-division::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.persona-division:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px color-mix(in srgb, var(--primary) 25%, transparent);
    border-color: var(--primary);
}

.persona-division h3 {
    font-size: 1.6rem;
    margin-bottom: 2rem;
    color: var(--text-dark);
    font-weight: 800;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
}

.division-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.division-row:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: translateX(4px);
}

.division-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.division-valor {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--text-dark);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(135deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.08) 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 1.5rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 40%, transparent);
}

/* ==================== CHARTS ==================== */
.chart-container {
    margin: 3rem 0;
    padding: 2.5rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.chart-container:hover {
    box-shadow: 0 12px 48px color-mix(in srgb, var(--primary) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary) 20%, transparent);
}

.chart-container h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--text-dark);
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--primary);
}

.chart-container canvas {
    max-height: 400px;
}

/* ==================== BADGES ==================== */
.recurrentes-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--success), #38f9d7);
    opacity: 0;
    transition: opacity 0.3s;
}

.info-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 48px rgba(67, 233, 123, 0.25);
    border-color: var(--success);
}

.info-card:hover::before {
    opacity: 1;
}

.badge {
    display: block;
    width: fit-content;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.75rem;
}

.badge-recurrente {
    background: linear-gradient(135deg, var(--success) 0%, #38f9d7 100%);
    color: white;
}

.badge-puntual {
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
    color: white;
}

.info-valor {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-dark);
}

/* ==================== FORMS ==================== */
.form-gastos {
    max-width: 900px;
    margin: 0 auto;
}

.form-metodo-division {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 2px solid color-mix(in srgb, var(--primary) 20%, transparent);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--primary) 10%, transparent);
    position: relative;
    overflow: hidden;
}

.form-metodo-division::before {
    content: '⚖️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 8rem;
    opacity: 0.05;
    transform: rotate(15deg);
}

.form-metodo-division h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin-bottom: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fafbff;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent);
    transform: translateY(-2px);
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    appearance: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08) 0%, rgba(56, 249, 215, 0.08) 100%);
    border-radius: var(--radius-md);
    border: 2px solid rgba(67, 233, 123, 0.2);
    transition: all 0.3s;
    cursor: pointer;
}

.form-checkbox:hover {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.12) 0%, rgba(56, 249, 215, 0.12) 100%);
    transform: translateX(4px);
}

.form-checkbox input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: var(--success);
}

.form-checkbox label {
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    font-size: 1.05rem;
    color: var(--text-dark);
}

/* ==================== LISTA GASTOS ==================== */
.filtros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px color-mix(in srgb, var(--primary) 30%, transparent);
    position: relative;
    overflow: hidden;
}

.filtros::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulseGlow 4s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.filtro-select {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-dark);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    padding-right: 3rem;
    appearance: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filtro-select:hover {
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--primary) 25%, transparent);
}

.filtro-select:focus {
    outline: none;
    border-color: white;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3), 0 8px 25px color-mix(in srgb, var(--primary) 25%, transparent);
    transform: translateY(-3px) scale(1.02);
}

.lista-gastos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.gasto-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.gasto-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, #f093fb 100%);
    transition: height 0.4s;
}

.gasto-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, transparent) 0%, color-mix(in srgb, var(--secondary) 5%, transparent) 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.gasto-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px color-mix(in srgb, var(--primary) 25%, transparent);
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.gasto-item:hover::before {
    height: 100%;
    opacity: 0.05;
}

.gasto-item:hover::after {
    opacity: 1;
}

.gasto-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.75rem;
    margin-top: 0.5rem;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

.gasto-titulo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gasto-monto {
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    text-shadow: 0 2px 10px color-mix(in srgb, var(--primary) 20%, transparent);
}

.gasto-detalles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    border: 2px dashed color-mix(in srgb, var(--primary) 15%, transparent);
    position: relative;
    z-index: 2;
}

.gasto-detalle {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    transition: all 0.3s;
}

.gasto-detalle:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    transform: scale(1.05);
}

.gasto-notas {
    background: linear-gradient(135deg, #fff5f5 0%, #fff8fb 100%);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-style: italic;
    margin-bottom: 1.75rem;
    border-left: 4px solid #f093fb;
    color: var(--text-dark);
    box-shadow: 0 2px 10px rgba(240, 147, 251, 0.1);
    position: relative;
    z-index: 2;
}

.gasto-notas::before {
    content: '💬';
    font-size: 1.5rem;
    position: absolute;
    top: -10px;
    right: 15px;
    opacity: 0.3;
}

.gasto-pagado-por {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid #2196f3;
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.gasto-division {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.gasto-division h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.division-personas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.division-persona {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.division-persona:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.division-nombre {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.division-monto {
    font-weight: 800;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gasto-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 2px solid color-mix(in srgb, var(--primary) 10%, transparent);
    position: relative;
    z-index: 2;
}

/* ==================== TABLA COMPARACION ==================== */
.tabla-comparacion {
    margin-top: 3rem;
    overflow-x: auto;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 2rem;
}

.tabla-comparacion table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.tabla-comparacion th,
.tabla-comparacion td {
    padding: 1.5rem 1.25rem;
    text-align: left;
}

.tabla-comparacion thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.tabla-comparacion th {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 30%, transparent);
}

.tabla-comparacion th:first-child {
    border-top-left-radius: var(--radius-md);
}

.tabla-comparacion th:last-child {
    border-top-right-radius: var(--radius-md);
}

.tabla-comparacion tbody tr {
    transition: all 0.3s;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tabla-comparacion tbody tr:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, transparent) 0%, color-mix(in srgb, var(--secondary) 5%, transparent) 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 10%, transparent);
}

.tabla-comparacion td {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
}

.tabla-comparacion td:first-child {
    font-weight: 700;
    color: var(--primary);
}

.tabla-comparacion td:last-child {
    text-align: center;
}

/* ==================== VIAJE ==================== */
.viaje-form {
    max-width: 1200px;
    margin: 0 auto;
}

.viaje-form > .form-grid {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 2px solid color-mix(in srgb, var(--primary) 15%, transparent);
}

.viaje-gastos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.viaje-gasto-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.viaje-gasto-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.viaje-gasto-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px color-mix(in srgb, var(--primary) 25%, transparent);
    border-color: var(--primary);
}

.viaje-gasto-card:hover::before {
    opacity: 1;
}

.viaje-gasto-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.viaje-gasto-card small {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.input-viaje {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    background: #f8f9fa;
}

.input-viaje:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent);
    transform: scale(1.02);
}

.viaje-total {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 2.5rem 0;
    box-shadow: 0 20px 60px color-mix(in srgb, var(--primary) 40%, transparent);
    position: relative;
    overflow: hidden;
}

.viaje-total::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.viaje-total h3 {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.viaje-total-monto {
    color: var(--text-light);
    font-size: 3.5rem;
    font-weight: 900;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    letter-spacing: -2px;
}

.viaje-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.viaje-actions button {
    flex: 1;
    min-width: 220px;
    max-width: 320px;
    padding: 1.2rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ==================== SIMULADOR ==================== */
.simulador-container {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.simulador-form {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.08) 0%, rgba(56, 249, 215, 0.08) 100%);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(67, 233, 123, 0.2);
    box-shadow: 0 8px 32px rgba(67, 233, 123, 0.12);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.simulador-form h3 {
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.simulador-resultados {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.simulador-resultados h3 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary);
}

.lista-gastos-sim {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 2rem;
    padding-right: 0.5rem;
}

.lista-gastos-sim::-webkit-scrollbar {
    width: 6px;
}

.lista-gastos-sim::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.lista-gastos-sim::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.gasto-simulado-item {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--success);
    transition: all 0.3s;
}

.gasto-simulado-item:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(67, 233, 123, 0.25);
}

.gasto-simulado-info {
    flex: 1;
}

.gasto-simulado-desc {
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    color: var(--text-dark);
}

.gasto-simulado-cat {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.gasto-simulado-monto {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--success);
    margin-right: 1rem;
}

.simulador-metricas {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 5%, transparent) 0%, color-mix(in srgb, var(--secondary) 5%, transparent) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.simulador-metricas h3 {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.metricas-sim {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
}

.metrica-sim-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.metrica-sim-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.metrica-sim-card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: 0 10px 40px color-mix(in srgb, var(--primary) 30%, transparent);
    transform: scale(1.05);
}

.metrica-sim-card.highlight:hover {
    transform: scale(1.08) translateY(-4px);
}

.metrica-sim-card.highlight .metrica-sim-label,
.metrica-sim-card.highlight .metrica-sim-valor {
    color: var(--text-light);
}

.metrica-sim-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrica-sim-card.highlight .metrica-sim-label {
    opacity: 0.95;
}

.metrica-sim-valor {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-dark);
}

.simulador-division {
    background: linear-gradient(135deg, rgba(245, 87, 108, 0.05) 0%, rgba(240, 147, 251, 0.05) 100%);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.simulador-division h3 {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.personas-division-sim {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.simulador-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    padding-top: 1rem;
    border-top: 2px dashed #e0e0e0;
}

.simulador-actions button {
    flex: 1;
    max-width: 320px;
    padding: 1.2rem 2rem;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* ==================== MES NO EXISTE ==================== */
.mes-no-existe {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    min-height: 400px;
    position: relative;
    z-index: 1;
}

.mes-no-existe-icono {
    font-size: 8rem;
    margin-bottom: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.mes-no-existe h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.mes-no-existe p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.mes-no-existe .btn-primary {
    font-size: 1.2rem;
    padding: 1.25rem 2.5rem;
    box-shadow: 0 10px 40px color-mix(in srgb, var(--primary) 30%, transparent);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    z-index: 10;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-dark);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

/* ==================== RESPONSIVE ==================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .sidebar {
        width: 280px;
    }

    .main-content {
        margin-left: 280px;
        max-width: calc(100% - 280px);
        padding: 1.5rem;
    }

    .metricas {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Móviles */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* Móvil: ocultar botón desktop, mostrar botón al lado del usuario */
    .sidebar-toggle-desktop {
        display: none !important;
    }

    .sidebar-toggle-mobile {
        display: flex !important;
        /* Hacer el botón más grande y táctil en móvil */
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Mejorar feedback visual en móvil */
    .sidebar-toggle-mobile:active {
        transform: scale(0.9);
        background: var(--primary);
        border-color: var(--primary);
        color: white;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        padding: 1.5rem;
        overflow-y: visible;
        /* No sobrescribir box-shadow ni background, respetar tema oscuro/claro */
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }

    /* Sidebar oculto en móvil */
    .sidebar.hidden {
        max-height: 0 !important;
        padding: 0 !important;
        opacity: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        border: none !important;
    }

    .sidebar-header h1 {
        font-size: 1.5rem;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .header-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .user-menu-container {
        width: auto;
        position: relative;
    }

    .user-menu-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
        min-width: auto;
        justify-content: center;
    }

    .user-name {
        font-size: 0.95rem;
        display: inline;
    }

    .user-icon {
        font-size: 1.1rem;
    }

    .user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        min-width: 240px;
        width: max-content;
        max-width: calc(100vw - 2rem);
        margin-top: 0.25rem;
        z-index: 9999;
    }

    /* Tarjetas de división en vertical en móvil */
    .division-personas {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .division-persona {
        padding: 0.875rem 1rem;
    }

    .dropdown-item {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px;
    }

    .mes-selector {
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn-secondary {
        width: 100%;
        min-height: 44px;
        padding: 0.75rem 1.5rem;
    }

    .btn-primary {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
    }

    .metricas {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .metrica-card {
        padding: 1rem;
    }

    .metrica-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }

    .metrica-valor {
        font-size: 1.5rem;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0.25rem;
        padding-bottom: 0.5rem;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tab {
        flex: 0 0 auto;
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
        white-space: nowrap;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .tab-panel h2 {
        font-size: 1.5rem;
    }

    .personas-division {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .persona-division {
        padding: 2rem 1.5rem;
    }

    .persona-division h3 {
        font-size: 1.4rem;
    }

    .division-valor {
        font-size: 1.2rem;
    }

    .division-label {
        font-size: 0.85rem;
    }

    .progress-bar {
        height: 10px;
    }

    .chart-container {
        padding: 1.5rem;
    }

    .chart-container h2 {
        font-size: 1.5rem;
    }

    .recurrentes-info {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 1.5rem;
    }

    .info-valor {
        font-size: 1.6rem;
    }

    .tabla-comparacion {
        padding: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tabla-comparacion table {
        min-width: 600px;
    }

    .tabla-comparacion th,
    .tabla-comparacion td {
        padding: 0.875rem 0.625rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .tabla-comparacion th:first-child,
    .tabla-comparacion td:first-child {
        position: sticky;
        left: 0;
        background: inherit;
        z-index: 5;
    }

    .mes-no-existe {
        padding: 3rem 1.5rem;
    }

    .mes-no-existe-icono {
        font-size: 6rem;
    }

    .mes-no-existe h2 {
        font-size: 1.6rem;
    }

    .mes-no-existe p {
        font-size: 1rem;
    }

    .mes-no-existe .btn-primary {
        min-height: 48px;
        width: auto;
        min-width: 200px;
        font-size: 1.1rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-gastos {
        max-width: 100%;
    }

    .form-gastos input,
    .form-gastos select,
    .form-gastos textarea {
        min-height: 44px;
        font-size: 16px;
        padding: 0.75rem;
    }

    .form-metodo-division {
        padding: 1.5rem;
    }

    .form-checkbox {
        padding: 1rem;
        min-height: 44px;
    }

    .btn-lg {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
        min-height: 48px;
    }

    .filtros {
        grid-template-columns: 1fr;
        padding: 1.75rem;
        gap: 1.25rem;
    }

    .lista-gastos {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .gasto-item {
        padding: 2rem;
    }

    .gasto-titulo {
        font-size: 1.3rem;
    }

    .gasto-monto {
        font-size: 1.7rem;
    }

    .gasto-detalles {
        padding: 1.25rem;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gasto-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .chart-container {
        padding: 1rem;
        margin: 0;
    }

    .chart-container h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .chart-container canvas {
        max-height: 280px;
        width: 100% !important;
        height: auto !important;
    }

    /* Asegurar que los gráficos sean responsivos */
    canvas {
        max-width: 100%;
        height: auto !important;
    }

    .toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }

    .tabla-comparacion {
        font-size: 0.85rem;
    }

    .tabla-comparacion th,
    .tabla-comparacion td {
        padding: 0.75rem 0.5rem;
    }

    /* Modales optimizados para móvil */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-header {
        padding: 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.3rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-body input,
    .modal-body select,
    .modal-body textarea {
        min-height: 44px;
        font-size: 16px;
    }

    .recurrentes-info {
        grid-template-columns: 1fr;
    }

    .info-card {
        padding: 1rem;
    }

    .info-valor {
        font-size: 1.2rem;
    }

    .viaje-gastos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .viaje-total {
        padding: 2rem;
    }

    .viaje-total-monto {
        font-size: 2.5rem;
    }

    .viaje-actions {
        flex-direction: column;
    }

    .viaje-actions button {
        width: 100%;
        max-width: 100%;
    }

    .simulador-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .simulador-form {
        position: static;
        padding: 1.5rem;
    }

    .simulador-resultados {
        padding: 1.5rem;
    }

    .metricas-sim {
        grid-template-columns: 1fr;
    }

    .metrica-sim-card.highlight {
        transform: scale(1);
    }

    .metrica-sim-card.highlight:hover {
        transform: scale(1.02);
    }

    .simulador-actions {
        flex-direction: column;
    }

    .simulador-actions button {
        width: 100%;
        max-width: 100%;
    }

    .personas-division-sim {
        grid-template-columns: 1fr;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .sidebar {
        padding: 1rem;
    }

    .sidebar-header h1 {
        font-size: 1.3rem;
    }

    .main-content {
        padding: 0.75rem;
    }

    .tab-content {
        padding: 1rem;
    }

    .metrica-card {
        flex-direction: column;
        text-align: center;
    }

    /* User menu optimizations for small mobile */
    .user-menu-button {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        min-width: auto;
    }

    .user-name {
        font-size: 0.9rem;
    }

    .user-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        left: auto;
        min-width: 200px;
        width: max-content;
        max-width: calc(100vw - 1rem);
        margin-top: 0.25rem;
        padding: 0.5rem 0;
        z-index: 9999;
    }

    .dropdown-item {
        padding: 0.875rem 1rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .dropdown-icon {
        font-size: 1.2rem;
    }

    .metrica-icon {
        font-size: 1.8rem;
        width: 45px;
        height: 45px;
    }

    .metrica-valor {
        font-size: 1.3rem;
    }

    .tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    /* Botones táctiles más grandes */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }

    .btn-icon {
        min-width: 48px;
        min-height: 48px;
    }

    /* Inputs táctiles */
    input,
    select,
    textarea {
        min-height: 44px;
        font-size: 16px !important;
    }

    .persona-division {
        padding: 1rem;
    }

    .division-row {
        padding: 0.5rem;
    }

    .lista-gastos {
        gap: 1.25rem;
    }

    .gasto-item {
        padding: 1.5rem;
    }

    .gasto-titulo {
        font-size: 1.2rem;
    }

    .gasto-monto {
        font-size: 1.5rem;
    }

    .gasto-detalles {
        padding: 1rem;
        gap: 0.75rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .select-mes {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }

    .form-metodo-division {
        padding: 1rem;
    }

    .form-metodo-division h3 {
        font-size: 1rem;
    }

    .tabla-comparacion {
        font-size: 0.75rem;
    }

    .tabla-comparacion th,
    .tabla-comparacion td {
        padding: 0.5rem 0.25rem;
    }
}

/* Mejoras táctiles para móviles */
@media (hover: none) and (pointer: coarse) {
    .btn-primary,
    .btn-secondary,
    .btn-icon,
    .tab,
    .filtro-select,
    .select-mes,
    .select-sidebar {
        min-height: 44px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .input-nombre,
    .input-sueldo {
        min-height: 44px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .form-checkbox input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
}

/* ==================== SECCIÓN PERSONAL ==================== */
.personal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.personal-header h2 {
    margin: 0;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-privacidad {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(56, 142, 60, 0.1) 100%);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.1);
}

.icono-privado {
    font-size: 2.5rem;
    animation: pulsePrivacy 2s ease-in-out infinite;
}

@keyframes pulsePrivacy {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.info-privacidad p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.info-privacidad strong {
    color: #388e3c;
    font-weight: 700;
}

.resumen-personal {
    margin: 3rem 0;
    padding: 2.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.resumen-personal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 50%, #f093fb 100%);
}

.resumen-personal h3 {
    margin: 0 0 2rem 0;
    font-size: 1.8rem;
    color: var(--text-dark);
    text-align: center;
}

.stats-personal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px color-mix(in srgb, var(--primary) 20%, transparent);
    border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

.stat-icon {
    font-size: 3rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, transparent) 0%, color-mix(in srgb, var(--secondary) 10%, transparent) 100%);
    border-radius: var(--radius-md);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.stat-valor {
    font-size: 2rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-destacada {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff5f5 0%, #fff8fb 100%);
    border: 2px solid #f093fb;
}

.stat-destacada .stat-icon {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.2) 0%, rgba(240, 147, 251, 0.1) 100%);
    font-size: 3.5rem;
}

.stat-explicacion {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.5rem 0 0 0;
}

/* Balance de deudas */
.balance-deudas {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 3rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.balance-deudas h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--text-dark);
}

.balance-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.balance-info {
    flex: 1;
}

.balance-titulo {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.balance-detalle {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 700;
}

.balance-monto {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-liquidar {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--success) 0%, #38f9d7 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(67, 233, 123, 0.3);
}

.btn-liquidar:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(67, 233, 123, 0.4);
}

.btn-liquidar:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .personal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .info-privacidad {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem;
        gap: 1rem;
    }

    .stats-personal {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-destacada {
        grid-column: 1;
    }

    .stat-icon {
        font-size: 2.5rem;
        width: 60px;
        height: 60px;
    }

    .stat-valor {
        font-size: 1.6rem;
    }
}

/* ==================== HEADER ACTIONS ==================== */
.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ==================== MODAL ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal.show {
    animation: backdropFadeIn 0.3s ease;
}

@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.close-modal {
    font-size: 2rem;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    padding: 0;
    background: none;
    border: none;
}

.close-modal:hover {
    color: var(--danger);
}

.modal-body {
    padding: 2rem;
}

.modal-body .form-group {
    margin-bottom: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.modal-body input,
.modal-body select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.modal-body input:focus,
.modal-body select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent);
}

/* ==================== USUARIOS COMPARTIDOS ==================== */
.usuario-compartido-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.usuario-compartido-item:hover {
    background: #e9ecef;
}

.usuario-compartido-item strong {
    color: var(--text-dark);
    font-weight: 600;
}

.usuario-compartido-item small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-eliminar-compartido {
    background: var(--danger);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-eliminar-compartido:hover {
    background: #dc3545;
    transform: scale(1.05);
}

.compartidos-lista h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* ==================== TRANSICIONES MODERNAS ==================== */

/* Transición suave para elementos persona-compartida */
.persona-compartida {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top;
}

.persona-compartida[style*="display: none"] {
    opacity: 0;
    transform: scaleY(0);
    max-height: 0;
    overflow: hidden;
}

/* Animación de entrada para la página */
@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: pageEnter 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Transición suave para tabs */
.tab {
    position: relative;
    overflow: hidden;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.tab.active::after {
    width: 100%;
}

/* Transición suave para botones */
.btn-primary,
.btn-secondary,
.btn-icon {
    position: relative;
    overflow: hidden;
}

.btn-primary::before,
.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::before,
.btn-secondary:active::before {
    width: 300px;
    height: 300px;
}

/* Efecto de carga suave */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(
        to right,
        #f0f0f0 4%,
        #e0e0e0 25%,
        #f0f0f0 36%
    );
    background-size: 1000px 100%;
}

/* Transición para elementos que aparecen */
.fade-in-up {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mejora para hover en cards */
.metrica-card,
.gasto-item,
.persona-division,
.chart-container,
.info-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

/* Animación de entrada escalonada para listas */
.lista-gastos > .gasto-item {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.lista-gastos > .gasto-item:nth-child(1) { animation-delay: 0.05s; }
.lista-gastos > .gasto-item:nth-child(2) { animation-delay: 0.1s; }
.lista-gastos > .gasto-item:nth-child(3) { animation-delay: 0.15s; }
.lista-gastos > .gasto-item:nth-child(4) { animation-delay: 0.2s; }
.lista-gastos > .gasto-item:nth-child(5) { animation-delay: 0.25s; }
.lista-gastos > .gasto-item:nth-child(6) { animation-delay: 0.3s; }

/* Transición suave para cambios de mes */
.select-mes {
    position: relative;
}

.select-mes::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.select-mes:active::after {
    opacity: 0.1;
}

/* Transición para sidebar elements */
.persona-card,
.sidebar-section {
    animation: fadeInLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-section:nth-child(1) { animation-delay: 0.1s; }
.sidebar-section:nth-child(2) { animation-delay: 0.15s; }
.sidebar-section:nth-child(3) { animation-delay: 0.2s; }
.sidebar-section:nth-child(4) { animation-delay: 0.25s; }

/* ==================== MEJORAS TÁCTILES GLOBALES ==================== */
/* Mejorar área táctil para elementos interactivos */
@media (pointer: coarse) {
    button,
    a,
    input[type="button"],
    input[type="submit"],
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-icon,
    .tab {
        min-height: 44px;
        min-width: 44px;
        touch-action: manipulation;
    }

    /* Prevenir zoom en inputs */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Mejorar scroll táctil */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Eliminar delay en tap */
    a,
    button,
    input,
    select,
    textarea {
        touch-action: manipulation;
    }

    /* Aumentar padding para mejor toque */
    .metrica-card,
    .persona-card,
    .gasto-item {
        padding: 1.25rem;
    }
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
