/* ========================================
   MiFinanzas - Control Financiero Personal
   Light Theme - Green LatAm Accents
   ======================================== */

/* CSS Variables / Design Tokens */
:root {
    /* Primary Green Palette (LatAm) */
    --primary-50: #f0fdf4;
    --primary-100: #dcfce7;
    --primary-200: #BBF7D0;
    --primary-300: #86efac;
    --primary-400: #4ade80;
    --primary-500: #09331a;
    --primary-600: #09331a;
    --primary-700: #15803d;
    --primary-800: #166534;
    --primary-900: #09331a;

    /* Sidebar - Dark Green */
    --sidebar-bg: #09331a;
    --sidebar-bg-darker: #0f3d21;
    --sidebar-width: 250px;
    --sidebar-text: #a7f3d0;
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: rgba(9, 51, 26, 0.45);
    --sidebar-border: rgba(255, 255, 255, 0.08);

    /* Semantic Colors */
    --success: #09331a;
    --success-bg: rgba(9, 51, 26, 0.08);
    --success-light: #dcfce7;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --danger-light: #fee2e2;
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --info: #2563EB;
    --info-bg: rgba(37, 99, 235, 0.08);

    /* Backgrounds - Light Neutral */
    --bg-primary: #F3F4F6;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0fdf4;
    --bg-input: #F3F4F6;
    --bg-topbar: #09331a;

    /* Text */
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;

    /* Borders & Shadows */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);

    /* Topbar */
    --topbar-height: 72px;
}

/* ========================================
   Reset & Base
   ======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-200);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-400);
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform var(--transition-slow);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Sidebar Header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-lg);
    min-height: 72px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon .material-icons-outlined {
    font-size: 20px;
}

.logo-text {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-inverse);
    letter-spacing: -0.3px;
}

.sidebar-close-btn {
    background: none;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-close-btn:hover {
    background: var(--sidebar-hover);
    color: var(--text-inverse);
}

/* Sidebar User */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    margin: 0 var(--space-sm);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: var(--space-md);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-300), var(--primary-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-inverse);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-plan {
    font-size: 0.7rem;
    color: var(--primary-200);
    font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0 var(--space-sm);
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 11px var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--text-inverse);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary-300);
    border-radius: 0 3px 3px 0;
}

.nav-item .material-icons-outlined {
    font-size: 21px;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: var(--sidebar-border);
    margin: var(--space-md) var(--space-md);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: var(--space-md);
    margin-top: auto;
}

.sidebar-cta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.2), rgba(156, 39, 176, 0.15));
    border: 1px solid rgba(171, 71, 188, 0.2);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.sidebar-cta:hover {
    background: linear-gradient(135deg, rgba(171, 71, 188, 0.3), rgba(156, 39, 176, 0.25));
    transform: translateY(-1px);
}

.sidebar-cta .material-icons-outlined {
    color: var(--primary-200);
    font-size: 22px;
}

.cta-text {
    display: flex;
    flex-direction: column;
}

.cta-text strong {
    font-size: 0.8rem;
    color: var(--primary-100);
}

.cta-text small {
    font-size: 0.65rem;
    color: var(--sidebar-text);
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    position: relative;
    overflow-x: hidden;
}

/* ========================================
   Top Bar
   ======================================== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-xl);
    height: var(--topbar-height);
    background: var(--bg-topbar);
    color: var(--text-inverse);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-inverse);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.menu-btn .material-icons-outlined {
    font-size: 26px;
}

.greeting-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-inverse);
}

.greeting-subtitle {
    font-size: 0.78rem;
    color: var(--primary-200);
    margin-top: 1px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Month Selector */
.month-selector {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.08);
    padding: 6px var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.month-btn {
    background: none;
    border: none;
    color: var(--primary-200);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.month-btn:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.1);
}

.current-month {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-inverse);
    min-width: 120px;
    text-align: center;
}

/* Notification */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--primary-200);
    cursor: pointer;
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.notification-btn:hover {
    color: var(--text-inverse);
    background: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--danger);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   Dashboard
   ======================================== */
.dashboard {
    padding: var(--space-xl);
    max-width: 1400px;
    animation: fadeInUp 0.4s ease;
    overflow-x: hidden;
}

