/* CSS Variables */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    --bg-color: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-navbar: #ffffff;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    --sidebar-width: 250px;
    --navbar-height: 64px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Body scroll lock when mobile menu is open */
body.menu-open {
    overflow: hidden;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    height: var(--navbar-height);
    background-color: var(--bg-navbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-sizing: border-box;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-brand .logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Conversion info in forms */
.conversion-info {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.conversion-info p {
    margin: 4px 0;
    color: var(--text-secondary);
}

.conversion-info strong {
    color: var(--primary-color);
    font-size: 1rem;
}

.conversion-info .error-text {
    color: var(--danger-color);
    font-weight: 600;
}

.conversion-info .info-text {
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Multi-currency amounts in tables */
.multi-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.original-amount {
    font-weight: 600;
}

.converted-amount {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

/* User Menu Dropdown */
.user-menu-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.user-menu-trigger {
    background: transparent;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: color 0.2s ease;
    border-radius: 6px;
}

.user-menu-trigger:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.user-menu-trigger:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.user-menu-trigger svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.user-menu-trigger[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 240px;
    overflow: hidden;
}

.user-menu-dropdown.hidden {
    display: none;
}

.menu-section {
    padding: 0;
}

.menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.menu-item:hover {
    background-color: var(--bg-color);
}

.menu-item:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: -2px;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    stroke: currentColor;
    flex-shrink: 0;
}

.menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0;
}

/* Toggle Switch in Menu */
.toggle-item {
    justify-content: space-between;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px; /* Ancho ajustado */
    height: 24px; /* Alto ajustado */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px; /* Alto del "pulgar" */
    width: 16px;  /* Ancho del "pulgar" */
    left: 4px;   /* Posición inicial */
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

input:focus + .toggle-slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .toggle-slider:before {
    -webkit-transform: translateX(16px);
    -ms-transform: translateX(16px);
    transform: translateX(16px);
}


/* Logout item styling */
.logout-item {
    color: var(--danger-color);
}

.logout-item:hover {
    background-color: rgba(239, 68, 68, 0.05);
}

/* Email verification banner */
.email-verify-banner {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 99;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    animation: slideDown 0.3s ease;
}

.email-verify-banner .banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
}

.email-verify-banner .banner-icon {
    font-size: 1.25rem;
}

.email-verify-banner .banner-text {
    font-size: 0.9375rem;
    font-weight: 500;
}

.email-verify-banner .btn-banner {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 16px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.email-verify-banner .btn-banner:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.email-verify-banner .btn-banner:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.email-verify-banner .btn-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
    line-height: 1;
}

.email-verify-banner .btn-banner-close:hover {
    opacity: 1;
}

/* Adjust app container when banner is visible */
.app-container.with-banner {
    padding-top: calc(var(--navbar-height) + 48px);
}

.sidebar.with-banner {
    top: calc(var(--navbar-height) + 48px);
}

@media (max-width: 768px) {
    .email-verify-banner {
        padding: 10px 16px;
        gap: 8px;
    }

    .email-verify-banner .banner-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    .email-verify-banner .banner-text {
        font-size: 0.8125rem;
    }

    .email-verify-banner .btn-banner {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .app-container.with-banner {
        padding-top: calc(var(--navbar-height) + 70px);
    }
}

/* Menu toggle (hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Hamburger animation when active */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* App container */
.app-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--navbar-height);
    max-width: 100%;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--navbar-height);
    bottom: 0;
    width: var(--sidebar-width);
    max-width: 100vw;
    background-color: var(--bg-sidebar);
    padding: 24px 0;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Sidebar user info (visible on mobile) */
.sidebar-user-info {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    color: var(--text-light);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
}

.nav-item.active {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.nav-icon {
    font-size: 1.25rem;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--navbar-height));
    max-width: 100%;
    overflow-x: hidden;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-white);
}

.btn-danger {
    background-color: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

.btn-danger:hover {
    background-color: var(--danger-color);
    color: var(--text-white);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-color);
}

.btn-clear {
    background-color: #e2e8f0;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-clear:hover {
    background-color: #cbd5e1;
    color: var(--text-primary);
}

/* Social share buttons */
.btn-whatsapp {
    background-color: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
}

.btn-twitter {
    background-color: #1DA1F2;
    color: white;
}

