/* ============================================
   Sistema de Finanzas Personal
   Estilos generales - Tema claro
   ============================================ */

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

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --primary-light: #EEF2FF;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    --bg-primary: #F8FAFC;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F1F5F9;

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;

    --border-color: #E2E8F0;
    --border-color-strong: #CBD5E1;

    /* Aliases modernos */
    --surface: #FFFFFF;
    --surface-hover: #F8FAFC;
    --border: #E2E8F0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --sidebar-width: 260px;
    --header-height: 70px;
}

html {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }

/* ===== Layout ===== */
.app-container {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-logo i {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 18px;
}

.sidebar-nav {
    padding: 20px 12px;
}

.nav-section-title {
    padding: 12px 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

/* ===== Main content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 0;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.topbar {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    max-width: 100%;
    box-sizing: border-box;
}

.topbar-title {
    font-size: 22px;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
}

.page-content {
    padding: 32px;
    max-width: 100%;
    overflow-x: hidden;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 17px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ===== Stat cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 22px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
}

.stat-card-icon.success { background: var(--success); }
.stat-card-icon.danger { background: var(--danger); }
.stat-card-icon.info { background: var(--info); }
.stat-card-icon.warning { background: var(--warning); }
.stat-card-icon.primary { background: var(--primary); }

.stat-card-value {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
    word-break: break-all;
}

.stat-card-trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }
.trend-up.bad { color: var(--danger); }
.trend-down.good { color: var(--success); }

/* ===== Buttons ===== */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color-strong);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
}

.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

.btn-block { width: 100%; }

/* ===== Forms ===== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-color-strong);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--bg-tertiary);
}

/* ===== Badges ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-warning { background: var(--warning-light); color: #92400E; }

/* ===== Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.2s;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.25s;
}

.modal-lg { max-width: 720px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

/* ===== Account/Card grid ===== */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

.account-card {
    border-radius: var(--radius-lg);
    padding: 22px;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.account-card::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%);
    pointer-events: none;
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    position: relative;
}

.account-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.account-card-actions {
    display: flex;
    gap: 6px;
}

.account-card-actions button {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
}

.account-card-actions button:hover {
    background: rgba(255, 255, 255, 0.35);
}

.account-card-name {
    font-size: 15px;
    opacity: 0.95;
    margin-bottom: 4px;
    position: relative;
    font-weight: 500;
}

.account-card-balance {
    font-size: 24px;
    font-weight: 700;
    position: relative;
    word-break: break-all;
}