.page-content {
    padding: var(--space-xl);
    max-width: 1400px;
    animation: fadeInUp 0.4s ease;
    overflow-x: hidden;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Titles */
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.section-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.section-title-sm {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

/* ========================================
   Summary Cards
   ======================================== */
.summary-section {
    margin-bottom: var(--space-xl);
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-card);
    position: relative;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.card-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon .material-icons-outlined {
    font-size: 22px;
}

.icon-ingresos {
    background: var(--success-light);
    color: var(--success);
}

.icon-gastos {
    background: var(--danger-light);
    color: var(--danger);
}

.icon-saldo {
    background: #e3f2fd;
    color: var(--info);
}

.icon-ahorros {
    background: var(--primary-50);
    color: var(--primary-500);
}

.card-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: var(--space-sm);
}

.card-ingresos .card-value {
    color: var(--success);
}

.card-gastos .card-value {
    color: var(--danger);
}

.card-saldo .card-value {
    color: var(--info);
}

.card-ahorros .card-value {
    color: #16A34A;
}

.card-trend {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.72rem;
    font-weight: 500;
}

.card-trend .material-icons-outlined {
    font-size: 15px;
}

.trend-up {
    color: var(--success);
}

.trend-down {
    color: var(--danger);
}

.trend-neutral {
    color: var(--text-muted);
}

/* ========================================
   Dashboard Grid
   ======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* ========================================
   Quick Actions
   ======================================== */
.quick-actions-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-primary);
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.action-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-icon .material-icons-outlined {
    font-size: 25px;
}

.action-ingreso .action-icon {
    background: var(--success-light);
    color: var(--success);
}

.action-ingreso:hover {
    border-color: var(--success);
    background: rgba(0, 200, 83, 0.03);
}

.action-gasto .action-icon {
    background: var(--danger-light);
    color: var(--danger);
}

.action-gasto:hover {
    border-color: var(--danger);
    background: rgba(255, 82, 82, 0.03);
}

.action-deuda .action-icon {
    background: #fff3e0;
    color: var(--warning);
}

.action-deuda:hover {
    border-color: var(--warning);
    background: rgba(255, 152, 0, 0.03);
}

.action-ahorro .action-icon {
    background: var(--primary-50);
    color: var(--primary-500);
}

.action-ahorro:hover {
    border-color: var(--primary-400);
    background: rgba(156, 39, 176, 0.03);
}

.action-label {
    font-size: 0.85rem;
    font-weight: 600;
}

.action-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
}

/* ========================================
   Budget Control
   ======================================== */