.btn-twitter:hover {
    background-color: #0d8bd9;
}

.btn-facebook {
    background-color: #1877F2;
    color: white;
}

.btn-facebook:hover {
    background-color: #0d65d9;
}

.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* Specific layout adjustments for dashboard cards */
#budget-card-container {
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    min-height: 300px; /* Prevents layout shift on chart reload */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Source Badges */
.source-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.source-badge.mercadopago {
    background-color: rgba(0, 158, 227, 0.1);
    color: #009EE3;
    border: 1px solid rgba(0, 158, 227, 0.4);
}

/* Expense Type Badges */
.badge-type-fijo {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-type-variable {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tr:hover {
    background-color: var(--bg-color);
}

/* News System (Side Panel estilo Slack) */
.news-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.news-overlay.active {
    opacity: 1;
    visibility: visible;
}

.news-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 90%;
    height: 100%;
    background: var(--bg-card);
    z-index: 1201;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-panel.active {
    right: 0;
}

.news-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

#news-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 5px;
    line-height: 1;
}

.news-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.news-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.news-item {
    margin-bottom: 32px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 24px;
}

.news-item:last-child {
    border-bottom: none;
}

.news-version {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.news-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.news-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-feature {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.news-feature-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.news-feature-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.news-feature-text b {
    color: var(--primary-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toasts */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    color: var(--text-white);
    font-size: 0.875rem;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: calc(100vw - 48px);
    box-sizing: border-box;
}

.toast.success {
    background-color: var(--success-color);
}

.toast.error {
    background-color: var(--danger-color);
}

.toast.info {
    background-color: var(--info-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Confirm Toast */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease;
}

.confirm-toast {
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 380px;
    margin: 16px;
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

.confirm-content {
    padding: 32px 24px 24px 24px;
    text-align: center;
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: rgba(239, 68, 68, 0.1);
    border-radius: 50%;
    font-size: 30px;
    margin-bottom: 20px;
    animation: pulseRed 2s infinite;
}

@keyframes pulseRed {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.confirm-message {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.5;
    margin: 0;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px 24px;
}

.btn-confirm {
    flex: 1;
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background-color: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-cancel:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-ok {
    background-color: #ef4444;
    color: white;
}

.btn-ok:hover {
    background-color: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-ok:active {
    transform: translateY(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    box-sizing: border-box;
}

.modal {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-content {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.badge-primary {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Color dot for categories */
.color-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

/* Amount formatting */
.amount {
    font-weight: 600;
    font-family: 'SF Mono', Monaco, monospace;
}

.amount-positive {
    color: var(--success-color);
}

.amount-negative {
    color: var(--danger-color);
}

/* Grid */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Responsive */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Show hamburger menu */
    .menu-toggle {
        display: flex;
    }

    /* Sidebar as overlay on mobile - hidden by default but NOT using display:none */
    .sidebar:not(.hidden) {
        display: block;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 99;
        width: 80vw;
        max-width: 300px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Overlay behind sidebar */
    .sidebar-overlay {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100vw;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 98;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        box-sizing: border-box;
    }

    .sidebar-overlay.visible {
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0;
        padding: 16px;
        width: 100%;
        max-width: 100vw;
        box-sizing: border-box;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Adjust navbar for mobile */
    .navbar {
        padding: 0 16px;
    }

    .navbar-brand .logo {
        font-size: 1rem;
    }

    .user-info {
        display: none;
    }

    /* Show user info in sidebar on mobile */
    .sidebar-user-info {
        display: flex;
    }

    /* Adjust page header for mobile */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-title {
        font-size: 1.25rem;
    }

    /* Adjust filters for mobile */
    .filters-bar {
        flex-direction: column;
    }

    .filters-bar .form-group {
        width: 100%;
    }

    /* Tables scroll horizontally */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    /* Action buttons stack on mobile */
    .action-buttons {
        flex-direction: column;
        gap: 4px;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Modal full width on mobile */
    .modal {
        max-width: 100%;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }

    /* Budget specific adjustments for mobile */
    .budget-item {
        flex-wrap: wrap; /* Allow items to wrap to the next line */
    }

    .budget-input-wrapper {
        display: flex;
        align-items: center;
        border: 1px solid var(--border-color);
        background-color: var(--bg-card);
        border-radius: var(--border-radius);
        padding: 10px 12px; /* Añadir padding al wrapper */
        /* margin-left: auto; */ /* Ya no es necesario si se busca consistencia visual */
    }

    .budget-input-wrapper span {
        color: var(--text-primary); /* Asegurar que el símbolo del dólar tenga un color claro */
        margin-right: 4px; /* Espacio entre el símbolo y el input */
    }

    .budget-input {
        border: none;
        background-color: transparent;
        padding: 0;
        flex-grow: 1; /* Ocupa el espacio restante en el wrapper */
        /* width: 90px; */ /* Eliminado */
    }
}

/* Filters bar */
.filters-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filters-bar .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

/* Action buttons in tables */
.action-buttons {
    display: flex;
    gap: 8px;
}

/* Footer */
.app-footer {
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    padding: 32px 24px 16px 24px;
}

/* Sección de donación - destacada */
.footer-donation {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.04));
    border-top: 1px solid rgba(99, 102, 241, 0.15);
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    padding: 24px;
    text-align: center;
    margin: 0 -24px 24px -24px;
}

.footer-donation-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 8px;
}

.footer-donation-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.btn-cafecito {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #FFDD00;
    color: #1e293b;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(255, 221, 0, 0.3);
}

.btn-cafecito:hover {
    background-color: #FFEA5F;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
}

.btn-cafecito:active {
    transform: translateY(0);
}

/* Sección legal - discreta */
.footer-legal {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-legal p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    opacity: 0.7;
}

.footer-legal a {
    color: var(--text-light);
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-legal a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Footer mobile */
@media (max-width: 768px) {
    .app-footer {
        padding: 24px 16px 16px 16px;
    }

    .footer-donation {
        padding: 20px 16px;
        margin: 0 -16px 24px -16px;
    }

    .footer-donation-heading {
        font-size: 0.9375rem;
    }

    .footer-donation-text {
        font-size: 0.8125rem;
    }

    .btn-cafecito {
        padding: 10px 20px;
        font-size: 0.875rem;
    }
}

/* Speed Dial FAB */
.speed-dial-container {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.speed-dial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 94;
}

.quick-add-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    border: none;
    font-size: 2rem;
    font-weight: 300;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-add-fab .fab-icon {
    transition: transform 0.3s ease;
    line-height: 1;
}

.quick-add-fab.open .fab-icon {
    transform: rotate(45deg);
}

.quick-add-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.quick-add-fab:active {
    transform: scale(0.95);
}

/* Speed Dial Options */
.speed-dial-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.speed-dial-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    min-width: 120px;
    border-radius: 24px;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    animation: slideUp 0.2s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.speed-dial-btn:nth-child(1) { animation-delay: 0.05s; }
.speed-dial-btn:nth-child(2) { animation-delay: 0s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.speed-dial-btn.expense {
    background-color: #fef2f2;
    color: #dc2626;
}

.speed-dial-btn.expense:hover {
    background-color: #fee2e2;
    transform: scale(1.05);
}

.speed-dial-btn.income {
    background-color: #ecfdf5;
    color: #059669;
}

.speed-dial-btn.income:hover {
    background-color: #d1fae5;
    transform: scale(1.05);
}

.speed-dial-icon {
    font-size: 1.25rem;
}

.speed-dial-label {
    white-space: nowrap;
}

/* Feedback Widget - FAB (Floating Action Button) */
.feedback-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feedback-fab:hover {
    background-color: var(--primary-hover);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.5);
}

.feedback-fab:active {
    transform: scale(0.95);
}

/* Feedback Modal Overlay */
.feedback-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    padding: 16px;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease;
}

/* Feedback Modal */
.feedback-modal {
    background-color: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

/* Modal Header */
.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.feedback-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.feedback-modal-close {
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.feedback-modal-close:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.feedback-modal-close:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Modal Content */
.feedback-modal-content {
    padding: 24px;
}

/* Modal Actions */
.feedback-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.feedback-modal-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Button with spinner */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .speed-dial-container {
        bottom: 84px;
        right: 20px;
    }

    .quick-add-fab {
        width: 52px;
        height: 52px;
        font-size: 1.75rem;
    }

    .speed-dial-btn {
        padding: 8px 14px 8px 10px;
        font-size: 0.875rem;
    }

    .feedback-fab {
        width: 52px;
        height: 52px;
        bottom: 20px;
        right: 20px;
        font-size: 1.375rem;
    }

    .feedback-modal {
        max-width: 100%;
        border-radius: 12px;
        max-height: calc(100vh - 32px);
    }

    .feedback-modal-header {
        padding: 16px 20px;
    }

    .feedback-modal-header h3 {
        font-size: 1.125rem;
    }

    .feedback-modal-content {
        padding: 20px;
    }

    .feedback-modal-actions {
        flex-direction: column;
    }

    .feedback-modal-actions .btn {
        width: 100%;
    }
}

/* Cuando el modal está abierto, ocultar el FAB para evitar confusión */
.feedback-modal-overlay:not(.hidden) ~ .feedback-fab {
    opacity: 0;
    pointer-events: none;
}

/* Family Members Activity Styles */

.members-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.members-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.activity-period {
    font-size: 0.75rem;
    color: var(--text-light);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.member-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 500;
    font-size: 0.9375rem;
}

.member-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-you {
    background-color: var(--success-color);
    color: white;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.member-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.activity-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.activity-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-indicator.active {
    background-color: var(--success-color);
}

.activity-indicator.inactive {
    background-color: var(--danger-color);
}

.family-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tip-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Responsive family members */
@media (max-width: 480px) {
    .member-item {
        padding: 10px;
        gap: 10px;
    }

    .member-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.75rem;
    }

    .member-name {
        font-size: 0.875rem;
    }

    .badge-you,
    .badge-primary {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .activity-count {
        font-size: 0.75rem;
    }

    .activity-indicator {
        width: 8px;
        height: 8px;
    }

    .family-tip {
        padding: 10px 12px;
    }

    .tip-text {
        font-size: 0.8125rem;
    }
}

/* danger text link */
.danger-text-link {
    color: var(--danger-color);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, text-decoration 0.2s ease;
    display: inline-block;
}

.danger-text-link:hover {
    text-decoration: underline;
    color: #dc2626; /* A slightly darker red for hover */
}

/* Onboarding Styles */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.onboarding-overlay.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.onboarding-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    padding: 32px;
    text-align: center;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.onboarding-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.onboarding-progress-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.onboarding-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.onboarding-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.onboarding-text {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.onboarding-text.secondary {
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.onboarding-text strong {
    color: var(--primary-color);
}

.onboarding-btn {
    padding: 16px 48px;
    font-size: 1.125rem;
}

.onboarding-form {
    text-align: left;
    margin-top: 20px;
}

.onboarding-form-row {
    margin-bottom: 16px;
}

.onboarding-form-row.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* News System Styles */
.news-fab {
    position: fixed;
    bottom: 24px;
    right: 96px; /* A la izquierda del feedback fab */
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bg-card);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    background-color: var(--primary-color);
    color: white;
}

.news-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: var(--danger-color);
    border: 2px solid white;
    border-radius: 50%;
}

.news-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.news-overlay.active {
    opacity: 1;
    visibility: visible;
}

.news-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background-color: var(--bg-card);
    z-index: 1001;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-panel.active {
    right: 0;
}

.news-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.news-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.news-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.news-item {
    margin-bottom: 32px;
}

.news-version {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.news-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.news-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-feature {
    display: flex;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.news-feature-icon {
    font-size: 1.25rem;
}

.news-feature-text {
    font-size: 0.875rem;
    line-height: 1.4;
}

.news-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .news-fab {
        right: 84px;
        bottom: 20px;
        width: 52px;
        height: 52px;
    }
    
    .news-panel {
        width: 100%;
        right: -100%;
    }
}

.onboarding-form .form-input,
.onboarding-form .form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
}

.onboarding-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.onboarding-buttons .btn {
    flex: 1;
    padding: 14px;
}

.onboarding-code {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f1f5f9;
    padding: 16px 24px;
    border-radius: 12px;
    margin: 20px 0;
}

.onboarding-code span {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary-color);
    font-family: monospace;
}

/* Responsive onboarding */
@media (max-width: 480px) {
    .onboarding-modal {
        padding: 24px 20px;
    }

    .onboarding-icon {
        font-size: 3rem;
    }

    .onboarding-title {
        font-size: 1.25rem;
    }

    .onboarding-text {
        font-size: 0.9375rem;
    }

    .onboarding-form-row.two-cols {
        grid-template-columns: 1fr;
    }

    .onboarding-buttons {
        flex-direction: column;
    }

    .onboarding-code {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===========================================
   Family Members Activity Styles
   =========================================== */

.members-activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.members-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.activity-period {
    font-size: 0.75rem;
    color: var(--text-light);
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
}

.member-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.member-info {
    flex: 1;
    min-width: 0;
}

.member-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-weight: 500;
    font-size: 0.9375rem;
}

.member-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-you {
    background-color: var(--success-color);
    color: white;
    font-size: 0.6875rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.member-activity {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.activity-count {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.activity-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-indicator.active {
    background-color: var(--success-color);
}

.activity-indicator.inactive {
    background-color: var(--danger-color);
}

.family-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.tip-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.tip-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Responsive family members */
@media (max-width: 480px) {
    .member-item {
        padding: 10px;
        gap: 10px;
    }

    .member-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.75rem;
    }

    .member-name {
        font-size: 0.875rem;
    }

    .badge-you,
    .badge-primary {
        font-size: 0.625rem;
        padding: 2px 6px;
    }

    .activity-count {
        font-size: 0.75rem;
    }

    .activity-indicator {
        width: 8px;
        height: 8px;
    }

    .family-tip {
        padding: 10px 12px;
    }

    .tip-text {
        font-size: 0.8125rem;
    }
}
/* Empty description placeholder */
.empty-description {
    color: var(--text-light);
    font-style: italic;
    font-size: 0.875rem;
}

/* Budget Summary Card Styles */
.budget-summary-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.budget-summary-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.budget-category-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.budget-category-info .category-icon {
    font-size: 1.1rem;
}

.budget-amounts {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.spent-amount {
    font-weight: 600;
    color: var(--text-primary);
}

.budget-target {
    color: var(--text-secondary);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease-out;
}

.budget-remaining {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Budget Management Styles */
.budget-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.budget-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 12px;
}

.budget-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    flex: 1; /* Allows the label to take up available space */
    min-width: 0; /* Important for flexbox truncation */
    cursor: pointer;
}

.budget-category-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.budget-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* Adjusted gap */
    background-color: var(--bg-color); /* Added background color */
    border: 1px solid var(--border-color); /* Added border */
    border-radius: var(--border-radius); /* Added border radius */
    padding: 0 12px; /* Added padding */
    color: var(--text-secondary);
}

.budget-input-wrapper:focus-within {
    border-color: var(--primary-color);
}

.budget-input-wrapper span {
    color: var(--text-secondary);
}

.budget-input {
    border: none !important; /* Ensure no border on the input itself */
    padding: 10px 0 !important; /* Reset padding */
    width: 100px; /* Reduced width to 100px */
    max-width: 120px; /* Added max-width for flexibility */
    background-color: transparent !important; /* Ensure transparent background */
    text-align: right;
    font-size: 0.9375rem; /* Ensure consistent font size */
}

.budget-input:focus {
    outline: none !important;
}

/* ===========================================
   PWA Install Card (Modern UI)
   =========================================== */
.pwa-install-card {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 16px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

.pwa-install-card.hidden {
    display: none;
    opacity: 0;
    transform: translate(-50%, 40px);
}

.pwa-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.pwa-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #818cf8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.pwa-card-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.pwa-card-text {
    flex: 1;
}

.pwa-card-text h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pwa-card-text p {
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.pwa-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-card-actions .btn {
    white-space: nowrap;
    border-radius: 10px;
    font-weight: 600;
}

.btn-icon-close {
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-close:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, 40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

/* Ajustes para móviles */
@media (max-width: 480px) {
    .pwa-install-card {
        bottom: 16px;
        width: calc(100% - 32px);
        padding: 14px;
    }
    
    .pwa-card-icon {
        width: 48px;
        height: 48px;
    }
    
    .pwa-card-icon img {
        width: 32px;
        height: 32px;
    }
    
    .pwa-card-text h4 {
        font-size: 0.9375rem;
    }
    
    .pwa-card-text p {
        font-size: 0.75rem;
    }
}

 / *   = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
       U s e r   M e n u   D r o p d o w n   I m p r o v e m e n t s 
       = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =   * / 
 . u s e r - m e n u - d r o p d o w n   { 
         p o s i t i o n :   a b s o l u t e ; 
         t o p :   c a l c ( 1 0 0 %   +   8 p x ) ; 
         r i g h t :   0 ; 
         w i d t h :   2 2 0 p x ; 
         b a c k g r o u n d - c o l o r :   v a r ( - - c a r d - b g ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
         b o r d e r - r a d i u s :   v a r ( - - b o r d e r - r a d i u s ) ; 
         b o x - s h a d o w :   v a r ( - - s h a d o w - l g ) ; 
         z - i n d e x :   1 0 0 0 ; 
         p a d d i n g :   8 p x   0 ; 
         t r a n s f o r m - o r i g i n :   t o p   r i g h t ; 
         a n i m a t i o n :   d r o p d o w n F a d e   0 . 2 s   e a s e - o u t ; 
 } 
 
 @ k e y f r a m e s   d r o p d o w n F a d e   { 
         f r o m   {   o p a c i t y :   0 ;   t r a n s f o r m :   s c a l e ( 0 . 9 5 ) ;   } 
         t o   {   o p a c i t y :   1 ;   t r a n s f o r m :   s c a l e ( 1 ) ;   } 
 } 
 
 . m e n u - i t e m   { 
         w i d t h :   1 0 0 % ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         p a d d i n g :   1 0 p x   1 6 p x ; 
         b a c k g r o u n d :   n o n e ; 
         b o r d e r :   n o n e ; 
         c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
         f o n t - s i z e :   0 . 9 r e m ; 
         c u r s o r :   p o i n t e r ; 
         t r a n s i t i o n :   b a c k g r o u n d - c o l o r   0 . 2 s ; 
         t e x t - a l i g n :   l e f t ; 
 } 
 
 . m e n u - i t e m : h o v e r   { 
         b a c k g r o u n d - c o l o r :   v a r ( - - b g - s e c o n d a r y ) ; 
 } 
 
 . m e n u - i t e m   s v g   { 
         m a r g i n - r i g h t :   1 2 p x ; 
         c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
         f l e x - s h r i n k :   0 ; 
         d i s p l a y :   b l o c k ; 
 } 
 
 . t o g g l e - i t e m   { 
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
 } 
 
 . t o g g l e - l a b e l   { 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   1 2 p x ; 
 } 
 
 . t o g g l e - l a b e l   s v g   { 
         m a r g i n - r i g h t :   0 ;   / *   Y a   m a n e j a d o   p o r   e l   g a p   * / 
 } 
 
 
 / *   A j u s t e   d e   e s p a c i a d o   f i n o   p a r a   e l   m e n �   * / 
 . m e n u - i t e m   s v g   { 
         m a r g i n - r i g h t :   8 p x   ! i m p o r t a n t ; 
 } 
 . t o g g l e - l a b e l   { 
         g a p :   8 p x   ! i m p o r t a n t ; 
 } 
 
 
 / *   C o r r e c c i � n   f i n a l   d e   e s t i l o s   p a r a   e l   m e n �   d e   u s u a r i o   * / 
 . m e n u - i t e m   { 
         g a p :   8 p x   ! i m p o r t a n t ;   / *   E s p a c i o   f i j o   y   c o n t r o l a d o   * / 
 } 
 
 . m e n u - i t e m   s v g   { 
         m a r g i n - r i g h t :   0   ! i m p o r t a n t ;   / *   E l i m i n a   m a r g e n   v i e j o   p a r a   u s a r   s o l o   e l   g a p   * / 
         w i d t h :   1 8 p x ; 
         h e i g h t :   1 8 p x ; 
 } 
 
 . t o g g l e - l a b e l   { 
         g a p :   8 p x   ! i m p o r t a n t ; 
 } 
 
 

/* ===========================================
   User Menu & Integrations UI
   =========================================== */
.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    padding: 8px 0;
    transform-origin: top right;
    animation: dropdownFade 0.2s ease-out;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.menu-item {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 10px 16px !important;
    background: none !important;
    border: none !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
    cursor: pointer !important;
    transition: background-color 0.2s !important;
    gap: 10px !important;
}

.menu-item:hover {
    background-color: var(--bg-secondary) !important;
}

.menu-item svg {
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0 !important;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* Source Badges (Mercado Pago, etc.) */
.source-badge {
    display: inline-block !important;
    background-color: #009ee3 !important; /* Azul MP */
    color: white !important;
    font-size: 10px !important;
    font-weight: bold !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    margin-right: 8px !important;
    text-transform: uppercase !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

.source-badge.mercadopago {
    background-color: #009ee3 !important;
}


 / *   T a b l e   C o l u m n   W i d t h   F i x e s   * / 
 . c o l - d a t e   {   w i d t h :   1 2 0 p x   ! i m p o r t a n t ;   w h i t e - s p a c e :   n o w r a p ;   } 
 . c o l - d e s c r i p t i o n   {   w i d t h :   a u t o   ! i m p o r t a n t ;   } 
 . c o l - c a t e g o r y   {   w i d t h :   2 0 0 p x   ! i m p o r t a n t ;   } 
 . c o l - t y p e   {   w i d t h :   1 0 0 p x   ! i m p o r t a n t ;   t e x t - a l i g n :   c e n t e r ;   } 
 . c o l - a m o u n t   {   w i d t h :   1 3 0 p x   ! i m p o r t a n t ;   } 
 . c o l - a c t i o n s   {   w i d t h :   1 0 0 p x   ! i m p o r t a n t ;   } 
 
 / *   F o r c e   t a b l e   l a y o u t   t o   r e s p e c t   w i d t h s   * / 
 . t a b l e   { 
         t a b l e - l a y o u t :   a u t o ; 
         w i d t h :   1 0 0 % ; 
 } 
 
 
 / *   A j u s t e   d e   a n c h o   p a r a   b o t o n e s   c o n   t e x t o   * / 
 . c o l - a c t i o n s   {   w i d t h :   1 8 0 p x   ! i m p o r t a n t ;   } 
 . a c t i o n - b u t t o n s   { 
         d i s p l a y :   f l e x ; 
         g a p :   4 p x ; 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
 } 
 
 
/* Table Improvements: Compact columns and stacked buttons */
.col-date { width: 100px !important; }
.col-description { width: auto !important; }
.col-category { width: 180px !important; }
.col-type { width: 150px !important; }

/* Budget Modern UI */
.budgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.budget-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.budget-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.budget-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.budget-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.budget-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.budget-card-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

.budget-card-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.budget-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.budget-input-group span {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.budget-card-input {
    width: 120px;
    padding: 8px 8px 8px 24px !important;
    text-align: right;
    font-weight: 700;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
}

.budget-card-progress {
    margin-top: 4px;
}

.budget-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.budget-progress-bar {
    height: 8px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.budget-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.budget-status-text {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.budget-status-text.warning { color: var(--warning-color); }
.budget-status-text.danger { color: var(--danger-color); }
.budget-status-text.success { color: var(--success-color); }

@media (max-width: 768px) {
    .budgets-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer & Donation Section */
.app-footer {
    background-color: var(--bg-sidebar);
    color: var(--text-light);
    padding: 32px 24px 16px 24px;
    margin-top: 40px;
}

.footer-donation {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.04));
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 24px;
    text-align: center;
    margin: 0 -24px 24px -24px;
}

.footer-donation-heading {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-white);
    margin-bottom: 8px;
}

.footer-donation-text {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.btn-cafecito {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #FFDD00;
    color: #1e293b;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    margin: 0 auto;
}

.btn-cafecito:hover {
    background-color: #FFEA5F;
    transform: scale(1.05);
}

.footer-legal {
    text-align: center;
    padding-top: 16px;
    opacity: 0.7;
    font-size: 0.75rem;
}

.footer-legal a {
    color: inherit;
    text-decoration: none;
}

.col-amount { width: 120px !important; }
.col-actions { width: 110px !important; }

.action-buttons {
    display: flex !important;
    flex-direction: column !important; /* APILAR VERTICALMENTE */
    gap: 4px !important;
    align-items: stretch !important;
}

.action-buttons .btn {
    width: 100% !important;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    justify-content: center !important;
}


 / *   A j u s t e s   e s p e c � f i c o s   p a r a   l a   t a b l a   d e   i n g r e s o s   * / 
 . c o l - t y p e   {   w i d t h :   1 5 0 p x   ! i m p o r t a n t ;   } 
 
 