.account-card-type {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 6px;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Tarjeta crédito - vista especial ===== */
.credit-card {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    color: white;
    min-height: 200px;
}

.credit-card.color-gradient {
    background: linear-gradient(135deg, var(--card-color, #DC2626) 0%, rgba(0,0,0,0.4) 100%);
}

.credit-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    font-size: 13px;
    position: relative;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    margin-top: 8px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: white;
    border-radius: var(--radius-full);
    transition: width 0.3s;
}

/* ===== Transacciones lista ===== */
.transactions-list {
    display: flex;
    flex-direction: column;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: var(--bg-tertiary);
}

.transaction-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-desc {
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-primary);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

.transaction-amount {
    font-weight: 700;
    font-size: 15px;
    text-align: right;
    flex-shrink: 0;
}

.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }
.amount-neutral { color: var(--info); }

.transaction-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.transaction-actions button {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.transaction-actions button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* ===== Filters ===== */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 150px;
    flex: 1;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ===== Charts container ===== */
.chart-container {
    position: relative;
    height: 320px;
    width: 100%;
}

.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

/* ===== Empty state ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 56px;
    margin-bottom: 16px;
    color: var(--text-tertiary);
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* ===== Login/Register ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    padding: 20px;
}

.auth-box {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    padding: 40px;
    width: 100%;
    max-width: 420px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-icon {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 14px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-link {
    text-align: center;
    margin-top: 22px;
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-link a {
    color: var(--primary);
    font-weight: 600;
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary);
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideInRight 0.3s;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }

.toast i { font-size: 18px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }

@keyframes slideInRight {
    from { transform: translateX(110%); }
    to { transform: translateX(0); }
}

/* ===== Color picker ===== */
.color-picker {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-option {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.15s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

/* ===== Icon picker ===== */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

.icon-option {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.15s;
    border: 2px solid transparent;
}

.icon-option:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.icon-option.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary-dark);
}

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 10px 18px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    font-size: 14px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab:hover:not(.active) {
    color: var(--text-primary);
}

/* ===== Categories grid ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.category-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
}

.category-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.category-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.category-card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.category-card-type {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.category-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger-light);
    color: var(--danger);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.category-card:hover .category-delete {
    display: flex;
}

/* ===== Sidebar overlay (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ===== Comparison badge ===== */
.comparison-card {
    background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
    color: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.comparison-title {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 14px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.comparison-item-label {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.comparison-item-value {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.comparison-item-trend {
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* ===== Page header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 14px;
}

.page-header h1 {
    font-size: 26px;
    font-weight: 700;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 250px;
    }

    .menu-toggle {
        display: flex;
    }

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

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .page-content {
        padding: 18px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .stat-card-value {
        font-size: 22px;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        min-width: 100%;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        margin: 10px;
    }

    .user-menu span:not(.user-avatar) {
        display: none;
    }

    .table th, .table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .auth-box {
        padding: 28px 22px;
    }

    .page-header h1 {
        font-size: 22px;
    }

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

    .transaction-item {
        padding: 12px 8px;
        gap: 10px;
    }

    .transaction-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .transaction-amount {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 14px;
    }

    .card {
        padding: 16px;
    }

    .categories-grid {
        grid-template-columns: 1fr 1fr;
    }

    .transaction-actions {
        flex-direction: column;
        gap: 2px;
    }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Utilidades */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-secondary); }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 18px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.w-100 { width: 100%; }

.hidden { display: none !important; }

/* ==================== ESTILOS ADICIONALES ==================== */

/* Card body / header genéricos (compatibilidad) */
.card-body { padding: 20px; }
.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.card-header .card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-header .card-title i { color: var(--primary); }

/* Filters grid */
.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
@media (max-width: 768px) {
    .filters-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .filters-grid { grid-template-columns: 1fr; }
}

/* Botones extra */
.btn-info {
    background: var(--info);
    color: white;
}
.btn-info:hover { background: #2563EB; }

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover { background: #D97706; }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover, .btn-outline.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.btn-icon:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.btn-icon-danger:hover {
    background: #FEE2E2;
    color: var(--danger);
    border-color: var(--danger);
}

/* Stat extra label */
.stat-card-extra {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Comparison card content extra */
.comparison-content {
    display: flex;
    align-items: center;
    gap: 18px;
}
.comparison-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}
.comparison-text {
    font-size: 17px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}
.comparison-subtext {
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: fit-content;
}
.tab {
    padding: 8px 18px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
    background: var(--primary);
    color: white;
}

/* Categories grid - sobreescribir/extender */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
@media (max-width: 480px) {
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.category-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.category-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin: 0 auto 10px;
}
.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    word-break: break-word;
}
.category-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-block;
}
.badge-custom { background: #DBEAFE; color: #2563EB; }
.badge-default { background: #F3F4F6; color: #6B7280; }
.category-actions {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}
.category-card:hover .category-actions { opacity: 1; }
@media (max-width: 768px) {
    .category-actions { opacity: 1; }
}

/* Table responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Transaction items con acciones */
.transaction-actions {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}
.transaction-item:hover .transaction-actions { opacity: 1; }
@media (max-width: 768px) {
    .transaction-actions { opacity: 1; }
}

/* Stat card icon variantes warning/info */
.stat-card-icon.warning { background: #FEF3C7; color: var(--warning); }
.stat-card-icon.info { background: #DBEAFE; color: var(--info); }
.stat-card-icon.success { background: #D1FAE5; color: var(--success); }
.stat-card-icon.danger { background: #FEE2E2; color: var(--danger); }
.stat-card-icon.primary { background: #E0E7FF; color: var(--primary); }

/* Botones tamaños */
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
@media (max-width: 480px) {
    .page-header h1 { font-size: 22px; }
}

/* ==================== SUSCRIPCIONES ==================== */
.subscriptions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.subscription-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.subscription-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.subscription-card.inactive {
    opacity: 0.6;
}

.subscription-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.subscription-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.subscription-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.subscription-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.badge-inactive {
    background: #F3F4F6;
    color: #6B7280;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.subscription-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.subscription-info .info-row {
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.subscription-info .info-row i {
    width: 16px;
    color: var(--text-secondary);
}

.subscription-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}
.subscription-actions .btn { flex: 1; }
.subscription-actions .btn-icon { flex: 0 0 auto; }

/* Radio group para método de pago */
.radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.radio-option {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}
.radio-option:hover { border-color: var(--primary); }
.radio-option input[type="radio"] {
    accent-color: var(--primary);
    margin: 0;
}
.radio-option input[type="radio"]:checked + span {
    color: var(--primary);
    font-weight: 600;
}
.radio-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.radio-option span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 14px;
}

/* Modal grande */
.modal.modal-lg { max-width: 600px; }

@media (max-width: 480px) {
    .subscriptions-grid { grid-template-columns: 1fr; }
    .subscription-actions { flex-direction: row; }
    .radio-option { min-width: 100%; }
}

/* ============================================================
   ===== REDISEÑO MÓVIL TIPO APP NATIVA =====
   ============================================================ */

/* Bottom navigation - solo móvil */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #ffffff;
    border-top: 1px solid #E5E7EB;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: #9CA3AF;
    font-size: 10.5px;
    font-weight: 500;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px 4px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item i {
    font-size: 19px;
}
.bottom-nav-item.active {
    color: var(--primary);
}
.bottom-nav-item:active {
    transform: scale(0.92);
}

/* FAB central */
.bottom-nav-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #6366F1);
    border: 4px solid #fff;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
    margin-top: -22px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav-fab:active {
    transform: scale(0.92);
}

/* FAB menu overlay (acciones rápidas: ingreso/gasto/transfer/préstamo) */
.fab-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.fab-menu-overlay.active { display: flex; }

.fab-menu {
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0));
    animation: slideUp 0.25s ease-out;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
}

.fab-menu-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 18px;
}

.fab-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.fab-menu-action {
    background: #F9FAFB;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}
.fab-menu-action:active { transform: scale(0.96); }

.fab-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}
.fab-action-income .fab-action-icon { background: linear-gradient(135deg, #10B981, #059669); }
.fab-action-expense .fab-action-icon { background: linear-gradient(135deg, #EF4444, #DC2626); }
.fab-action-transfer .fab-action-icon { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.fab-action-loan .fab-action-icon { background: linear-gradient(135deg, #F59E0B, #D97706); }

.fab-menu-action:hover { background: #F3F4F6; border-color: var(--primary); }

.fab-menu-close {
    margin-top: 16px;
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 13px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.fab-menu-close:active { background: #F3F4F6; }

/* Panel "Más" - bottom sheet completo */
.more-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1100;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}
.more-panel-overlay.active { display: flex; }

.more-panel {
    width: 100%;
    max-width: 540px;
    max-height: 88vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    animation: slideUp 0.25s ease-out;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
}

.more-panel-handle {
    width: 40px;
    height: 4px;
    background: #D1D5DB;
    border-radius: 2px;
    margin: 10px auto 6px;
}

.more-panel-header {
    padding: 12px 20px 18px;
    border-bottom: 1px solid #F3F4F6;
}
.more-panel-user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-avatar-lg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.more-panel-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}
.more-panel-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.more-panel-body {
    padding: 16px 20px;
}
.more-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin: 16px 0 10px;
    font-weight: 600;
}
.more-section-title:first-child { margin-top: 0; }

.more-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    background: #F9FAFB;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.more-item:active { transform: scale(0.96); background: #F3F4F6; }

.more-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.more-item-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #FEF2F2;
    border-radius: 12px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================
   ===== AJUSTES MÓVIL: tipo app =====
   ============================================================ */
@media (max-width: 768px) {

    /* Mostrar bottom nav, ocultar sidebar fija */
    .bottom-nav { display: flex; }

    /* Espacio inferior para que el contenido no quede tapado por bottom-nav */
    .page-content {
        padding-bottom: 90px !important;
    }

    /* Esconder el botón hamburguesa: ahora tenemos bottom nav */
    .menu-toggle { display: none !important; }

    /* Topbar más limpia y sticky */
    .topbar {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 100;
        padding: 14px 16px !important;
        border-bottom: 1px solid #F3F4F6;
        box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    }
    .topbar-title {
        font-size: 18px !important;
        font-weight: 700 !important;
    }
    .user-name {
        display: none; /* en móvil solo mostrar avatar */
    }
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* Sidebar nunca aparece en móvil (usamos bottom nav y panel "Más") */
    .sidebar { display: none !important; }
    .sidebar-overlay { display: none !important; }

    /* Main content sin margin lateral en móvil */
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Page content con padding lateral menor */
    .page-content {
        padding: 16px !important;
    }

    /* Page header: título grande arriba, botones grandes y full-width */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-bottom: 18px;
    }
    .page-header h1 {
        font-size: 22px !important;
    }
    .page-header .btn,
    .page-header > div {
        width: 100%;
    }
    .page-header > div {
        display: flex;
        gap: 8px;
    }
    .page-header > div .btn {
        flex: 1;
    }

    /* Cards más compactas, sin sombras pesadas */
    .card {
        border-radius: 14px;
        margin-bottom: 14px;
    }
    .card-header {
        padding: 14px 16px !important;
    }
    .card-header .card-title {
        font-size: 14px !important;
    }
    .card-body {
        padding: 14px 16px !important;
    }

    /* Stats: 1 columna en móvil pequeño, 2 en tablets pequeñas */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .stat-card {
        padding: 14px !important;
        border-radius: 14px;
    }
    .stat-card-label {
        font-size: 11px !important;
    }
    .stat-card-value {
        font-size: 18px !important;
    }
    .stat-card-icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    .stat-card-extra {
        font-size: 10px;
    }

    /* En pantallas muy pequeñas, stats a 1 columna */
    @media (max-width: 380px) {
        .stats-grid { grid-template-columns: 1fr !important; }
    }

    /* Modales como bottom-sheet en móvil */
    .modal-overlay {
        align-items: flex-end !important;
    }
    .modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        animation: slideUp 0.25s ease-out;
    }
    .modal-body {
        padding: 16px 18px !important;
    }
    .modal-header {
        padding: 16px 18px !important;
        border-bottom: 1px solid #F3F4F6;
    }
    .modal-footer {
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom, 0)) !important;
        gap: 8px;
    }
    .modal-footer .btn {
        flex: 1;
        padding: 13px !important;
        font-size: 14px !important;
    }

    /* Forms en móvil: full width, inputs más grandes */
    .form-row {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .form-control,
    .form-select {
        font-size: 16px !important; /* evita zoom de iOS al enfocar */
        padding: 12px 14px !important;
    }
    .form-label {
        font-size: 13px !important;
    }

    /* Listas de transacciones más compactas */
    .transaction-item {
        padding: 12px 14px !important;
        gap: 10px !important;
    }
    .transaction-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
    }
    .transaction-desc {
        font-size: 14px !important;
    }
    .transaction-meta {
        font-size: 11px !important;
    }
    .transaction-amount {
        font-size: 14px !important;
    }
    .transaction-actions {
        opacity: 1 !important;
    }
    .btn-icon {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }

    /* Cards de cuentas y tarjetas */
    .accounts-grid,
    .subscriptions-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .account-card,
    .credit-card {
        padding: 18px !important;
        border-radius: 16px !important;
    }
    .account-card-balance {
        font-size: 22px !important;
    }

    /* Filtros: stack vertical limpio */
    .filters-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    /* Tablas con scroll horizontal suave */
    .table-responsive {
        margin: 0 -16px;
        padding: 0 16px;
        max-width: calc(100% + 32px);
        overflow-x: auto;
    }

    /* Tabs full width */
    .tabs {
        width: 100% !important;
    }
    .tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px !important;
        font-size: 13px !important;
    }

    /* Botones full width donde tiene sentido */
    .btn {
        padding: 11px 18px;
        font-size: 14px;
    }
    .btn-sm { padding: 8px 14px; font-size: 12.5px; }

    /* Comparison card */
    .comparison-card {
        padding: 16px !important;
        border-radius: 14px;
    }
    .comparison-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 18px !important;
    }
    .comparison-text {
        font-size: 14px !important;
    }
    .comparison-subtext {
        font-size: 12px !important;
    }

    /* Categorías: más compactas */
    .categories-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .category-card {
        padding: 12px 8px !important;
    }
    .category-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 16px !important;
    }
    .category-name {
        font-size: 12px !important;
    }
    .category-badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
    .category-actions {
        opacity: 1 !important;
        margin-top: 8px !important;
    }

    /* Color picker e icon picker */
    .color-picker {
        gap: 8px !important;
    }
    .color-option {
        width: 32px !important;
        height: 32px !important;
    }
    .icon-picker {
        max-height: 200px;
        overflow-y: auto;
        padding: 8px !important;
    }

    /* Charts más pequeños */
    .chart-container {
        height: 220px !important;
    }
    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
}

/* En tablets, ocultar la bottom nav pero mantener el sidebar */
@media (min-width: 769px) {
    .bottom-nav { display: none !important; }
    .fab-menu-overlay { align-items: center; }
    .more-panel-overlay { align-items: center; }
    .fab-menu, .more-panel {
        max-width: 480px;
        border-radius: 20px;
        animation: fadeIn 0.2s ease-out;
    }
}

/* Pequeños retoques generales */
.btn:focus-visible,
.btn-icon:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Evitar que el contenido se mueva cuando se abre el menú */
body.menu-open {
    overflow: hidden;
}

/* ============================================================
   ===== PRÉSTAMOS =====
   ============================================================ */
.loans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 16px;
}

.loan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all 0.2s;
}
.loan-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.loan-card.cancelled { opacity: 0.6; }

.loan-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.loan-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.loan-deudor {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.loan-fecha {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.loan-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

.loan-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px;
    background: #F9FAFB;
    border-radius: 10px;
}
.loan-amounts > div { text-align: center; }
.loan-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
    margin-bottom: 4px;
}
.loan-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.loan-progress {
    height: 8px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}
.loan-progress-bar {
    height: 100%;
    transition: width 0.3s;
    border-radius: 4px;
}
.loan-progress-text {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: right;
    margin-top: -8px;
}

.loan-info-row {
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.loan-info-row i {
    width: 16px;
    color: var(--text-secondary);
}

.loan-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: auto;
}
.loan-actions .btn { flex: 1; min-width: 0; }
.loan-actions .btn-icon { flex: 0 0 auto; }
.loan-actions .btn-success {
    flex: 1 1 100%;
}

/* Info box (usado en modales) */
.info-box {
    background: #F9FAFB;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.info-box-row {
    font-size: 14px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-box-row i {
    width: 18px;
    color: var(--text-secondary);
}

.total-pago-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-radius: 12px;
    margin: 16px 0;
    font-size: 15px;
    color: var(--text-primary);
}
.total-pago-display strong {
    font-size: 22px;
    color: var(--primary);
    font-weight: 800;
}

.empty-state-sm {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

@media (max-width: 480px) {
    .loans-grid { grid-template-columns: 1fr !important; gap: 12px; }
    .loan-amounts { gap: 6px; padding: 10px; }
    .loan-value { font-size: 13px; }
}


/* ============================================================
   ===== TARJETAS DE CRÉDITO - DISEÑO PREMIUM v2 =====
   Inspirado en Apple Card, Revolut, N26
   ============================================================ */

/* Layout en grid: 2 columnas en desktop, 1 en móvil */
.cards-stack {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 32px;
    align-items: start;
}

.cc-card-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    perspective: 1000px;
}

/* La tarjeta */
.cc-card {
    position: relative;
    aspect-ratio: 1.586 / 1;
    width: 100%;
    border-radius: 22px;
    padding: 26px 28px;
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-family: 'Inter', system-ui, sans-serif;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
    box-shadow:
        0 20px 40px -15px rgba(0, 0, 0, 0.4),
        0 8px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cc-card-large {
    cursor: pointer;
}
.cc-card-large:hover {
    transform: translateY(-6px) rotateX(2deg) rotateY(-2deg);
    box-shadow:
        0 30px 60px -20px rgba(0, 0, 0, 0.5),
        0 12px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Patrón geométrico de fondo */
.cc-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 100%, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Brillo holográfico animado al hover */
.cc-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.06) 40%,
        rgba(255, 255, 255, 0.18) 50%,
        rgba(255, 255, 255, 0.06) 60%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
    transition: transform 0.6s ease;
}
.cc-card-large:hover .cc-shine {
    transform: translate(15%, 15%);
}

/* Líneas decorativas circulares (como tarjetas premium) */
.cc-card::after {
    content: '';
    position: absolute;
    right: -80px;
    top: -80px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 50px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
    z-index: 0;
}

.cc-card > * { position: relative; z-index: 1; }

/* Fila superior: banco + red */
.cc-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0;
}

.cc-bank {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.cc-card-name {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.75;
    margin-top: 3px;
    letter-spacing: 0.4px;
}

.cc-network {
    font-size: 44px;
    line-height: 0.8;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.cc-network i {
    color: white;
}

/* Chip + NFC */
.cc-middle-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.cc-chip {
    width: 52px;
    height: 40px;
    border-radius: 7px;
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 25%, #B8860B 50%, #DAA520 75%, #FFD700 100%);
    position: relative;
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,0.25),
        inset 0 -2px 4px rgba(255, 215, 0, 0.3),
        0 2px 6px rgba(0,0,0,0.25);
}
.cc-chip::before {
    content: '';
    position: absolute;
    inset: 5px 6px;
    background-image:
        linear-gradient(to bottom, transparent 28%, rgba(0,0,0,0.4) 28%, rgba(0,0,0,0.4) 32%, transparent 32%, transparent 48%, rgba(0,0,0,0.4) 48%, rgba(0,0,0,0.4) 52%, transparent 52%, transparent 68%, rgba(0,0,0,0.4) 68%, rgba(0,0,0,0.4) 72%, transparent 72%);
    border-radius: 4px;
}
.cc-chip::after {
    content: '';
    position: absolute;
    inset: 5px 6px;
    background-image:
        linear-gradient(to right, transparent 24%, rgba(0,0,0,0.3) 24%, rgba(0,0,0,0.3) 26%, transparent 26%, transparent 49%, rgba(0,0,0,0.3) 49%, rgba(0,0,0,0.3) 51%, transparent 51%, transparent 74%, rgba(0,0,0,0.3) 74%, rgba(0,0,0,0.3) 76%, transparent 76%);
    border-radius: 4px;
}

/* Símbolo NFC */
.cc-nfc {
    font-size: 24px;
    opacity: 0.65;
    transform: rotate(90deg);
    color: white;
}

/* Número de tarjeta */
.cc-number {
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 3.5px;
    font-family: 'Courier New', 'OCR A Std', monospace;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    user-select: none;
    margin: 4px 0;
}

/* Fila inferior: vence + corte/pago */
.cc-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.cc-row-bottom > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cc-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.7;
    font-weight: 600;
}

.cc-holder {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.cc-expiry {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Acciones flotantes sobre la tarjeta */
.cc-card-actions-overlay {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 5;
}
.cc-card-actions-overlay button {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s, transform 0.15s;
}
.cc-card-actions-overlay button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}
.cc-card-large:hover .cc-card-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}
@media (max-width: 768px) {
    .cc-card-actions-overlay { opacity: 1 !important; transform: none !important; }
}

/* ===== INFO BAJO LA TARJETA ===== */
.cc-card-info {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 0 0 22px 22px;
    padding: 0;
    margin-top: -22px;
    padding-top: 38px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    overflow: hidden;
    position: relative;
    z-index: 0;
}

.cc-info-debt {
    padding: 0 24px 18px;
    text-align: center;
    border-bottom: 1px solid #F1F5F9;
}
.cc-info-debt-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 4px;
}
.cc-info-debt-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--danger);
    line-height: 1.1;
    font-feature-settings: 'tnum';
}

.cc-info-progress-section {
    padding: 16px 24px;
}
.cc-progress-track {
    height: 10px;
    background: #F1F5F9;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    position: relative;
}
.cc-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: linear-gradient(90deg, currentColor, currentColor);
    position: relative;
}
.cc-progress-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: cc-shimmer 2s infinite;
}
@keyframes cc-shimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cc-progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}
.cc-progress-row strong {
    color: var(--text-primary);
}