.budget-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.budget-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.budget-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.budget-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.budget-category {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.budget-amounts {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.budget-bar {
    width: 100%;
    height: 7px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.budget-progress {
    height: 100%;
    border-radius: 4px;
    transition: width var(--transition-slow);
}

.budget-progress[data-category="fijos"] {
    background: linear-gradient(90deg, var(--info), #64b5f6);
}

.budget-progress[data-category="variables"] {
    background: linear-gradient(90deg, var(--warning), #ffcc80);
}

.budget-progress[data-category="deudas"] {
    background: linear-gradient(90deg, var(--danger), #ff8a80);
}

.budget-progress[data-category="ahorros"] {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-300));
}

.budget-label-sm {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

/* ========================================
   Transactions
   ======================================== */
.transactions-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.transactions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.transactions-header .section-title-sm {
    margin-bottom: 0;
}

.see-all-btn {
    background: none;
    border: none;
    color: var(--primary-500);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.see-all-btn:hover {
    color: var(--primary-700);
}

.transactions-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Transaction Item */
.transaction-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.transaction-item:hover {
    border-color: var(--border-color);
    background: var(--bg-card-hover);
}

.transaction-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.transaction-icon.ingreso {
    background: var(--success-light);
}

.transaction-icon.gasto {
    background: var(--danger-light);
}

.transaction-details {
    flex: 1;
    min-width: 0;
}

.transaction-desc {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-category {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.transaction-right {
    text-align: right;
    flex-shrink: 0;
}

.transaction-amount {
    font-size: 0.92rem;
    font-weight: 700;
}

.transaction-amount.ingreso {
    color: #16A34A;
}

.transaction-amount.gasto {
    color: #7B2D3B;
}

.transaction-date {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.empty-icon {
    font-size: 48px;
    color: var(--primary-200);
    margin-bottom: var(--space-md);
    opacity: 0.6;
}

.empty-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.empty-subtext {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ========================================
   FAB (Floating Action Button)
   ======================================== */
.fab {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 54px;
    height: 54px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(156, 39, 176, 0.35);
    transition: all var(--transition-base);
    z-index: 500;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 24px rgba(156, 39, 176, 0.45);
}

.fab .material-icons-outlined {
    font-size: 28px;
}

/* ========================================
   Modal
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(25px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.modal-form {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 11px var(--space-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(156, 39, 176, 0.12);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e9eb3' fill='none' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Debt detail fields */
.deuda-fields-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: var(--space-md) 0 var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px dashed var(--border-color);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group input[readonly] {
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: default;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 13px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.25);
    margin-top: var(--space-sm);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit .material-icons-outlined {
    font-size: 20px;
}

/* Pagar Deuda Toggle */
.pagar-deuda-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.pagar-deuda-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pagar-deuda-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
}

.pagar-deuda-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.pagar-deuda-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #374151;
    transition: 0.3s;
    border-radius: 22px;
}

.pagar-deuda-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.pagar-deuda-switch input:checked+.pagar-deuda-slider {
    background: #e65100;
}

.pagar-deuda-switch input:checked+.pagar-deuda-slider::before {
    transform: translateX(20px);
}

#deudaSelector {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
}

#deudaSelector option {
    background: var(--card-bg);
    color: var(--text-primary);
}

/* ========================================
   Indicadores Page
   ======================================== */
.page-content {
    animation: fadeInUp 0.4s ease;
}

.indicators-grid-top {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-lg);
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.indicators-grid-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.ind-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.ind-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.ind-card-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.ind-card-title .material-icons-outlined {
    font-size: 20px;
    color: var(--text-secondary);
}

.ind-selectors {
    display: flex;
    gap: var(--space-sm);
}

.ind-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239e9eb3' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 26px;
    min-width: 90px;
}

.ind-select:focus {
    border-color: var(--primary-400);
}

/* Monthly Bars Chart (HTML/CSS) */
.ind-bars-chart {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--space-2xl);
    padding: var(--space-xl) var(--space-md);
    min-height: 240px;
}

.ind-bar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.ind-bar-wrapper {
    width: 50px;
    height: 160px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.ind-bar {
    width: 100%;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ind-bar-value {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.ind-bar-label {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Annual Summary */
.ind-annual-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ind-annual-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ind-annual-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.ind-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.ind-annual-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.color-success {
    color: var(--success);
}

.color-danger {
    color: var(--danger);
}

.color-info {
    color: var(--info);
}

.ind-annual-bar-wrap {
    width: 100%;
    height: 5px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.ind-annual-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* Safety Zone */
.safety-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.safety-status-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: var(--bg-primary);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.safety-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--danger);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.safety-status-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.safety-percentage {
    text-align: right;
}

.safety-percent-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--success);
    display: block;
}

.safety-percent-label {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* Safety Progress Bar */
.safety-bar-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.safety-bar {
    position: relative;
    width: 100%;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, #16A34A 0%, #16A34A 70%, #ffab40 70%, #ffab40 85%, #ef4444 85%, #ef4444 100%);
    overflow: visible;
}

.safety-bar-fill {
    height: 100%;
    border-radius: 7px;
    background: transparent;
    position: relative;
    z-index: 1;
}

.safety-bar-marker {
    position: absolute;
    top: -24px;
    transform: translateX(-50%);
    z-index: 2;
}

.marker-label {
    background: var(--text-primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    position: relative;
}

.marker-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-primary);
}

.safety-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
}

.safety-divider {
    height: 1px;
    background: var(--border-color);
}

/* Red expense bar */
.safety-bar-red-wrap {
    margin-bottom: var(--space-sm);
}

.safety-bar-red {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.safety-bar-red-fill {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #ff1744);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Safety Footer */
.safety-footer {
    display: flex;
    justify-content: space-between;
}

.safety-footer-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.safety-footer-item.right {
    text-align: right;
}

.safety-footer-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.safety-footer-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.safety-footer-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

/* Trends */
.trends-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.trend-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.trend-item:hover {
    border-color: var(--border-color);
}

.trend-highlight {
    background: var(--primary-50);
    border-color: var(--primary-100);
}

.trend-icon-wrap {
    flex-shrink: 0;
    margin-top: 2px;
}

.trend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trend-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trend-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ========================================
   Control Financiero Page
   ======================================== */
.cf-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.cf-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.cf-selectors {
    display: flex;
    gap: var(--space-sm);
}

.cf-btn-new {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(156, 39, 176, 0.25);
    white-space: nowrap;
}

.cf-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(156, 39, 176, 0.35);
}

.cf-btn-new .material-icons-outlined {
    font-size: 20px;
}

/* Dropdown */
.cf-dropdown-wrap {
    position: relative;
}

.cf-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: fadeInDown 0.15s ease;
}

.cf-dropdown.open {
    display: block;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cf-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.cf-dropdown-item:hover {
    background: var(--bg-primary);
}

.cf-dropdown-item .material-icons-outlined {
    font-size: 20px;
}

/* Filter Tabs */
.cf-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
}

.cf-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.cf-tab:hover {
    color: var(--text-primary);
}

.cf-tab.active {
    color: var(--primary-500);
}

.cf-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-500);
    border-radius: 3px 3px 0 0;
}

/* Table Card */
.cf-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.cf-table {
    width: 100%;
    border-collapse: collapse;
}

.cf-table thead tr {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.cf-table th {
    padding: 14px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: left;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.cf-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
}

.cf-table tbody tr:last-child td {
    border-bottom: none;
}

.cf-table tbody tr:hover {
    background: var(--bg-card-hover);
}

/* Table description cell */
.cf-desc {
    font-weight: 600;
    color: var(--text-primary);
}

.cf-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
}

/* Type Badge */
.cf-type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.cf-type-badge.ingreso {
    background: #dcfce7;
    color: #16A34A;
}

.cf-type-badge.gasto {
    background: #fce4ec;
    color: #7B2D3B;
}

.cf-type-badge.deuda {
    background: #fff3e0;
    color: #e65100;
}

.cf-type-badge.ahorro {
    background: #e0f2fe;
    color: #0369a1;
}

/* Value colors in table */
.cf-table td.cf-val-ingreso {
    color: #16A34A;
    font-weight: 700;
}

.cf-table td.cf-val-gasto {
    color: #7B2D3B;
    font-weight: 700;
}

.cf-table td.cf-val-deuda {
    color: #7B2D3B;
    font-weight: 700;
}

.cf-table td.cf-val-ahorro {
    color: #16A34A;
    font-weight: 700;
}

.cf-deuda-detail {
    font-size: 0.72rem;
    color: #e65100;
    margin-top: 3px;
    font-weight: 500;
}

/* Status badges */
.cf-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.cf-status-recibido {
    background: #dcfce7;
    color: #15803d;
}

.cf-status-pagado {
    background: #dcfce7;
    color: #15803d;
}

.cf-status-apagar {
    background: #fff3e0;
    color: #e65100;
}

.cf-status-ahorrado {
    background: #e0f2fe;
    color: #0369a1;
}

/* Action buttons */
.cf-actions {
    display: flex;
    gap: var(--space-xs);
}

.cf-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.cf-action-btn:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(255, 82, 82, 0.05);
}

.cf-edit-btn:hover {
    color: var(--primary-500);
    border-color: var(--primary-500);
    background: rgba(156, 39, 176, 0.05);
}

.cf-pagar-btn {
    color: #e65100 !important;
    border-color: #e65100 !important;
}

.cf-pagar-btn:hover {
    background: rgba(230, 81, 0, 0.1) !important;
    color: #bf360c !important;
}

.cf-action-btn .material-icons-outlined {
    font-size: 18px;
}

/* Empty state */
.cf-empty {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg) !important;
    color: var(--text-muted);
}

.cf-empty p {
    margin-top: var(--space-sm);
    font-size: 0.88rem;
}

/* ========================================
   Metas Financieras Page
   ======================================== */

/* Summary Card */
.meta-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.meta-summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.meta-summary-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
}

.meta-summary-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.meta-summary-value small {
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--text-muted);
}

.meta-summary-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.meta-summary-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), #ff9800);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.meta-summary-footer {
    text-align: right;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Goals Grid */
.metas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-lg);
}

/* Individual Goal Card */
.meta-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.meta-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.meta-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.meta-card-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.meta-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.meta-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.meta-card-plazo {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.meta-card-actions {
    display: flex;
    gap: var(--space-xs);
}

.meta-card-progress {
    margin-bottom: var(--space-md);
}

.meta-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.meta-progress-percent {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary-500);
}

.meta-progress-bar {
    width: 100%;
    height: 10px;
    background: var(--bg-primary);
    border-radius: 5px;
    overflow: hidden;
}

.meta-progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
}

.meta-progress-fill.complete {
    background: linear-gradient(90deg, #16A34A, #69f0ae);
}

.meta-card-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

.meta-card-saved {
    color: var(--success);
    font-weight: 600;
}

.meta-card-target {
    color: var(--text-muted);
}

/* Status Badge */
.meta-status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.meta-status-badge.no_iniciado {
    background: #f5f5f5;
    color: #9e9e9e;
}

.meta-status-badge.en_progreso {
    background: var(--primary-50);
    color: var(--primary-500);
}

.meta-status-badge.completado {
    background: var(--success-light);
    color: var(--success);
}

/* Empty State */
.meta-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.meta-empty p {
    font-size: 0.92rem;
    font-weight: 500;
}

/* Drawer Overlay */
.meta-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.meta-drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Panel */
.meta-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--bg-card);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.meta-drawer-overlay.open .meta-drawer {
    right: 0;
}

.meta-drawer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: var(--space-xl) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.meta-drawer-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.meta-drawer-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.meta-drawer-form {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    flex: 1;
}

.meta-input-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.meta-input-icon .material-icons-outlined,
.meta-input-icon .meta-currency {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}

.meta-input-icon .meta-currency {
    font-weight: 700;
    font-size: 0.92rem;
}

.meta-input-icon .form-input,
.meta-input-icon select.form-input {
    padding-left: 38px;
}

.meta-drawer-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.meta-btn-cancel {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 20px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.meta-btn-cancel:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ========================================
   Responsive Design
   ======================================== */

/* Tablet & below */
@media (max-width: 1024px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .indicators-grid-top,
    .indicators-grid-bottom {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .topbar {
        padding: 0 var(--space-md);
    }

    .greeting-title {
        font-size: 1rem;
    }

    .greeting-subtitle {
        display: none;
    }

    .month-selector {
        display: none;
    }

    .dashboard {
        padding: var(--space-md);
    }

    .summary-cards {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-md);
    }

    .card-value {
        font-size: 1.25rem;
    }

    .card-label {
        font-size: 0.7rem;
    }

    .card-trend {
        font-size: 0.65rem;
    }

    .ind-chart-legend-row {
        flex-direction: column;
        align-items: center;
        gap: var(--space-md);
    }

    .safety-status-row {
        flex-direction: column;
        gap: var(--space-md);
    }

    .safety-percentage {
        text-align: left;
    }

    .fab {
        bottom: var(--space-md);
        right: var(--space-md);
    }

    .cf-header {
        flex-direction: column;
    }

    .cf-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .cf-table-card {
        overflow-x: auto;
    }

    .cf-table {
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-right {
        gap: var(--space-sm);
    }
}

/* ========================================
   Endeudamiento Page
   ======================================== */

.end-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-lg);
}