.cc-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #F1F5F9;
}
.cc-info-grid > div {
    padding: 14px 20px;
    text-align: center;
}
.cc-info-grid > div:first-child {
    border-right: 1px solid #F1F5F9;
}
.cc-info-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.cc-info-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.cc-info-value.success { color: var(--success); }

/* Vista previa en el modal */
.cc-preview-wrapper {
    display: flex;
    justify-content: center;
    padding: 12px 0 4px;
}
.cc-preview-wrapper .cc-card {
    max-width: 340px;
}

/* Color picker para tarjetas */
.cc-color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px;
    background: var(--surface-hover);
    border-radius: 14px;
}
.cc-color-swatch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    position: relative;
}
.cc-color-swatch:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}
.cc-color-swatch.active {
    border-color: white;
    transform: scale(1.15);
    box-shadow: 0 0 0 3px var(--primary), 0 6px 12px rgba(0,0,0,0.2);
}
.cc-color-swatch.active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
    .cards-stack {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }
    .cc-card {
        padding: 22px 24px !important;
    }
    .cc-number {
        font-size: 18px !important;
        letter-spacing: 2px !important;
    }
    .cc-network { font-size: 36px !important; }
    .cc-info-debt-value { font-size: 24px !important; }
    .cc-card::after {
        width: 180px;
        height: 180px;
        border-width: 40px;
    }
}
@media (max-width: 380px) {
    .cc-number {
        font-size: 15px !important;
        letter-spacing: 1.5px !important;
    }
    .cc-card { padding: 18px 20px !important; }
}


/* ============================================================
   ===== REGISTRO POR VOZ - DISEÑO PREMIUM v2 =====
   Micrófono enorme, ondas dinámicas estilo Siri/Alexa
   ============================================================ */

/* Botón en el menú FAB resaltado */
.fab-action-voice {
    position: relative;
    background: linear-gradient(135deg, #FAF5FF, #EDE9FE) !important;
    border: 2px solid transparent !important;
    background-clip: padding-box !important;
}
.fab-action-voice::before {
    content: '';
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: 16px;
    background: linear-gradient(135deg, #8B5CF6, #6366F1, #EC4899);
    background-size: 200% 200%;
    animation: voice-border 3s ease-in-out infinite;
}
@keyframes voice-border {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.fab-action-voice .fab-action-icon {
    background: linear-gradient(135deg, #8B5CF6, #6366F1) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    animation: voice-icon-glow 2s ease-in-out infinite;
}
@keyframes voice-icon-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4); }
    50% { box-shadow: 0 4px 18px rgba(139, 92, 246, 0.7); }
}
.fab-action-voice span {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700 !important;
}

/* Botón flotante extra de voz (visible siempre en móvil además del FAB) */
.voice-quick-btn {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 18px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.5);
    z-index: 999;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s;
}
.voice-quick-btn::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.4);
    animation: voice-quick-ripple 2s ease-out infinite;
}
@keyframes voice-quick-ripple {
    0%   { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}
.voice-quick-btn:active { transform: scale(0.92); }

@media (max-width: 768px) {
    .voice-quick-btn { display: flex; align-items: center; justify-content: center; }
}

/* ===== Modal de voz totalmente rediseñado ===== */
#modalVoz .modal {
    max-width: 500px !important;
    background: linear-gradient(180deg, #FAFAFE 0%, #FFFFFF 100%);
}
#modalVoz .modal-header {
    background: transparent;
    border-bottom: none;
    padding-bottom: 0;
}
#modalVoz .modal-title {
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    font-size: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Container del micrófono GIGANTE con visualizer */
.voice-mic-container {
    position: relative;
    width: 240px;
    height: 240px;
    margin: 28px auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Anillos de respiración alrededor del mic */
.voice-mic-container::before,
.voice-mic-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.25);
    pointer-events: none;
}
.voice-mic-container::before {
    animation: voice-breathe 4s ease-in-out infinite;
}
.voice-mic-container::after {
    animation: voice-breathe 4s ease-in-out infinite 2s;
}
@keyframes voice-breathe {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50%      { transform: scale(1.08); opacity: 0.1; }
}

/* Botón del micrófono - GIGANTE */
.voice-mic-btn {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 50%, #4F46E5 100%);
    background-size: 200% 200%;
    border: none;
    color: white;
    font-size: 64px;
    cursor: pointer;
    box-shadow:
        0 16px 40px rgba(139, 92, 246, 0.45),
        inset 0 -4px 10px rgba(0,0,0,0.15),
        inset 0 4px 10px rgba(255,255,255,0.2);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
    animation: voice-bg-shift 4s ease-in-out infinite;
}
@keyframes voice-bg-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.voice-mic-btn:hover {
    transform: scale(1.05);
}
.voice-mic-btn:active {
    transform: scale(0.95);
}

/* Cuando está escuchando: rojo + ondas activas */
.voice-mic-btn.listening {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 50%, #B91C1C 100%);
    box-shadow:
        0 16px 40px rgba(239, 68, 68, 0.5),
        inset 0 -4px 10px rgba(0,0,0,0.15),
        inset 0 4px 10px rgba(255,255,255,0.25);
    animation: voice-bg-shift 2s ease-in-out infinite, voice-pulse-listening 1.5s ease-in-out infinite;
}
@keyframes voice-pulse-listening {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.06); }
}

/* Ondas de sonido animadas alrededor del mic en modo listening */
.voice-wave-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid rgba(239, 68, 68, 0.5);
    pointer-events: none;
    opacity: 0;
}
.voice-mic-btn.listening ~ .voice-wave-ring,
.voice-mic-container.listening .voice-wave-ring {
    animation: voice-wave-out 1.5s ease-out infinite;
    opacity: 1;
}
.voice-mic-container.listening .voice-wave-ring:nth-child(1) { animation-delay: 0s;    }
.voice-mic-container.listening .voice-wave-ring:nth-child(2) { animation-delay: 0.5s;  }
.voice-mic-container.listening .voice-wave-ring:nth-child(3) { animation-delay: 1s;    }
@keyframes voice-wave-out {
    0%   { transform: scale(0.7); opacity: 0.7; border-color: rgba(239, 68, 68, 0.7); }
    100% { transform: scale(1.6); opacity: 0;   border-color: rgba(239, 68, 68, 0); }
}

/* Visualizador de barras (estilo Siri) - debajo del mic */
.voice-visualizer {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 50px;
    margin: 8px auto 12px;
    padding: 0 20px;
}
.voice-mic-container.listening + .voice-visualizer,
.voice-visualizer.active {
    display: flex;
}
.voice-bar {
    width: 5px;
    background: linear-gradient(to top, #8B5CF6, #EC4899);
    border-radius: 3px;
    animation: voice-bar-bounce 1.2s ease-in-out infinite;
    transform-origin: center;
}
.voice-bar:nth-child(1)  { animation-delay: 0s;    height: 20%; }
.voice-bar:nth-child(2)  { animation-delay: 0.1s;  height: 60%; }
.voice-bar:nth-child(3)  { animation-delay: 0.2s;  height: 35%; }
.voice-bar:nth-child(4)  { animation-delay: 0.3s;  height: 80%; }
.voice-bar:nth-child(5)  { animation-delay: 0.4s;  height: 45%; }
.voice-bar:nth-child(6)  { animation-delay: 0.5s;  height: 90%; }
.voice-bar:nth-child(7)  { animation-delay: 0.6s;  height: 50%; }
.voice-bar:nth-child(8)  { animation-delay: 0.5s;  height: 70%; }
.voice-bar:nth-child(9)  { animation-delay: 0.4s;  height: 40%; }
.voice-bar:nth-child(10) { animation-delay: 0.3s;  height: 85%; }
.voice-bar:nth-child(11) { animation-delay: 0.2s;  height: 55%; }
.voice-bar:nth-child(12) { animation-delay: 0.1s;  height: 30%; }
.voice-bar:nth-child(13) { animation-delay: 0s;    height: 65%; }
@keyframes voice-bar-bounce {
    0%, 100% { transform: scaleY(0.3); }
    50%      { transform: scaleY(1.2); }
}

/* Status text */
.voice-status {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    text-align: center;
}
.voice-mic-container.listening + .voice-visualizer + .voice-status,
.voice-status.listening-active {
    color: #DC2626;
    font-weight: 600;
}

/* Transcript (lo que dijiste) */
.voice-transcript {
    font-size: 19px;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 16px;
    min-height: 32px;
    padding: 12px 20px;
    border-radius: 14px;
    line-height: 1.4;
    text-align: center;
}
.voice-transcript:not(:empty) {
    background: linear-gradient(135deg, #F5F3FF, #FCE7F3);
    border: 1px solid #E9D5FF;
}

/* Hint para tocar */
.voice-tap-hint {
    font-size: 13px;
    color: var(--primary);
    text-align: center;
    margin-top: 4px;
    font-weight: 600;
    opacity: 0.85;
}

/* Ejemplos */
.voice-examples {
    margin-top: 24px;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FAF5FF, #EFF6FF);
    text-align: left;
}
.voice-examples-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.voice-example {
    font-size: 14px;
    color: var(--text-primary);
    padding: 10px 14px;
    background: white;
    border-radius: 10px;
    margin-bottom: 6px;
    font-style: italic;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    gap: 10px;
}
.voice-example::before {
    content: '🎤';
    font-style: normal;
    flex-shrink: 0;
}
.voice-example:last-child { margin-bottom: 0; }

@media (max-width: 480px) {
    .voice-mic-container {
        width: 200px;
        height: 200px;
        margin: 20px auto 12px;
    }
    .voice-mic-btn {
        width: 130px;
        height: 130px;
        font-size: 52px;
    }
    .voice-visualizer { height: 42px; }
    .voice-transcript { font-size: 17px; }
}

/* Header con efecto glow */
.ai-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.ai-page-title {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 28px;
    font-weight: 800;
}
.ai-page-title-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.35);
    animation: ai-pulse-icon 2.5s ease-in-out infinite;
}
@keyframes ai-pulse-icon {
    0%, 100% { box-shadow: 0 8px 16px rgba(99, 102, 241, 0.35); }
    50% { box-shadow: 0 12px 24px rgba(99, 102, 241, 0.55); }
}