.end-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
}

.end-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.end-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.end-card-title .material-icons-outlined {
    font-size: 20px;
    color: var(--primary-500);
}

.end-card-title-sm {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

/* Legend */
.end-legend {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    margin-bottom: var(--space-md);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.end-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.end-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Chart Area */
.end-chart-card {
    min-height: 280px;
}

.end-chart-area {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 160px;
    padding: 0 8px;
}

.end-bar-col {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 50px;
}

.end-bar-stack {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 24px;
}

.end-bar-segment {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.4s ease;
}

.end-bar-paid {
    background: #16A34A;
}

.end-bar-pending {
    background: #e65100;
    border-radius: 4px 4px 0 0;
}

.end-bar-current .end-bar-stack {
    position: relative;
}

.end-bar-current .end-bar-stack::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-500);
}

.end-chart-months {
    display: flex;
    justify-content: space-around;
    padding: 12px 8px 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Sidebar */
.end-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Debts list */
.end-debts-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.end-debt-item {
    padding: 12px;
    background: var(--bg-tertiary, rgba(0, 0, 0, 0.03));
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.end-debt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.end-debt-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
}

.end-debt-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: #e65100;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
}

.end-debt-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.end-debt-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16A34A, #22c55e);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.end-debt-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Tip Card */
.end-tip-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(22, 163, 74, 0.02));
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.end-tip-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.end-tip-icon .material-icons-outlined {
    font-size: 20px;
    color: #16A34A;
}

.end-tip-card strong {
    font-size: 0.88rem;
    color: var(--text-primary);
    display: block;
    margin-bottom: 4px;
}

.end-tip-card p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Empty state */
.end-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: var(--space-md) 0;
}

/* Detail Table */
.end-table-wrap {
    overflow-x: auto;
}

.end-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.end-table thead th {
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.end-table tbody td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.end-table tbody tr:last-child td {
    border-bottom: none;
}

.end-debt-desc {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.end-debt-desc strong {
    font-size: 0.88rem;
}

.end-debt-cat {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Progress in table */
.end-progress-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.end-progress-bar-sm {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    min-width: 60px;
}

.end-progress-fill-sm {
    height: 100%;
    background: linear-gradient(90deg, #16A34A, #22c55e);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.end-fill-done {
    background: linear-gradient(90deg, #16A34A, #4ade80) !important;
}

.end-progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-500);
    min-width: 36px;
    text-align: right;
}

/* Pagar Parcela Button */
.end-btn-pagar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #e65100, #ff6d00);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.end-btn-pagar:hover {
    background: linear-gradient(135deg, #bf360c, #e65100);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230, 81, 0, 0.3);
}

.end-btn-pagar .material-icons-outlined {
    font-size: 16px;
}

/* Completed debt */
.end-debt-complete {
    opacity: 0.7;
    border-color: #16A34A;
}

.end-badge-done {
    background: #16A34A !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .end-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Educación Financiera Page
   ======================================== */

.edu-header-stats {
    display: flex;
    gap: 16px;
    align-items: center;
}

.edu-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.edu-stat .material-icons-outlined {
    font-size: 20px;
    color: var(--primary-400);
}

/* Search Bar */
.edu-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    margin-bottom: 16px;
    transition: border-color var(--transition-fast);
}

.edu-search-bar:focus-within {
    border-color: var(--primary-400);
}

.edu-search-bar .material-icons-outlined {
    color: var(--text-muted);
    font-size: 20px;
}

.edu-search-bar input {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    font-family: 'Inter', sans-serif;
}

.edu-search-bar input::placeholder {
    color: var(--text-muted);
}

/* Category Tabs */
.edu-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.edu-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    font-family: 'Inter', sans-serif;
}

.edu-tab:hover {
    border-color: var(--primary-400);
    color: var(--primary-400);
}

.edu-tab.active {
    background: var(--primary-500);
    border-color: var(--primary-500);
    color: #fff;
}

/* Featured Article */
.edu-featured {
    margin-bottom: 24px;
}

.edu-featured-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    border: 1px solid var(--border-color);
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 32px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.edu-featured-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.edu-featured-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
}

.edu-featured-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.edu-featured-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 152, 0, 0.2);
    color: #ff9800;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edu-featured-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
    word-break: break-word;
    overflow-wrap: break-word;
}

.edu-featured-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 12px;
}

.edu-featured-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.5);
}

.edu-featured-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.edu-featured-meta .material-icons-outlined {
    font-size: 14px;
}

/* Articles Grid */
.edu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.edu-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-400);
}

.edu-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.edu-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.edu-card-icon.ahorro {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
}

.edu-card-icon.deudas {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
}

.edu-card-icon.inversion {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
}

.edu-card-icon.presupuesto {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.edu-card-icon.habitos {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.edu-card-cat {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.edu-card-cat.ahorro {
    background: #dcfce7;
    color: #15803d;
}

.edu-card-cat.deudas {
    background: #fee2e2;
    color: #b91c1c;
}

.edu-card-cat.inversion {
    background: #e0f2fe;
    color: #0369a1;
}

.edu-card-cat.presupuesto {
    background: #fef3c7;
    color: #92400e;
}

.edu-card-cat.habitos {
    background: #ede9fe;
    color: #6d28d9;
}

.edu-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.edu-card-excerpt {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 14px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.edu-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.edu-card-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.edu-card-time .material-icons-outlined {
    font-size: 14px;
}

.edu-card-read {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.edu-card-read .material-icons-outlined {
    font-size: 16px;
}

/* Article Reader Drawer */
.edu-drawer {
    max-width: 700px;
}

.edu-article-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.edu-article-content .edu-art-cat {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.edu-article-content .edu-art-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.3;
}

.edu-article-content .edu-art-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.edu-article-content .edu-art-body {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.edu-article-content .edu-art-body h3 {
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 700;
    margin: 24px 0 12px;
}

.edu-article-content .edu-art-body p {
    margin-bottom: 14px;
}

.edu-article-content .edu-art-body ul,
.edu-article-content .edu-art-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.edu-article-content .edu-art-body li {
    margin-bottom: 8px;
}

.edu-article-content .edu-art-body .edu-tip-box {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1), rgba(76, 175, 80, 0.05));
    border-left: 4px solid #4caf50;
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
    font-size: 0.88rem;
}

.edu-article-content .edu-art-body .edu-warning-box {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1), rgba(255, 152, 0, 0.05));
    border-left: 4px solid #ff9800;
    padding: 16px 20px;
    border-radius: 0 12px 12px 0;
    margin: 20px 0;
    font-size: 0.88rem;
}

.edu-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.edu-empty .material-icons-outlined {
    font-size: 48px;
    opacity: 0.4;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .edu-grid {
        grid-template-columns: 1fr;
    }

    .edu-featured-card {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .edu-featured-icon {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }

    .edu-featured-title {
        font-size: 1.1rem;
    }

    .edu-drawer {
        width: 100%;
    }
}

/* ========================================
   Mercado Page
   ======================================== */

/* Spending Card */
.merc-spending-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    overflow: visible;
}

.merc-spending-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.merc-spending-left {
    flex: 1;
}

.merc-spending-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.merc-spending-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.merc-spending-total {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
}

.merc-spending-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Mini Chart */
.merc-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 90px;
    width: 100%;
    padding-bottom: 24px;
    position: relative;
}

.merc-chart-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    min-height: 4px;
    transition: height 0.3s ease;
    cursor: pointer;
    position: relative;
}

.merc-chart-bar:hover {
    opacity: 0.8;
}

.merc-chart-bar .merc-chart-label {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.62rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* Tabs */
.merc-tabs {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.merc-tab {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.merc-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-500);
}

.merc-tab:hover {
    color: var(--text-primary);
}

/* Counter Cards */
.merc-counters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.merc-counter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.merc-counter-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.merc-counter-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Shopping List Grid */
.merc-list-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
}

/* Category Card */
.merc-cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.merc-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
}

.merc-cat-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.merc-cat-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.merc-cat-badge.frutas_verduras {
    background: #e8f5e9;
    color: #2e7d32;
}

.merc-cat-badge.carniceria {
    background: #ffebee;
    color: #c62828;
}

.merc-cat-badge.lacteos {
    background: #e3f2fd;
    color: #1565c0;
}

.merc-cat-badge.panaderia {
    background: #fff3e0;
    color: #e65100;
}

.merc-cat-badge.despensa {
    background: #dcfce7;
    color: #15803d;
}

.merc-cat-badge.bebidas {
    background: #e0f7fa;
    color: #00838f;
}

.merc-cat-badge.limpieza {
    background: #fce4ec;
    color: #ad1457;
}

.merc-cat-badge.higiene {
    background: #f1f8e9;
    color: #558b2f;
}

.merc-cat-badge.otros {
    background: #eceff1;
    color: #546e7a;
}

.merc-cat-count {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Item Row */
.merc-item {
    display: flex;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
    gap: var(--space-sm);
}

.merc-item:last-child {
    border-bottom: none;
}

.merc-item:hover {
    background: var(--bg-primary);
}

.merc-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
    flex-shrink: 0;
}

.merc-item-info {
    flex: 1;
    min-width: 0;
}