/* Hero score con animación de fondo */
.ai-score-card {
    position: relative;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #EC4899 100%);
    background-size: 200% 200%;
    border-radius: 28px;
    padding: 36px 32px;
    color: white;
    margin-bottom: 28px;
    box-shadow: 0 20px 50px -10px rgba(99, 102, 241, 0.4);
    overflow: hidden;
    animation: ai-bg-shift 8s ease-in-out infinite;
}
@keyframes ai-bg-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Patrón de circles animado de fondo */
.ai-score-card::before,
.ai-score-card::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.ai-score-card::before {
    width: 320px;
    height: 320px;
    top: -120px;
    right: -80px;
    animation: ai-float 10s ease-in-out infinite;
}
.ai-score-card::after {
    width: 240px;
    height: 240px;
    bottom: -100px;
    left: -60px;
    animation: ai-float 12s ease-in-out infinite reverse;
}
@keyframes ai-float {
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(20px, -15px); }
}

.ai-score-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 32px;
    z-index: 1;
}

.ai-score-circle {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.2));
}
.ai-score-ring {
    width: 100%;
    height: 100%;
}
.ai-score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.ai-score-value > div:first-child {
    font-size: 52px;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-feature-settings: 'tnum';
}
.ai-score-label {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.ai-score-info {
    flex: 1;
    min-width: 0;
}
.ai-score-title {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.ai-score-nivel {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    text-transform: capitalize;
    line-height: 1.05;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.ai-score-desc {
    font-size: 15px;
    opacity: 0.95;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .ai-score-content {
        flex-direction: column;
        text-align: center;
        gap: 22px;
    }
    .ai-score-card { padding: 28px 22px; }
    .ai-score-circle { width: 130px; height: 130px; }
    .ai-score-value > div:first-child { font-size: 42px; }
    .ai-score-nivel { font-size: 28px; }
}

/* Stats compactas con iconos coloridos */
.ai-mini-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 26px;
}

.ai-mini-stat {
    background: white;
    border-radius: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ai-mini-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.ai-mini-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    color: white;
}
.ai-mini-stat-info {
    min-width: 0;
}
.ai-mini-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.ai-mini-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-top: 2px;
    font-feature-settings: 'tnum';
}
.ai-mini-stat-extra {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Filtros como pills */
.ai-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding: 6px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.ai-filter-pill {
    padding: 9px 16px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.ai-filter-pill:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.ai-filter-pill.active {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
}
.ai-filter-pill .ai-pill-count {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.ai-filter-pill:not(.active) .ai-pill-count {
    background: var(--surface-hover);
}

/* Cards de insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}

.insight-card {
    position: relative;
    background: white;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: var(--insight-color, var(--primary));
}

.insight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
}

.insight-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.insight-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}

.insight-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.insight-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.insight-message {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.55;
    opacity: 0.85;
}

.insight-action {
    background: linear-gradient(135deg, #EEF2FF, #DBEAFE);
    color: var(--primary);
    font-size: 13px;
    padding: 12px 14px;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 500;
    margin-top: auto;
    border-left: 3px solid var(--primary);
    line-height: 1.4;
}
.insight-action i {
    margin-top: 3px;
    font-size: 11px;
    flex-shrink: 0;
}

/* Estados de tipos por color en CSS variables */
.insight-card[data-tipo="alerta"]      { --insight-color: #EF4444; }
.insight-card[data-tipo="advertencia"] { --insight-color: #F59E0B; }
.insight-card[data-tipo="consejo"]     { --insight-color: #3B82F6; }
.insight-card[data-tipo="logro"]       { --insight-color: #10B981; }
.insight-card[data-tipo="info"]        { --insight-color: #6366F1; }

.insight-card[data-tipo="alerta"] .insight-action {
    background: linear-gradient(135deg, #FEE2E2, #FECACA);
    color: #DC2626;
    border-left-color: #DC2626;
}
.insight-card[data-tipo="advertencia"] .insight-action {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    color: #B45309;
    border-left-color: #B45309;
}
.insight-card[data-tipo="logro"] .insight-action {
    background: linear-gradient(135deg, #D1FAE5, #A7F3D0);
    color: #047857;
    border-left-color: #047857;
}

.ai-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}
.ai-loader-orb {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #8B5CF6, #EC4899);
    background-size: 200% 200%;
    animation: ai-bg-shift 3s ease-in-out infinite, ai-orb-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    position: relative;
}
.ai-loader-orb::before,
.ai-loader-orb::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(99, 102, 241, 0.3);
    animation: ai-orb-ripple 2s ease-out infinite;
}
.ai-loader-orb::after {
    animation-delay: 1s;
}
@keyframes ai-orb-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}
@keyframes ai-orb-ripple {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2); opacity: 0; }
}

.ai-loader p {
    font-size: 15px;
    font-weight: 500;
    background: linear-gradient(135deg, #6366F1, #EC4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 480px) {
    .insights-grid { grid-template-columns: 1fr !important; }
    .insight-card { padding: 18px; }
}
   precedencia y arreglar bugs de layout en escritorio/móvil.
   ============================================================ */

/* En ESCRITORIO (>=769px): bottom-nav y sus paneles NUNCA se ven */
@media (min-width: 769px) {
    .bottom-nav,
    .bottom-nav * {
        display: none !important;
    }
    /* Los overlays solo se ven cuando JS añade .active */
    .fab-menu-overlay:not(.active),
    .more-panel-overlay:not(.active),
    .modal-overlay:not(.active) {
        display: none !important;
    }
    /* Cuando están activos, sí se muestran como flex */
    .fab-menu-overlay.active,
    .more-panel-overlay.active,
    .modal-overlay.active {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    /* En desktop centramos el panel "Más" y el FAB */
    .fab-menu, .more-panel {
        max-width: 480px !important;
        max-height: 85vh !important;
        border-radius: 20px !important;
    }
    /* Sidebar SIEMPRE visible en escritorio */
    .sidebar {
        transform: translateX(0) !important;
        display: block !important;
    }
    .main-content {
        margin-left: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width)) !important;
    }
}

/* En MÓVIL (<=768px): la sidebar solo se ve si tiene .active (y la usamos rara vez) */
@media (max-width: 768px) {
    .bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0; left: 0; right: 0;
        z-index: 1000;
    }
    /* Los items del bottom-nav ya no llevan display:none heredado */
    .bottom-nav .bottom-nav-item,
    .bottom-nav .bottom-nav-fab {
        display: flex !important;
    }
    .sidebar {
        position: fixed;
        top: 0; left: 0;
        width: var(--sidebar-width);
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1200;
        transition: transform 0.25s ease;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1100;
    }
    .sidebar-overlay.active {
        display: block;
    }
    /* Espacio inferior para no quedar tapado por la bottom-nav */
    .page-content {
        padding-bottom: 90px !important;
    }
    /* En móvil, los overlays activos son bottom sheets */
    .fab-menu-overlay.active,
    .more-panel-overlay.active {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: center !important;
    }
    .modal-overlay.active {
        display: flex !important;
        align-items: flex-end !important;
        justify-content: center !important;
        padding: 0 !important;
    }
}

/* ============================================================
   ===== QUICK ACTIONS (botones de inicio: Ingreso/Egreso/Transfer) =====
   ============================================================ */
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.quick-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 768px) {
    .quick-actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        width: 100%;
    }
    .quick-actions .btn {
        flex-direction: column !important;
        gap: 6px !important;
        padding: 14px 6px !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        text-align: center;
        justify-content: center;
        line-height: 1.2;
    }
    .quick-actions .btn i {
        font-size: 18px;
    }
}

/* ============================================================
   ===== AUTOCOMPLETADO DE CONCEPTOS =====
   ============================================================ */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #F1F5F9;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover {
    background: linear-gradient(135deg, #EEF2FF, #DBEAFE);
}

.autocomplete-item > i {
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.7;
}

.autocomplete-desc {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ============================================================
   ===== MOVIMIENTOS RÁPIDOS =====
   ============================================================ */
.quickmov-intro {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-radius: 14px;
    margin-bottom: 20px;
    border-left: 4px solid #F59E0B;
}
.quickmov-intro i {
    font-size: 22px;
    color: #B45309;
    margin-top: 2px;
}
.quickmov-intro strong {
    color: #92400E;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}
.quickmov-intro p {
    color: #78350F;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.quickmov-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.quickmov-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quickmov-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.quickmov-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.quickmov-card-content {
    flex: 1;
    min-width: 0;
}

.quickmov-card-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quickmov-card-amount {
    font-size: 18px;
    font-weight: 800;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-feature-settings: 'tnum';
}
.quickmov-card-amount i { font-size: 12px; }

.quickmov-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.quickmov-card-meta i { font-size: 11px; }

.quickmov-card-uses {
    font-size: 11px;
    color: var(--primary);
    margin-top: 4px;
    font-weight: 600;
}

.quickmov-card-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.quickmov-btn-execute {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}
.quickmov-btn-execute:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.45);
}
.quickmov-btn-execute:active { transform: scale(0.95); }

.quickmov-btn-secondary {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: none;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.quickmov-btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}
.quickmov-btn-secondary.danger:hover {
    background: var(--danger);
    color: white;
}

@media (max-width: 480px) {
    .quickmov-grid { grid-template-columns: 1fr !important; }
    .quickmov-card-icon { width: 48px; height: 48px; font-size: 20px; }
    .quickmov-card-name { font-size: 14px; }
    .quickmov-card-amount { font-size: 16px; }
}

/* ============================================================
   ===== MOVIMIENTOS RÁPIDOS EN EL DASHBOARD =====
   ============================================================ */
.dash-mov-rapidos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.dash-mov-rapido {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.dash-mov-rapido:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    background: linear-gradient(135deg, white, #FAFAFE);
}
.dash-mov-rapido:active {
    transform: scale(0.98);
}

.dash-mov-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.dash-mov-info {
    flex: 1;
    min-width: 0;
}
.dash-mov-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}
.dash-mov-amount {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    font-feature-settings: 'tnum';
}
.dash-mov-amount i {
    font-size: 10px;
}

.dash-mov-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-secondary);
}
.dash-mov-empty i {
    font-size: 32px;
    color: #F59E0B;
    margin-bottom: 8px;
}
.dash-mov-empty p {
    font-size: 13px;
    margin-bottom: 12px;
    line-height: 1.5;
}

@media (max-width: 480px) {
    .dash-mov-rapidos-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   ===== CONFIGURACIÓN =====
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 18px;
}

.settings-preview {
    background: linear-gradient(135deg, #F5F3FF, #EFF6FF);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.settings-preview-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.settings-preview-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    font-feature-settings: 'tnum';
}

@media (max-width: 600px) {
    .settings-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   ===== ACCIONES EN ÚLTIMAS TRANSACCIONES (DASHBOARD) =====
   ============================================================ */
.transaction-actions-dash {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}
.transaction-actions-dash .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.transaction-actions-dash .btn-icon:hover {
    background: var(--primary);
    color: white;
}
.transaction-actions-dash .btn-icon.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
}
@media (max-width: 480px) {
    .transaction-actions-dash {
        gap: 3px;
        margin-left: 4px;
    }
    .transaction-actions-dash .btn-icon {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

/* ============================================================
   ===== EVIDENCIAS (FOTOS) =====
   ============================================================ */
.evidencias-wrapper {
    background: var(--surface-hover);
    border-radius: 12px;
    padding: 14px;
    border: 1px solid var(--border);
}

.evidencias-wrapper .form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.evidencias-contador {
    margin-left: auto;
    font-size: 11px;
    background: white;
    padding: 2px 10px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    border: 1px solid var(--border);
}

.evidencias-acciones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.evidencias-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border: 2px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    -webkit-tap-highlight-color: transparent;
}
.evidencias-btn:hover {
    border-color: var(--primary);
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    color: var(--primary);
}
.evidencias-btn:active {
    transform: scale(0.97);
}
.evidencias-btn i {
    font-size: 16px;
    color: var(--primary);
}

.evidencias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.evidencias-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 16px;
    font-style: italic;
}

.evidencia-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid var(--border);
    transition: transform 0.15s;
}
.evidencia-item:hover {
    transform: scale(1.04);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.evidencia-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.evidencia-pendiente {
    border: 2px dashed #F59E0B;
}
.evidencia-pendiente img {
    opacity: 0.85;
}

.evidencia-eliminar {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    transition: background 0.15s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.evidencia-eliminar:hover {
    background: var(--danger);
    transform: scale(1.1);
}

.evidencia-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.evidencia-badge.pendiente {
    background: #F59E0B;
}

/* Lightbox para ver evidencias en grande */
.evidencia-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
    animation: fadeIn 0.2s ease-out;
}
.evidencia-lightbox.active {
    display: flex;
}
.evidencia-lightbox img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    animation: zoomIn 0.25s ease-out;
}
.evidencia-lightbox-cerrar {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.evidencia-lightbox-cerrar:hover {
    background: rgba(255,255,255,0.3);
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Badge de evidencias en items de transacción */
.evidencia-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #EEF2FF, #DBEAFE);
    color: var(--primary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 8px;
    vertical-align: middle;
}
.evidencia-count-badge i { font-size: 9px; }

@media (max-width: 480px) {
    .evidencias-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 6px;
    }
}

/* ============================================================
   ===== OBLIGACIONES FINANCIERAS =====
   ============================================================ */

/* Resumen general (hero card) */
.oblig-resumen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
.oblig-resumen-hero {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 50%, #4F46E5 100%);
    background-size: 200% 200%;
    border-radius: 22px;
    padding: 28px;
    color: white;
    box-shadow: 0 14px 40px rgba(139, 92, 246, 0.35);
    position: relative;
    overflow: hidden;
    animation: oblig-bg 8s ease-in-out infinite;
}
@keyframes oblig-bg {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.oblig-resumen-hero::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 220px; height: 220px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
}

.oblig-resumen-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}
.oblig-resumen-valor {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-feature-settings: 'tnum';
    position: relative;
}
.oblig-resumen-detail {
    font-size: 13px;
    opacity: 0.85;
    position: relative;
}

.oblig-resumen-stats {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.oblig-stat {
    background: white;
    border-radius: 16px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}
.oblig-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #EEF2FF, #DBEAFE);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.oblig-stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.oblig-stat-valor {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1;
}

@media (max-width: 768px) {
    .oblig-resumen { grid-template-columns: 1fr; }
    .oblig-resumen-hero { padding: 22px; }
    .oblig-resumen-valor { font-size: 30px; }
    .oblig-resumen-stats { flex-direction: row; gap: 10px; }
    .oblig-stat { padding: 12px 14px; gap: 10px; }
    .oblig-stat-icon { width: 36px; height: 36px; font-size: 14px; }
    .oblig-stat-valor { font-size: 16px; }
}

/* Filtros */
.oblig-filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 6px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow-x: auto;
}
.oblig-filtro {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.oblig-filtro:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.oblig-filtro.active {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}
.oblig-filtro-count {
    background: rgba(255,255,255,0.2);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.oblig-filtro:not(.active) .oblig-filtro-count {
    background: var(--surface-hover);
}

/* Grid de obligaciones */
.obligaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 18px;
}

.oblig-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.oblig-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.oblig-card-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.oblig-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.oblig-card-titulo {
    flex: 1;
    min-width: 0;
}
.oblig-card-nombre {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 4px;
}
.oblig-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.oblig-tipo-badge {
    padding: 2px 10px;
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    color: var(--primary);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.oblig-card-deuda {
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    border: 1px solid #FECACA;
}
.oblig-deuda-label {
    font-size: 11px;
    color: #B91C1C;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.oblig-deuda-valor {
    font-size: 28px;
    font-weight: 800;
    color: #DC2626;
    line-height: 1.1;
    font-feature-settings: 'tnum';
}
.oblig-cuota {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
}
.oblig-cuota strong { color: var(--text-primary); }

.oblig-progress {
    background: var(--surface-hover);
    border-radius: 12px;
    padding: 12px 14px;
}
.oblig-progress-track {
    height: 8px;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}
.oblig-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.oblig-progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.oblig-card-acciones {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 4px;
}

.oblig-btn {
    flex: 1;
    min-width: 100px;
    padding: 9px 14px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.oblig-btn:active { transform: scale(0.97); }

.oblig-btn-primary {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}
.oblig-btn-primary:hover { box-shadow: 0 5px 12px rgba(16, 185, 129, 0.45); }

.oblig-btn-info {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    box-shadow: 0 3px 8px rgba(59, 130, 246, 0.3);
}
.oblig-btn-info:hover { box-shadow: 0 5px 12px rgba(59, 130, 246, 0.45); }

.oblig-btn-secondary {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.oblig-btn-secondary:hover { background: white; border-color: var(--primary); color: var(--primary); }

.oblig-btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.oblig-btn-ghost:hover { background: var(--surface-hover); color: var(--text-primary); }

.oblig-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.oblig-btn-icon:hover { background: var(--primary); color: white; }
.oblig-btn-icon.danger:hover { background: var(--danger); color: white; }

/* Modal de detalle de movimientos */
.info-pago-total {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border: 1px solid #F59E0B;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 14px;
    color: #92400E;
}
.info-pago-total strong {
    font-size: 18px;
    color: #B45309;
    font-feature-settings: 'tnum';
}

.oblig-detalle-resumen {
    display: flex;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}
.oblig-detalle-resumen strong { color: var(--primary); }

.oblig-mov-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.oblig-mov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.15s;
}
.oblig-mov-item:hover { background: var(--surface-hover); }

.oblig-mov-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.oblig-mov-info {
    flex: 1;
    min-width: 0;
}
.oblig-mov-tipo {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.oblig-mov-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.oblig-mov-monto {
    font-size: 15px;
    font-weight: 800;
    font-feature-settings: 'tnum';
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .obligaciones-grid { grid-template-columns: 1fr !important; }
    .oblig-card-acciones .oblig-btn { min-width: 0; padding: 8px 10px; font-size: 12px; }
}

/* Obligaciones en dashboard */
.oblig-dash-resumen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: linear-gradient(135deg, #F5F3FF, #EEF2FF);
    border-radius: 14px;
    margin-bottom: 12px;
}
.oblig-dash-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.oblig-dash-valor {
    font-size: 22px;
    font-weight: 800;
    color: #8B5CF6;
    font-feature-settings: 'tnum';
    line-height: 1.1;
}
.oblig-dash-cantidad {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.oblig-dash-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.oblig-dash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.oblig-dash-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.oblig-dash-info {
    flex: 1;
    min-width: 0;
}
.oblig-dash-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.oblig-dash-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}
.oblig-dash-deuda {
    font-size: 14px;
    font-weight: 700;
    font-feature-settings: 'tnum';
    flex-shrink: 0;
}

/* ============================================================
   ===== INVERSIONES =====
   ============================================================ */

/* Hero resumen */
.inv-hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 16px;
    background: linear-gradient(135deg, #059669 0%, #10B981 50%, #34D399 100%);
    background-size: 200% 200%;
    border-radius: 22px;
    padding: 24px;
    color: white;
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.3);
    margin-bottom: 24px;
    animation: oblig-bg 8s ease-in-out infinite;
}
.inv-hero-stat {
    display: flex;
    align-items: center;
    gap: 12px;
}
.inv-hero-main {
    border-right: 1px solid rgba(255,255,255,0.2);
    padding-right: 16px;
}
.inv-hero-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.inv-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.85;
    font-weight: 700;
    margin-bottom: 2px;
}
.inv-hero-value {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    font-feature-settings: 'tnum';
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.inv-hero-value-small {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    font-feature-settings: 'tnum';
}
.inv-hero-detail {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .inv-hero {
        grid-template-columns: 1fr 1fr;
    }
    .inv-hero-main {
        grid-column: 1 / -1;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.2);
        padding-right: 0;
        padding-bottom: 14px;
    }
}
@media (max-width: 480px) {
    .inv-hero { padding: 18px; gap: 12px; }
    .inv-hero-value { font-size: 24px; }
}

/* Filtros */
.inv-filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 6px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
}
.inv-filtro {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.inv-filtro:hover { background: var(--surface-hover); color: var(--text-primary); }
.inv-filtro.active {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}
.inv-filtro span {
    background: rgba(255,255,255,0.2);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.inv-filtro:not(.active) span {
    background: var(--surface-hover);
}

/* Grid de inversiones */
.inversiones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}

.inv-card {
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    transition: all 0.25s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.inv-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.1);
}

.inv-card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-hover);
    position: relative;
}
.inv-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
}