.merc-item-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.merc-item.checked .merc-item-name {
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.6;
}

.merc-item-tags {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.merc-tag {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.merc-tag.essential {
    background: #e8f5e9;
    color: #2e7d32;
}

.merc-tag.recurrent {
    background: #e3f2fd;
    color: #1565c0;
}

.merc-item-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.merc-item-qty {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    margin-right: var(--space-xs);
}

.merc-item-actions {
    display: flex;
    gap: 2px;
}

.merc-item-actions .cf-action-btn {
    width: 26px;
    height: 26px;
}

.merc-item-actions .cf-action-btn .material-icons-outlined {
    font-size: 16px;
}

/* Add Item Button */
.merc-add-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-500);
    cursor: pointer;
    width: 100%;
    transition: background var(--transition-fast);
}

.merc-add-btn:hover {
    background: var(--bg-primary);
}

.merc-add-btn .material-icons-outlined {
    font-size: 18px;
}

/* Tags row in form */
.merc-tags-row {
    display: flex;
    gap: var(--space-md);
}

.merc-tag-check {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.82rem;
}

.merc-tag-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-500);
}

/* Link Cart Items Section */
.merc-link-section {
    margin-top: var(--space-xs);
}

.merc-link-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition-fast);
}

.merc-link-card:hover {
    border-color: var(--primary-200);
}

.merc-link-toggle {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
}

.merc-link-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-500);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.merc-link-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.merc-link-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.merc-link-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.merc-link-preview {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.merc-link-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 3px 0;
}

.merc-link-qty {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
}

/* Modal subtitle */
.merc-modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    line-height: 1.5;
}

/* Historial header */
.merc-hist-header {
    margin-bottom: var(--space-lg);
}

.merc-hist-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.merc-hist-header p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Empty List State */
.merc-list-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
}

.merc-list-empty p {
    font-size: 0.92rem;
    font-weight: 500;
}

/* General Add Item Button */
.merc-add-general {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.merc-add-general:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.merc-add-general .cf-btn-new {
    font-size: 0.92rem;
}

/* History Expandable Items */
.merc-hist-expand-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-right: 6px;
    transition: all var(--transition-fast);
}

.merc-hist-expand-btn:hover {
    color: var(--primary-500);
    border-color: var(--primary-300);
    background: var(--primary-50);
}

.merc-hist-items-row td {
    padding: 0 !important;
    border: none !important;
}

.merc-hist-items-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin: 4px var(--space-md) var(--space-md) var(--space-md);
    padding: var(--space-md);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.merc-hist-items-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-bottom: var(--space-sm);
}

.merc-hist-close-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.merc-hist-close-btn:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.merc-hist-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.merc-hist-item-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.merc-hist-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-500);
    flex-shrink: 0;
}

/* ============ BUDGET BARS ============ */
.budget-chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-lg);
}

.budget-bars-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.budget-bar-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.budget-bar-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.budget-bar-category {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.budget-bar-amounts {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.budget-bar-track {
    width: 100%;
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.budget-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 0;
}

.budget-fill-ingreso {
    background: #10b981;
}

.budget-fill-gasto {
    background: #ef4444;
}

.budget-fill-deuda {
    background: #f59e0b;
}

.budget-fill-ahorro {
    background: #6366f1;
}

.budget-bar-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============ CATEGORY CHART ============ */
.cat-chart-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: var(--space-md);
    max-height: 280px;
    overflow-y: auto;
}

.cat-chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: var(--space-xl) 0;
}

.cat-chart-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cat-chart-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-chart-label {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cat-chart-amount {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.cat-chart-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.cat-chart-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.cat-chart-pct {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: right;
}

/* ============ MONTH COMPARISON ============ */
.month-compare {
    margin-top: var(--space-md);
}

.cmp-header {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-light);
}

.cmp-header span {
    color: var(--text-primary);
    font-weight: 700;
}

.cmp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background 0.2s;
}

.cmp-row:hover {
    background: var(--bg-input);
}

.cmp-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cmp-icon {
    font-size: 20px;
    color: var(--text-muted);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-input);
}

.cmp-row.cmp-positive .cmp-icon {
    color: #09331a;
    background: #dcfce7;
}

.cmp-row.cmp-negative .cmp-icon {
    color: #ef4444;
    background: #fee2e2;
}

.cmp-row-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.cmp-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.cmp-values {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.cmp-row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
}

.cmp-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.cmp-badge.cmp-positive {
    background: #dcfce7;
    color: #09331a;
}

.cmp-badge.cmp-negative {
    background: #fee2e2;
    color: #ef4444;
}

.cmp-badge.cmp-neutral {
    background: var(--bg-input);
    color: var(--text-muted);
}

.cmp-message {
    font-size: 0.7rem;
    color: var(--text-secondary);
    max-width: 200px;
    text-align: right;
}

.cmp-row.cmp-positive .cmp-message {
    color: #09331a;
}

.cmp-row.cmp-negative .cmp-message {
    color: #ef4444;
}

/* ============ CONFIGURACIÓN PAGE ============ */
.config-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
}

.config-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.config-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.config-card-header-row .config-card-title {
    margin-bottom: 0;
}

.config-btn-sm {
    padding: 6px 14px !important;
    font-size: 0.82rem !important;
}

/* Photo row */
.config-photo-row {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-lg);
}

.config-photo-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

.config-photo-avatar span {
    font-size: 28px;
}

.config-photo-label {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.config-photo-actions {
    display: flex;
    gap: var(--space-sm);
}

.config-btn-outline {
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.config-btn-outline:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.config-btn-solid {
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.config-btn-solid:hover {
    opacity: 0.85;
}

/* Field rows */
.config-field-row {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-light);
}

.config-field-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.config-field-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.88rem;
    transition: border-color var(--transition-fast);
}

.config-field-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.config-btn-password {
    flex: 1;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--text-primary);
    color: var(--bg-card);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.config-btn-password:hover {
    opacity: 0.85;
}

.config-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Category list */
.config-cat-list {
    display: flex;
    flex-direction: column;
}

.config-cat-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.config-cat-item:last-child {
    border-bottom: none;
}

.config-cat-item:hover {
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
}

.config-cat-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.config-cat-name {
    flex: 1;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-primary);
}

.config-cat-actions {
    display: flex;
    gap: 4px;
}

/* Danger zone */
.config-danger-card {
    border-color: var(--danger);
    border-style: dashed;
}

.config-danger-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
}

.config-danger-row strong {
    font-size: 0.92rem;
    color: var(--text-primary);
}

.config-danger-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.config-btn-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.config-btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
    .config-field-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .config-field-label {
        width: auto;
    }

    .config-photo-row {
        flex-wrap: wrap;
    }

    .config-danger-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========================================
   Enhanced Mobile Responsive (All Pages)
   ======================================== */
@media (max-width: 768px) {

    /* -- Global -- */
    .dashboard {
        padding: var(--space-sm);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .section-title {
        font-size: 1.15rem;
    }

    /* -- Indicadores -- */
    .ind-card {
        padding: var(--space-md);
        overflow: hidden;
    }

    .ind-bars-chart {
        gap: var(--space-md);
        padding: var(--space-md) var(--space-xs);
        min-height: 200px;
    }

    .ind-bar-wrapper {
        width: 36px;
        height: 120px;
    }

    .ind-bar-value {
        font-size: 0.72rem;
    }

    .ind-bar-label {
        font-size: 0.55rem;
    }

    .ind-chart-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ind-summary-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .ind-annual-row {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .ind-annual-value {
        font-size: 0.92rem;
    }

    /* -- Educación -- */
    .edu-tabs {
        gap: 6px;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .edu-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .edu-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .edu-featured-card {
        flex-direction: column;
        padding: 16px;
        gap: 12px;
    }

    .edu-featured-icon {
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    .edu-featured-title {
        font-size: 1rem;
        word-break: break-word;
    }

    .edu-featured-desc {
        font-size: 0.82rem;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
    }

    .edu-article-card {
        border-radius: var(--radius-md);
    }

    .edu-article-body {
        padding: var(--space-md);
    }

    .edu-article-title {
        font-size: 0.92rem;
        word-break: break-word;
    }

    .edu-search-bar {
        margin-bottom: var(--space-md);
    }

    .edu-drawer {
        width: 100%;
    }

    /* -- Mercado -- */
    .merc-spending-card {
        padding: var(--space-md);
    }

    .merc-spending-top {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .merc-counters {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-sm);
    }

    .merc-counter-card {
        padding: var(--space-sm) var(--space-md);
        flex-direction: column;
        text-align: center;
        gap: var(--space-xs);
    }

    .merc-counter-value {
        font-size: 1.2rem;
    }

    .merc-counter-label {
        font-size: 0.7rem;
    }

    .merc-list-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .merc-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .merc-tab {
        white-space: nowrap;
        font-size: 0.82rem;
    }

    .merc-spending-chart {
        max-width: 100%;
        overflow-x: auto;
    }

    /* -- Endeudamiento -- */
    .end-grid {
        grid-template-columns: 1fr;
    }

    .end-card {
        padding: var(--space-md);
    }

    .end-debt-info {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .end-progress-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }

    /* -- Control Financiero -- */
    .cf-table-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    .cf-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cf-tab {
        white-space: nowrap;
        font-size: 0.82rem;
    }

    /* -- Metas Financieras -- */
    .metas-grid {
        grid-template-columns: 1fr;
    }

    /* -- Modal -- */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        padding: var(--space-md);
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-right {
        gap: var(--space-sm);
    }

    .merc-counters {
        grid-template-columns: 1fr;
    }

    .ind-summary-grid {
        grid-template-columns: 1fr;
    }

    .edu-featured-card {
        flex-direction: column;
    }

    .edu-featured-icon {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
}