.inv-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

.inv-card-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 6px;
    line-height: 1.3;
}

.inv-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.inv-cat-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.inv-cat-badge i { font-size: 10px; }

.inv-badge-estado {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.inv-badge-estado.cerrada { background: #F1F5F9; color: #64748B; }
.inv-badge-estado.pausada { background: #FEF3C7; color: #B45309; }
.inv-badge-estado.activa  { background: #D1FAE5; color: #047857; }

.inv-card-numeros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.inv-numero-item {
    background: var(--surface-hover);
    border-radius: 10px;
    padding: 10px 12px;
}
.inv-numero-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    margin-bottom: 3px;
}
.inv-numero-valor {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.1;
}
.inv-numero-valor.positivo { color: var(--success); }
.inv-numero-valor.negativo { color: var(--danger); }

.inv-card-roi {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.inv-roi-circulo {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.inv-roi-circulo.positivo {
    background: linear-gradient(135deg, #10B981, #059669);
}
.inv-roi-circulo.negativo {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}
.inv-roi-num {
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    font-feature-settings: 'tnum';
}
.inv-roi-lbl {
    font-size: 9px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-top: 3px;
}
.inv-roi-detalle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.inv-roi-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}
.inv-roi-row strong {
    color: var(--text-primary);
    font-feature-settings: 'tnum';
}
.inv-roi-row strong.positivo { color: var(--success); }
.inv-roi-row strong.negativo { color: var(--danger); }

.inv-card-diag {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
}
.inv-card-diag i {
    font-size: 18px;
    margin-top: 2px;
    flex-shrink: 0;
}
.inv-diag-titulo {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}
.inv-diag-mensaje {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.inv-card-acciones {
    display: flex;
    gap: 6px;
}
.inv-btn-action {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: white;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.inv-btn-action:hover {
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    border-color: var(--primary);
    color: var(--primary);
}
.inv-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.inv-btn-icon:hover { background: var(--primary); color: white; }
.inv-btn-icon.danger:hover { background: var(--danger); color: white; }


/* ===== Detalle de inversión ===== */
.inv-detalle-header {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.inv-detalle-portada {
    width: 100%;
    height: 280px;
    background-size: cover;
    background-position: center;
    background-color: #1E293B;
}
.inv-detalle-portada-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 100px;
    opacity: 0.6;
}
.inv-cambiar-portada {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 14px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}
.inv-cambiar-portada:hover { background: rgba(0,0,0,0.75); }

.inv-detalle-info-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 26px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.45) 70%, transparent);
    color: white;
}
.inv-detalle-nombre {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.inv-detalle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}
.inv-detalle-meta .inv-cat-badge,
.inv-detalle-meta .inv-badge-estado {
    background: rgba(255,255,255,0.2) !important;
    backdrop-filter: blur(8px);
    color: white !important;
    border: 1px solid rgba(255,255,255,0.3);
}
.inv-detalle-desc {
    font-size: 13px;
    opacity: 0.92;
    line-height: 1.5;
    max-width: 720px;
    margin: 0;
}

@media (max-width: 600px) {
    .inv-detalle-portada { height: 200px; }
    .inv-detalle-nombre { font-size: 22px; }
}

/* Asistente IA */
.inv-asistente {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 14px;
    margin-bottom: 20px;
}
.inv-asistente-icono {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.inv-asistente-titulo {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.inv-asistente-mensaje {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Métricas grid */
.inv-metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
.inv-metrica-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s;
}
.inv-metrica-card:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.08); }
.inv-metrica-card.destacada {
    grid-column: span 2;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}
.inv-metrica-card.destacada .inv-metrica-label,
.inv-metrica-card.destacada .inv-metrica-extra {
    color: rgba(255,255,255,0.85);
}
.inv-metrica-card.destacada .inv-metrica-valor {
    color: white;
}

.inv-metrica-icono {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-bottom: 4px;
}
.inv-metrica-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.inv-metrica-valor {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.1;
}
.inv-metrica-valor.positivo { color: var(--success); }
.inv-metrica-valor.negativo { color: var(--danger); }
.inv-metrica-extra {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.inv-metrica-extra.positivo { color: var(--success); }
.inv-metrica-extra.negativo { color: var(--danger); }

@media (max-width: 600px) {
    .inv-metrica-card.destacada { grid-column: span 1; }
}

/* Botones de acción */
.inv-acciones-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}
.inv-acciones-row .btn {
    flex: 1;
    min-width: 150px;
}

/* Lista de movimientos */
.inv-mov-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.inv-mov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.inv-mov-item:hover { background: var(--surface-hover); }
.inv-mov-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.inv-mov-info { flex: 1; min-width: 0; }
.inv-mov-titulo {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.inv-mov-meta {
    font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}
.inv-mov-monto {
    font-size: 15px; font-weight: 800; font-feature-settings: 'tnum';
    flex-shrink: 0;
}
.auto-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    background: #FEF3C7;
    color: #B45309;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}
.auto-badge i { font-size: 8px; }

/* Recurrentes */
.inv-rec-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, #F5F3FF, #FAF5FF);
    border: 1px solid #E9D5FF;
    border-radius: 12px;
    margin-bottom: 8px;
}
.inv-rec-item.inactivo {
    opacity: 0.5;
    background: var(--surface-hover);
    border-color: var(--border);
}
.inv-rec-icon {
    width: 38px; height: 38px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.inv-rec-info { flex: 1; min-width: 0; }
.inv-rec-titulo {
    font-size: 14px; font-weight: 600; color: var(--text-primary);
}
.inv-rec-meta {
    font-size: 12px; color: var(--text-secondary); margin-top: 2px;
}
.inv-rec-acciones { display: flex; gap: 4px; flex-shrink: 0; }

.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}
.checkbox-label input { width: 18px; height: 18px; cursor: pointer; }

/* ============================================================
   ===== CALCULADORA FINANCIERA =====
   ============================================================ */
.calc-intro {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.calc-tile {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.calc-tile::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--c, #6366F1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}
.calc-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.1);
    border-color: var(--c, #6366F1);
}
.calc-tile:hover::before { transform: scaleX(1); }

.calc-tile i {
    font-size: 32px;
    color: var(--c, #6366F1);
    margin-bottom: 4px;
}
.calc-tile h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.calc-tile p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Detalle calculadora */
.calc-detalle-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.calc-detalle-header h2 {
    margin: 0;
    font-size: 22px;
    color: var(--text-primary);
}
.calc-detalle-header h2 i { color: var(--primary); margin-right: 6px; }

.calc-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
}
@media (max-width: 900px) {
    .calc-layout { grid-template-columns: 1fr; }
}

.calc-form {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    height: fit-content;
}

.calc-resultado {
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.btn-full { width: 100%; justify-content: center; margin-top: 8px; }

.calc-result-hero {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: 14px;
    padding: 24px;
    color: white;
    text-align: center;
    margin-bottom: 14px;
}
.calc-result-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 700;
    margin-bottom: 8px;
}
.calc-result-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-feature-settings: 'tnum';
    margin-bottom: 8px;
}
.calc-result-detail {
    font-size: 13px;
    opacity: 0.92;
}

.calc-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.calc-result-stat {
    background: var(--surface-hover);
    border-radius: 12px;
    padding: 12px 14px;
}
.calc-stat-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.calc-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.1;
}

/* Tasas */
.calc-tasas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.calc-tasa-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}
.calc-tasa-card.destacada {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border-color: transparent;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}
.calc-tasa-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.calc-tasa-card.destacada .calc-tasa-label { color: rgba(255,255,255,0.85); }
.calc-tasa-valor {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
}
.calc-tasa-card.destacada .calc-tasa-valor { color: white; }

/* Tabla amortización */
.calc-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.calc-tabla thead {
    background: var(--surface-hover);
    position: sticky;
    top: 0;
}
.calc-tabla th, .calc-tabla td {
    padding: 8px 12px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-feature-settings: 'tnum';
}
.calc-tabla th {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
}
.calc-tabla th:first-child, .calc-tabla td:first-child { text-align: left; }
.calc-tabla tr:hover { background: var(--surface-hover); }

/* Tip / consejo */
.calc-tip {
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-left: 4px solid #F59E0B;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #78350F;
    font-size: 13px;
    line-height: 1.5;
}
.calc-tip i {
    font-size: 18px;
    color: #D97706;
    margin-top: 1px;
    flex-shrink: 0;
}

/* Veredicto VPN */
.calc-veredicto {
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.calc-veredicto i {
    font-size: 26px;
    margin-top: 2px;
    flex-shrink: 0;
}
.calc-veredicto-titulo {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}
.calc-veredicto-mensaje {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Comparador */
.calc-comp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .calc-comp-grid { grid-template-columns: 1fr; } }

.calc-comp-col {
    background: var(--surface-hover);
    border-radius: 14px;
    padding: 18px;
}
.calc-comp-titulo {
    font-size: 16px;
    margin: 0 0 12px;
    font-weight: 700;
}

.calc-comp-resultado {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 14px;
}
@media (max-width: 600px) { .calc-comp-resultado { grid-template-columns: 1fr; } }

.calc-comp-resultado-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.2s;
}
.calc-comp-resultado-card.ganador {
    border-color: #10B981;
    background: linear-gradient(135deg, #D1FAE5 0%, white 30%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.2);
}
.calc-comp-resultado-card h3 { margin: 0 0 12px; font-size: 15px; }
.calc-comp-stat {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--border);
}
.calc-comp-stat:last-child { border-bottom: none; }
.calc-comp-stat strong { font-feature-settings: 'tnum'; }

/* VPN flujos */
.vpn-flujo-row {
    display: grid;
    grid-template-columns: 180px 1fr 40px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}
.vpn-flujo-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}


/* ============================================================
   ===== AHORROS GAMIFICADOS =====
   ============================================================ */

/* Hero */
.ahorros-hero {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 18px;
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 50%, #FCD34D 100%);
    background-size: 200% 200%;
    border-radius: 22px;
    padding: 26px;
    color: white;
    box-shadow: 0 14px 40px rgba(245, 158, 11, 0.35);
    margin-bottom: 24px;
    animation: oblig-bg 8s ease-in-out infinite;
}
.ahorros-hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ahorros-hero-main { border-right: 1px solid rgba(255,255,255,0.25); padding-right: 20px; }
.ahorros-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    font-weight: 700;
    margin-bottom: 4px;
}
.ahorros-hero-value {
    font-size: 38px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
    font-feature-settings: 'tnum';
}
.ahorros-hero-detail {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 6px;
}

.ahorros-hero-progress {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.ahorros-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}
.ahorros-progress-label strong { font-size: 18px; font-feature-settings: 'tnum'; }
.ahorros-progress-track {
    height: 14px;
    background: rgba(255,255,255,0.25);
    border-radius: 7px;
    overflow: hidden;
}
.ahorros-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, white, rgba(255,255,255,0.85));
    border-radius: 7px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 16px rgba(255,255,255,0.4);
}
.ahorros-progress-detail {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 6px;
}

@media (max-width: 768px) {
    .ahorros-hero { grid-template-columns: 1fr; }
    .ahorros-hero-main { border-right: none; padding-right: 0; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.25); }
    .ahorros-hero-value { font-size: 30px; }
}

/* Logros */
.logros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.logro-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 14px;
    transition: all 0.2s;
}
.logro-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
    border-color: #FBBF24;
}
.logro-badge.bloqueado {
    opacity: 0.4;
    filter: grayscale(0.7);
}
.logro-badge-icono {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.logro-badge-info { flex: 1; min-width: 0; }
.logro-badge-titulo {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}
.logro-badge-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.logro-badge-fecha {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
    font-style: italic;
}

/* Filtros */
.ah-filtros {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 6px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
}
.ah-filtro {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.ah-filtro:hover { background: var(--surface-hover); color: var(--text-primary); }
.ah-filtro.active {
    background: linear-gradient(135deg, #F59E0B, #FBBF24);
    color: white;
    box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}
.ah-filtro span {
    background: rgba(255,255,255,0.25);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}
.ah-filtro:not(.active) span { background: var(--surface-hover); }

/* Grid de ahorros */
.ahorros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.ahorro-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    transition: all 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}
.ahorro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(0,0,0,0.12);
}
.ahorro-card.completada { border-color: #10B981; }
.ahorro-card.pausada { opacity: 0.7; }

/* Emoji wrapper - el contenedor con el emoji "llenándose" */
.ahorro-card-emoji-wrapper {
    height: 180px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ahorro-card-emoji {
    font-size: 90px;
    line-height: 1;
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
    transition: transform 0.3s;
}
.ahorro-card:hover .ahorro-card-emoji {
    transform: scale(1.1) rotate(-3deg);
}
.ahorro-card-emoji.celebrando {
    animation: celebrar 1.2s ease-in-out infinite;
}
@keyframes celebrar {
    0%, 100% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.15) rotate(-8deg); }
    75% { transform: scale(1.15) rotate(8deg); }
}
.ahorro-llenado-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    pointer-events: none;
}
.ahorro-llenado-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 12px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: translateY(-50%);
    animation: ola 3s ease-in-out infinite;
}
@keyframes ola {
    0%, 100% { transform: translateY(-50%) scaleX(1); }
    50% { transform: translateY(-30%) scaleX(1.05); }
}

.ahorro-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}
.ahorro-card-nombre {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}
.ahorro-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: -4px 0 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ahorro-card-saldo {
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-radius: 12px;
    border: 1px solid #FCD34D;
}
.ahorro-saldo-label {
    font-size: 10px;
    color: #92400E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}
.ahorro-saldo-valor {
    font-size: 26px;
    font-weight: 800;
    color: #B45309;
    font-feature-settings: 'tnum';
    line-height: 1.1;
}
.ahorro-saldo-meta {
    font-size: 12px;
    color: #92400E;
    margin-top: 2px;
}

.ahorro-progress-wrapper {}
.ahorro-progress-track {
    height: 10px;
    background: var(--surface-hover);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.ahorro-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    background-size: 200% 100%;
    animation: barra-shimmer 3s linear infinite;
}
@keyframes barra-shimmer {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.ahorro-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
}
.ahorro-progress-info strong { color: var(--text-primary); font-feature-settings: 'tnum'; }

.ahorro-consejo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface-hover);
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}
.ahorro-consejo i { font-size: 14px; flex-shrink: 0; }

.ahorro-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.ahorro-badge-plan, .ahorro-badge-ok, .ahorro-badge-pause {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.ahorro-badge-plan { background: #DBEAFE; color: #2563EB; }
.ahorro-badge-ok { background: #D1FAE5; color: #047857; }
.ahorro-badge-pause { background: #FEF3C7; color: #B45309; }

.ahorro-card-acciones {
    display: flex;
    gap: 8px;
    margin-top: auto;
}
.ahorro-btn {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}
.ahorro-btn:active { transform: scale(0.97); }
.ahorro-btn.primary {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}
.ahorro-btn.primary:hover { box-shadow: 0 5px 12px rgba(16, 185, 129, 0.45); }
.ahorro-btn.ghost {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.ahorro-btn.ghost:hover { background: white; border-color: var(--primary); color: var(--primary); }

/* Estilo picker */
.estilo-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
@media (max-width: 480px) {
    .estilo-picker { grid-template-columns: repeat(2, 1fr); }
}
.estilo-option {
    padding: 14px 8px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}
.estilo-option:hover {
    border-color: #F59E0B;
    transform: translateY(-2px);
}
.estilo-option.active {
    border-color: #F59E0B;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.estilo-emoji {
    font-size: 36px;
    margin-bottom: 4px;
}
.estilo-nombre {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Toggle tipo (libre/meta) */
.tipo-ahorro-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
@media (max-width: 480px) {
    .tipo-ahorro-toggle { grid-template-columns: 1fr; }
}
.tipo-ahorro-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.tipo-ahorro-opt:hover { border-color: var(--primary); }
.tipo-ahorro-opt.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.tipo-ahorro-opt input { display: none; }
.tipo-ahorro-opt i {
    font-size: 20px;
    color: var(--primary);
    flex-shrink: 0;
}
.tipo-ahorro-opt strong {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
}
.tipo-ahorro-opt span {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Recomendación de aporte */
.ah-recomendacion {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    border-left: 4px solid #F59E0B;
    border-radius: 12px;
    margin-top: 12px;
    color: #78350F;
    font-size: 13px;
    line-height: 1.5;
}
.ah-recomendacion i { font-size: 18px; margin-top: 1px; flex-shrink: 0; }
.ah-recomendacion-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    padding: 3px 0;
    border-bottom: 1px dashed rgba(120, 53, 15, 0.2);
}
.ah-recomendacion-row:last-child { border-bottom: none; }
.ah-recomendacion-row strong { font-feature-settings: 'tnum'; color: #B45309; }

/* Modal de logro celebratorio */
.logro-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.logro-overlay.active { opacity: 1; }
.logro-modal {
    background: white;
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 420px;
    width: 92%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.logro-overlay.active .logro-modal { transform: scale(1); }
.logro-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, #FBBF24, #F59E0B, #FBBF24);
    background-size: 200% 100%;
    animation: barra-shimmer 2s linear infinite;
}
.logro-confeti {
    font-size: 48px;
    animation: confeti-bounce 0.6s ease-out;
}
@keyframes confeti-bounce {
    0% { transform: scale(0) rotate(0); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}
.logro-icono {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    margin: 12px auto 16px;
    animation: logro-icono-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}
@keyframes logro-icono-pop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
.logro-titulo {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
.logro-nombre {
    font-size: 24px;
    color: var(--text-primary);
    margin: 0 0 8px;
    font-weight: 800;
}
.logro-descripcion {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 22px;
    line-height: 1.5;
}

/* Detalle de ahorro */
.ah-detalle-hero {
    border-radius: 24px;
    padding: 32px;
    margin-bottom: 22px;
    color: white;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: center;
    box-shadow: 0 14px 40px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
.ah-detalle-emoji-container {
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.25);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(4px);
}
.ah-detalle-emoji {
    font-size: 130px;
    z-index: 2;
    position: relative;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
}
.ah-detalle-emoji.celebrando { animation: celebrar 1.2s ease-in-out infinite; }
.ah-detalle-llenado {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    pointer-events: none;
}
.ah-detalle-llenado::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 16px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transform: translateY(-50%);
    animation: ola 3s ease-in-out infinite;
}

.ah-detalle-info { min-width: 0; }
.ah-detalle-nombre {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ah-detalle-desc {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 16px;
    line-height: 1.5;
}
.ah-detalle-saldo {
    margin-bottom: 14px;
}
.ah-saldo-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 700;
}
.ah-saldo-valor {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    font-feature-settings: 'tnum';
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ah-saldo-meta {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
}

.ah-detalle-progress-track {
    height: 28px;
    background: rgba(255,255,255,0.25);
    border-radius: 14px;
    position: relative;
    overflow: hidden;
}
.ah-detalle-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, white, rgba(255,255,255,0.85));
    border-radius: 14px;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 16px rgba(255,255,255,0.5);
}
.ah-detalle-progress-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    z-index: 2;
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

@media (max-width: 768px) {
    .ah-detalle-hero { grid-template-columns: 1fr; padding: 22px; gap: 18px; text-align: center; }
    .ah-detalle-emoji-container { margin: 0 auto; width: 160px; height: 160px; }
    .ah-detalle-emoji { font-size: 100px; }
    .ah-detalle-nombre { font-size: 24px; }
    .ah-saldo-valor { font-size: 28px; }
}

.ah-metricas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.ah-metrica {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.ah-metrica-icono {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.ah-metrica-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 2px;
}
.ah-metrica-valor {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    line-height: 1.1;
}

.ah-acciones-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.ah-acciones-row .btn { flex: 1; min-width: 140px; }

.ah-plan-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(135deg, #DBEAFE, #BFDBFE);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #93C5FD;
}
.ah-plan-row.inactivo { opacity: 0.5; background: var(--surface-hover); border-color: var(--border); }
.ah-plan-info { font-size: 14px; color: var(--text-primary); }
.ah-plan-info strong { font-feature-settings: 'tnum'; }

.ah-mov-list { display: flex; flex-direction: column; gap: 8px; }
.ah-mov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.ah-mov-item:hover { background: var(--surface-hover); }
.ah-mov-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.ah-mov-info { flex: 1; min-width: 0; }
.ah-mov-titulo { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.ah-mov-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ah-mov-monto { font-size: 15px; font-weight: 800; font-feature-settings: 'tnum'; flex-shrink: 0; }

/* Botones icono en cards de ahorro */
.ahorro-btn-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ahorro-btn-icon:hover { background: var(--primary); color: white; }
.ahorro-btn-icon.danger:hover { background: var(--danger); color: white; }

/* ============================================================
   ===== SELECTOR DE MES EN DASHBOARD =====
   ============================================================ */
.mes-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 8px 12px;
    background: white;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    width: fit-content;
}
.mes-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-hover);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.mes-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}
.mes-actual {
    min-width: 180px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: capitalize;
    padding: 0 8px;
}
.mes-btn-hoy {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--primary);
    background: linear-gradient(135deg, #EEF2FF, white);
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 6px;
    transition: all 0.2s;
}
.mes-btn-hoy:hover {
    background: var(--primary);
    color: white;
}

/* ============================================================
   ===== KPIs DE MONEDAS EXTRANJERAS =====
   ============================================================ */
.kpis-extranjeros {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.kpi-extranjero {
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    color: white;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 6px 14px rgba(31, 41, 55, 0.25);
    position: relative;
    overflow: hidden;
}
.kpi-extranjero::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
    border-radius: 50%;
}
.kpi-ext-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.85;
    font-weight: 700;
    margin-bottom: 6px;
    position: relative;
}
.kpi-ext-label i {
    color: #3B82F6;
    margin-right: 4px;
}
.kpi-ext-valor {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
    font-feature-settings: 'tnum';
    position: relative;
    margin-bottom: 4px;
}
.kpi-ext-detalle {
    font-size: 11px;
    opacity: 0.7;
    position: relative;
}

/* Cuentas extranjeras */
.cuenta-badge-moneda {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
    color: white;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid rgba(255,255,255,0.2);
}
.account-card-extranjera {
    border: 2px solid rgba(59, 130, 246, 0.4) !important;
}

/* ============================================================
   ===== TARJETAS: MODAL MOVIMIENTOS + CLICKABLE =====
   ============================================================ */
.cc-card-clickeable {
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
}
.cc-card-clickeable:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 18px 40px rgba(0,0,0,0.18);
}

.tarj-mov-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 14px;
    background: linear-gradient(135deg, #F1F5F9, #F8FAFC);
    border-radius: 12px;
    margin-bottom: 14px;
}
.tarj-mov-resumen > div { text-align: center; }
.tarj-mov-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.tarj-mov-val {
    font-size: 18px;
    font-weight: 800;
    font-feature-settings: 'tnum';
    margin-top: 4px;
}

.tarj-mov-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; }
.tarj-mov-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.tarj-mov-item:hover { background: var(--surface-hover); }
.tarj-mov-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tarj-mov-info { flex: 1; min-width: 0; }
.tarj-mov-titulo { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.tarj-mov-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.tarj-mov-monto { font-size: 15px; font-weight: 800; font-feature-settings: 'tnum'; flex-shrink: 0; }

/* ============================================================
   ===== REPORTE PDF =====
   ============================================================ */
.reporte-actions-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 14px;
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    border: 1px solid #C7D2FE;
    border-radius: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.reporte-actions-bar .icono-grande {
    width: 56px; height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
}
.reporte-actions-info { flex: 1; min-width: 200px; }
.reporte-actions-info h3 { margin: 0 0 4px; font-size: 16px; }
.reporte-actions-info p { margin: 0; font-size: 13px; color: var(--text-secondary); }

/* ============================================================
   ===== PRESUPUESTOS =====
   ============================================================ */

.pres-empty {
    text-align: center;
    padding: 50px 20px;
}
.pres-empty-icon {
    font-size: 80px;
    margin-bottom: 16px;
}
.pres-empty h2 {
    font-size: 24px;
    margin: 0 0 12px;
    color: var(--text-primary);
}

.pres-method-explain {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 24px;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 600px) {
    .pres-method-explain { grid-template-columns: 1fr; }
}
.pres-method-card {
    padding: 22px 18px;
    border-radius: 14px;
    text-align: center;
    border: 2px solid var(--c, #6366F1);
    background: linear-gradient(135deg, color-mix(in srgb, var(--c) 8%, white), white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}
.pres-method-pct {
    font-size: 36px;
    font-weight: 800;
    color: var(--c);
    line-height: 1;
}
.pres-method-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 8px;
}
.pres-method-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* Hero del presupuesto */
.pres-hero {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 1.5fr;
    gap: 20px;
    background: linear-gradient(135deg, #059669 0%, #10B981 50%, #34D399 100%);
    background-size: 200% 200%;
    animation: oblig-bg 8s ease-in-out infinite;
    border-radius: 22px;
    padding: 24px;
    color: white;
    box-shadow: 0 14px 40px rgba(16, 185, 129, 0.3);
}
.pres-hero-stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pres-hero-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.85;
    font-weight: 700;
    margin-bottom: 4px;
}
.pres-hero-value {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    font-feature-settings: 'tnum';
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.pres-hero-progress {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pres-hero-progress-track {
    height: 16px;
    background: rgba(255,255,255,0.25);
    border-radius: 8px;
    overflow: hidden;
}
.pres-hero-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, white, rgba(255,255,255,0.85));
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pres-hero-progress-info {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .pres-hero { grid-template-columns: repeat(2, 1fr); }
    .pres-hero-progress { grid-column: 1 / -1; }
}

/* Grupos 50/30/20 */
.pres-grupos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
@media (max-width: 768px) {
    .pres-grupos-grid { grid-template-columns: 1fr; }
}
.pres-grupo-card {
    background: white;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.pres-grupo-titulo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}
.pres-grupo-badge {
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}
.pres-grupo-monto {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    font-feature-settings: 'tnum';
    margin-bottom: 8px;
}
.pres-grupo-monto small {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}
.pres-grupo-progress-track {
    height: 8px;
    background: var(--surface-hover);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}
.pres-grupo-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s;
}
.pres-grupo-mensaje {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
}
.pres-mensaje-optimo { background: #D1FAE5; color: #065F46; }
.pres-mensaje-bajo { background: #DBEAFE; color: #1E40AF; }
.pres-mensaje-excedido { background: #FEE2E2; color: #991B1B; }

/* Sobres */
.pres-sobre {
    display: flex;
    gap: 14px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    transition: all 0.2s;
}
.pres-sobre:hover {
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}
.pres-sobre-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.pres-sobre-info {
    flex: 1;
    min-width: 0;
}
.pres-sobre-row-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}
.pres-sobre-nombre {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}
.pres-sobre-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.pres-grupo-tag {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.pres-grupo-tag.pres-grupo-necesidades { background: #D1FAE5; color: #065F46; }
.pres-grupo-tag.pres-grupo-deseos { background: #FCE7F3; color: #9D174D; }
.pres-grupo-tag.pres-grupo-ahorro_inversion { background: #FEF3C7; color: #78350F; }

.pres-sobre-acciones { display: flex; gap: 4px; }

.pres-sobre-monto-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    font-size: 14px;
}

.pres-sobre-progress-track {
    height: 8px;
    background: var(--surface-hover);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 6px;
}
.pres-sobre-progress-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s;
}

.pres-sobre-alerta {
    font-size: 12px;
    color: #DC2626;
    background: #FEE2E2;
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 4px;
}
.pres-sobre-restante {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Asistente */
.asis-resumen {
    background: linear-gradient(135deg, #EEF2FF, #F5F3FF);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
}
.asis-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
@media (max-width: 700px) { .asis-grid { grid-template-columns: 1fr; } }

.asis-stat {
    background: white;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid var(--border);
}
.asis-stat-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 600;
}
.asis-stat-valor {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 4px;
    font-feature-settings: 'tnum';
}
.asis-stat-info { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

.asis-sobres-list { display: flex; flex-direction: column; gap: 8px; }
.asis-sobre-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}
.asis-sobre-icon {
    width: 36px; height: 36px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.asis-sobre-data { flex: 1; min-width: 0; font-size: 13px; }
.asis-sobre-data strong { color: var(--text-primary); }
.asis-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 700;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.asis-badge.auto { background: #DBEAFE; color: #1E40AF; }
.asis-badge.sug { background: #FEF3C7; color: #78350F; }
.asis-info {
    background: #DBEAFE;
    border-left: 4px solid #3B82F6;
    padding: 12px 14px;
    border-radius: 10px;
    color: #1E3A8A;
    font-size: 13px;
}

/* Selector de grupo */
.pres-grupo-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (max-width: 480px) {
    .pres-grupo-selector { grid-template-columns: 1fr; }
}
.pres-grupo-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.pres-grupo-opt:hover { border-color: var(--primary); }
.pres-grupo-opt.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #EEF2FF, white);
    box-shadow: 0 4px 8px rgba(99,102,241,0.15);
}
.pres-grupo-opt input { display: none; }
.pres-grupo-pct {
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}
.pres-grupo-opt strong { font-size: 13px; }

/* Picker de categorías */
.categorias-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-hover);
}
.cat-pick-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.cat-pick-opt:hover { border-color: var(--primary); }
.cat-pick-opt.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #EEF2FF, white);
}
.cat-pick-opt input { display: none; }
.cat-pick-opt i { font-size: 14px; flex-shrink: 0; }
.cat-pick-opt span { font-size: 12px; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; }

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger); color: white; }

/* ============================================================
   ===== CAMPANITA + PANEL DE NOTIFICACIONES =====
   ============================================================ */

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-bell {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface-hover, #F1F5F9);
    border: 1px solid var(--border, #E2E8F0);
    color: var(--text-primary, #1F2937);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.topbar-bell:hover {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border-color: var(--primary, #4F46E5);
    color: var(--primary, #4F46E5);
    transform: translateY(-1px);
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #DC2626, #EF4444);
    color: white;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    border: 2px solid white;
    animation: bellPulse 2s ease-in-out infinite;
}
@keyframes bellPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Panel de notificaciones */
.notifs-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.notifs-panel-overlay.activo {
    opacity: 1;
    pointer-events: all;
}

.notifs-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -10px 0 30px rgba(0,0,0,0.15);
    z-index: 1600;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}
.notifs-panel.abierto {
    transform: translateX(0);
    visibility: visible;
}

.notifs-panel-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--primary, #4F46E5), #6366F1);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.notifs-panel-title {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.notifs-panel-actions {
    display: flex;
    gap: 6px;
}
.notifs-panel-btn {
    width: 36px; height: 36px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
}
.notifs-panel-btn:hover { background: rgba(255,255,255,0.25); }

.notifs-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #F8FAFC;
}

.notifs-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary, #64748B);
}
.notifs-empty i { font-size: 48px; margin-bottom: 12px; color: #CBD5E1; }
.notifs-empty p { margin: 0; font-size: 14px; }

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.2s;
    position: relative;
}
.notif-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); transform: translateY(-1px); }
.notif-item.no-leida {
    background: linear-gradient(135deg, #EEF2FF, white);
    border-left: 4px solid var(--primary, #4F46E5);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.notif-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.notif-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary, #1F2937);
    line-height: 1.3;
    margin-bottom: 2px;
}
.notif-msg {
    font-size: 12px;
    color: var(--text-secondary, #64748B);
    line-height: 1.4;
    margin-bottom: 4px;
}
.notif-time {
    font-size: 10px;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.notif-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    align-self: flex-start;
}
.notif-close:hover { background: #FEE2E2; color: #DC2626; }

@media (max-width: 480px) {
    .notifs-panel { max-width: 100%; }
}

/* En móvil, esconder el nombre del usuario */
@media (max-width: 600px) {
    .user-name { display: none; }
}

/* Notificaciones dashboard inline */
.dash-notifs-card {
    background: linear-gradient(135deg, #FEF3C7, #FFFBEB);
    border-left: 4px solid #F59E0B;
}
.dash-notifs-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-notif-row {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.dash-notif-row:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.dash-notif-row .notif-icon { width: 34px; height: 34px; font-size: 14px; }

/* Totales en vivo del asistente */
.asis-totales-vivo {
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F1F5F9, #F8FAFC);
    border: 2px solid var(--border, #E2E8F0);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.asis-totales-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border, #E2E8F0);
    transition: background 0.3s;
}
.asis-totales-row strong {
    font-feature-settings: 'tnum';
    font-size: 16px;
}
.asis-totales-row span i { margin-right: 6px; color: var(--text-secondary, #64748B); }

@media (max-width: 480px) {
    .asis-totales-row { flex-wrap: wrap; gap: 4px; }
    .asis-totales-row strong { font-size: 14px; }
}

/* Fix picker categorías - check visible */
.cat-pick-opt {
    position: relative;
    user-select: none;
}
.cat-pick-check {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary, #6366F1);
    font-size: 12px;
}
.cat-pick-opt.active span { padding-right: 16px; }

/* Banner de guía en dashboard */
.dash-guia-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #D1FAE5 0%, #ECFDF5 100%);
    border: 1px solid #6EE7B7;
    border-radius: 14px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.1);
}
.dash-guia-icon {
    font-size: 32px;
    flex-shrink: 0;
}
.dash-guia-content { flex: 1; min-width: 0; }
.dash-guia-content strong {
    display: block;
    font-size: 14px;
    color: #065F46;
    margin-bottom: 2px;
}
.dash-guia-content p {
    margin: 0;
    font-size: 12px;
    color: #047857;
}
.dash-guia-close {
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.05);
    border: none;
    border-radius: 8px;
    color: #047857;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}
.dash-guia-close:hover { background: rgba(0,0,0,0.12); }

@media (max-width: 600px) {
    .dash-guia-banner { flex-wrap: wrap; padding: 12px; }
    .dash-guia-content { width: 100%; order: 1; }
    .dash-guia-icon { order: 0; }
    .dash-guia-banner .btn { order: 2; flex: 1; justify-content: center; }
    .dash-guia-close {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
    }
}

/* ============================================ */
/* FIX: prevenir scroll horizontal en móvil    */
/* ============================================ */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        position: relative;
    }

    .app-container {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .main-content {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .page-content {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Cualquier elemento que se salga, contenido */
    .topbar,
    .page-header,
    .stats-grid,
    .card,
    .comparison-card {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    /* Sidebar SIEMPRE fuera por la izquierda usando transform (no afecta layout) */
    .sidebar:not(.active) {
        transform: translateX(-105%) !important;
    }

    /* Los paneles deslizables usan transform (no right negativo) */
    .notifs-panel:not(.abierto) {
        transform: translateX(105%) !important;
    }
}

/* Subtítulo de la comparativa proporcional */
.comparison-subtitle {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.comparison-subtitle i { font-size: 14px; opacity: 0.9; }

/* Banner edición voz */
.voz-edit-banner {
    background: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
    border-left: 4px solid #3B82F6;
    color: #1E40AF;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.voz-edit-banner i { font-size: 14px; }

/* ============================================ */
/* MODO OSCURO                                  */
/* ============================================ */
[data-theme="dark"] {
    --bg-primary: #0F172A;
    --bg-secondary: #1E293B;
    --bg-tertiary: #334155;

    --text-primary: #F1F5F9;
    --text-secondary: #CBD5E1;
    --text-tertiary: #94A3B8;

    --border-color: #334155;
    --border-color-strong: #475569;

    --surface: #1E293B;
    --surface-hover: #334155;
    --border: #334155;

    --primary-light: rgba(79, 70, 229, 0.15);
    --success-light: rgba(16, 185, 129, 0.15);
    --danger-light: rgba(239, 68, 68, 0.15);
    --warning-light: rgba(245, 158, 11, 0.15);
    --info-light: rgba(59, 130, 246, 0.15);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body { background: var(--bg-primary); color: var(--text-primary); }

[data-theme="dark"] .topbar,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-input,
[data-theme="dark"] .input,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] select {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .bottom-nav {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .empty-state,
[data-theme="dark"] .text-muted,
[data-theme="dark"] .form-help {
    color: var(--text-tertiary) !important;
}

[data-theme="dark"] .nav-item {
    color: var(--text-secondary);
}
[data-theme="dark"] .nav-item:hover { background: var(--bg-tertiary); }
[data-theme="dark"] .nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Toggle visual del modo */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    width: 50px;
    height: 28px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
    padding: 0;
    flex-shrink: 0;
}
.theme-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s, background 0.3s;
}
[data-theme="dark"] .theme-toggle { background: #4F46E5; }
[data-theme="dark"] .theme-toggle::after {
    transform: translateX(22px);
    background: #1E293B;
}
.theme-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-secondary);
    pointer-events: none;
}
.theme-toggle-icon.sun { left: 6px; }
.theme-toggle-icon.moon { right: 6px; }
[data-theme="dark"] .theme-toggle-icon.sun { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .theme-toggle-icon.moon { color: white; }

/* Badge vista familia en topbar */
.topbar-vista-familia {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar-vista-familia:hover { transform: translateY(-1px); }
.topbar-vista-familia i { font-size: 11px; }

@media (max-width: 600px) {
    .topbar-vista-familia { padding: 4px 8px; font-size: 11px; max-width: 120px; }
    .topbar-vista-familia span { font-size: 11px; }
}
