:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary: #0d9488;
    /* Teal */
    --primary-hover: #115e59;
    --expense: #ef4444;
    /* Red */
    --expense-hover: #b91c1c;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --font-family: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

select option {
    background-color: var(--card-bg);
    color: var(--text-main);
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    height: 100vh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* Prevent scroll on body, handle within containers if needed */
}

.app-container {
    width: 100%;
    max-width: 600px;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
}

header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 1rem;
}

header h1 {
    font-weight: 600;
    font-size: 1.75rem;
    background: linear-gradient(to right, #2dd4bf, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.balance-container {
    text-align: center;
    margin-bottom: 2rem;
}

.balance-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

#balance-amount {
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -1px;
}

.main-actions {
    position: fixed;
    bottom: 2rem;
    left: auto;
    right: 1.5rem;
    width: auto;
    display: flex;
    flex-direction: row;
    /* Horizontal */
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
    z-index: 40;
    pointer-events: none;
}

.action-btn {
    pointer-events: auto;
    /* Re-enable clicks on buttons */
}

/* History Section */
.history-section {
    width: 100%;
    margin-top: 1rem;
    flex: 1;
    padding-bottom: 10rem;
    /* Reduced since buttons are on the side */
}

.history-section h3 {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    text-align: center;
}

.transaction-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.transaction-table th,
.transaction-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.transaction-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.transaction-table select {
    background: transparent;
    color: white;
    border: none;
}

.text-income {
    color: var(--primary);
}

.text-expense {
    color: var(--expense);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-bottom: 1rem;
}

.page-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-delete-row {
    background: none;
    border: none;
    color: var(--expense);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.btn-delete-row:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    /* Softer shadow but visible */
    pointer-events: auto;
}

.action-btn svg {
    width: 28px;
    height: 28px;
}

.action-btn:active {
    transform: scale(0.9);
}

.income {
    background: linear-gradient(135deg, #0d9488, #2dd4bf);
    color: white;
    box-shadow: 0 0 20px rgba(13, 148, 136, 0.4);
}

.expense {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: white;
    box-shadow: 0 0 20px rgba(185, 28, 28, 0.4);
}

.action-btn.delete {
    background-color: #3b82f6;
    /* Blue */
    color: white;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker overlay */
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Align to top */
    padding-top: 5rem;
    /* Space from top */
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal {
    background-color: var(--card-bg);
    width: 90%;
    max-width: 340px;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.hidden .modal {
    transform: translateY(-20px);
    /* Slide up when hiding */
}

.modal-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-main);
}

.input-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group input {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.5rem;
    /* Large text for numbers */
    color: var(--text-main);
    text-align: center;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    font-family: var(--font-family);
}

.input-group input:focus {
    border-color: var(--primary);
}

#input-egreso-concepto {
    font-size: 1rem;
    text-align: left;
}

/* Compact inputs for Credit Modal */
#modal-credito .input-group input,
#modal-credito .input-group select {
    padding: 0.75rem;
    font-size: 1.1rem;
    border-radius: 10px;
}

#modal-credito .input-group {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

button.btn-primary,
button.btn-secondary {
    flex: 1;
    padding: 0.75rem;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 0.95rem;
}

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Install Prompt */
.install-prompt {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    z-index: 50;
    transition: all 0.3s ease;
}

.install-prompt.hidden {
    transform: translate(-50%, 100%);
    opacity: 0;
    pointer-events: none;
}

.install-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.install-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.install-text strong {
    font-size: 0.9rem;
}

.install-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.install-btn {
    background-color: var(--text-main);
    color: var(--bg-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.close-install-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0 0.25rem;
}

/* Header Update */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding-top: 1rem;
    position: relative;
}

.header-title {
    flex: 1;
    text-align: center;
    /* Center title but account for button space if needed */
    margin-right: 40px;
    /* Balance the left button */
}

/* Icon Buttons */
.icon-btn {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Sidebar Menu */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: var(--card-bg);
    z-index: 101;
    transform: translateX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

/* Business Links */
.business-link {
    display: block;
    /* Full width */
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.business-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    transform: translateX(4px);
}

.business-link.active {
    background: var(--primary);
    /* Highlight active business */
    color: white;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

/* App Navigation Tabs */
.app-tabs {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 1rem;
    z-index: 50;
    backdrop-filter: blur(10px);
}

.tab-link,
.admin-tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
}

.tab-link svg,
.admin-tab-link svg {
    width: 24px;
    height: 24px;
}

.tab-link.active,
.admin-tab-link.active {
    color: var(--primary);
}

.tab-link:hover,
.admin-tab-link:hover {
    color: var(--text-main);
}

/* App Views */
.app-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal .hidden,
.app-view.hidden,
.app-tabs.hidden,
.loading-container.hidden,
.summary-sub-view.hidden {
    display: none !important;
}

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

/* General Balance Grid */
.general-balance-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1rem;
    padding-bottom: 5rem;
}

#view-general .general-balance-grid {
    grid-template-columns: repeat(2, 1fr);
    padding-bottom: 15rem;
    margin-bottom: 5rem;
}

.balance-card {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s;
}

.balance-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.balance-card .btn-delete-asset,
.balance-card .btn-delete-pasivo {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--expense);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.balance-card .btn-delete-asset:hover,
.balance-card .btn-delete-pasivo:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.balance-card .btn-delete-asset:active,
.balance-card .btn-delete-pasivo:active {
    transform: scale(0.9);
}

.balance-card .btn-delete-asset svg,
.balance-card .btn-delete-pasivo svg {
    width: 14px;
    height: 14px;
}

.balance-card.total {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.1), rgba(167, 139, 250, 0.1));
    border-color: var(--primary);
    grid-column: span 2;
}

.card-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.card-amount {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
}

.card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.balance-card.total .card-amount {
    background: linear-gradient(to right, #2dd4bf, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* New Virtual Credit Card Styling */
.credit-card-new {
    width: 100%;
    max-width: 380px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 28px;
    padding: 1.25rem;
    color: white;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    margin: 1.5rem auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.credit-card-new::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.card-top {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.card-logo-circle {
    width: 42px;
    height: 42px;
    background-color: white;
    border-radius: 12px; /* Slightly rounded instead of full circle for modern look */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.card-type-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    font-weight: 600;
}

.card-number-large {
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    white-space: nowrap;
    text-align: center;
}

.card-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detail-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
    font-weight: 600;
}

.detail-value {
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
}

.text-green {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

/* FAB positioning fix */
.main-actions-credit,
.main-actions-pasivos,
.main-actions-assets,
.main-actions-summary {
    position: fixed;
    bottom: 5.5rem; /* Above tabs */
    right: 1.5rem;
    z-index: 100;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.main-actions-credit .action-btn,
.main-actions-pasivos .action-btn,
.main-actions-assets .action-btn,
.main-actions-summary .action-btn {
    width: 48px;
    height: 48px;
    pointer-events: auto;
}

.main-actions-credit .action-btn svg,
.main-actions-pasivos .action-btn svg,
.main-actions-assets .action-btn svg,
.main-actions-summary .action-btn svg {
    width: 24px;
    height: 24px;
}
/* Consolidated History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.history-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 15px;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.history-amount {
    font-weight: 600;
    font-size: 1rem;
}

.month-selector-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}
/* Responsive Design for Tablet/Desktop */
@media (min-width: 768px) {
    .app-container {
        max-width: 900px;
    }
    
    #view-general .general-balance-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .balance-card.total {
        grid-column: span 3;
    }
    
    .transaction-table {
        font-size: 1rem;
    }
}

@media (min-width: 1024px) {
    /* Custom Scrollbars for Desktop */
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    ::-webkit-scrollbar-track {
        background: var(--bg-color);
    }
    ::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 3px;
    }
    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }

    body {
        justify-content: flex-start;
        overflow: auto;
    }

    .app-container {
        max-width: 1300px;
        margin-left: 240px; /* Space for permanent sidebar */
        margin-right: auto;
        padding: 1.5rem 2rem 5rem 2rem; /* Compact layout margins and padding */
        height: auto;
        min-height: 100vh;
    }

    /* Premium Header on Desktop */
    .app-header {
        justify-content: flex-start;
        text-align: left;
        margin-bottom: 1.25rem; /* Compact margin */
        padding-top: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
        padding-bottom: 0.5rem; /* Compact padding */
    }

    .header-title {
        text-align: left;
        margin-right: 0;
    }

    .header-title h1 {
        font-size: 1.75rem; /* Compact title size */
        letter-spacing: -0.5px;
    }

    /* Permanent Sidebar on Desktop */
    .sidebar {
        width: 240px !important; /* Compact sidebar width */
        transform: translateX(0) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.25);
        border-right: 1px solid var(--border);
        padding-top: 0;
        background: rgba(30, 41, 59, 0.75); /* Glassmorphic */
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    .sidebar.hidden {
        transform: translateX(0); /* Force visible */
    }

    .sidebar-overlay {
        display: none !important;
    }

    #close-menu-btn, #menu-btn {
        display: none !important;
    }

    /* Sidebar Content Spacing and Navigation */
    .sidebar-content {
        display: flex;
        flex-direction: column;
        margin-top: 0;
        padding-bottom: 90px; /* Space for footer */
        overflow-y: auto;
    }

    /* Custom Scrollbar for Sidebar */
    .sidebar-content::-webkit-scrollbar {
        width: 4px;
    }
    .sidebar-content::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
    }

    /* Section Labels for Sidebar */
    .app-tabs::before {
        display: none !important; /* Hide navigation label on floating bar */
    }

    #business-list::before {
        content: "MIS NEGOCIOS";
        display: block;
        font-size: 0.6rem;
        font-weight: 600;
        color: var(--text-muted);
        letter-spacing: 1.5px;
        margin-bottom: 0.5rem;
        padding-left: 0.75rem;
        width: 100%;
        margin-top: 0.75rem; /* Added margin below header */
    }

    /* Compact Business Links in Sidebar */
    .business-link {
        padding: 0.6rem 0.85rem !important;
        margin-bottom: 0.35rem !important;
        border-radius: 8px !important;
        font-size: 0.85rem !important;
    }

    /* Floating Navigation bar at the bottom of the screen, centered in the content area */
    .app-tabs {
        position: fixed;
        bottom: 1.25rem; /* Lowered and compacted spacing */
        left: calc(240px + (100% - 240px) / 2);
        transform: translateX(-50%) !important;
        width: auto;
        max-width: 760px;
        height: auto;
        top: auto;
        border-top: none;
        z-index: 102;
        background: rgba(30, 41, 59, 0.85); /* Glassmorphic */
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px; /* Compact corners */
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        display: flex;
        flex-direction: row !important; /* Horizontal on desktop */
        padding: 0.3rem 0.5rem; /* Compact padding */
        gap: 0.15rem; /* Tighter gaps */
    }

    .tab-link, .admin-tab-link {
        flex-direction: row !important; /* Horizontal inline text and icon */
        gap: 0.35rem;
        padding: 0.4rem 0.75rem; /* Compact padding */
        border-radius: 8px;
        font-size: 0.8rem; /* Tighter text size */
        justify-content: center;
        width: auto !important; /* Inline width */
        margin: 0 !important;
        color: var(--text-muted);
        transition: all 0.25s ease;
    }

    .tab-link svg, .admin-tab-link svg {
        width: 16px; /* Compact icon sizes */
        height: 16px;
    }

    .tab-link.active, .admin-tab-link.active {
        background: rgba(13, 148, 136, 0.15) !important;
        color: var(--primary) !important;
        border-left: none !important; /* No left border in horizontal tabs */
        padding-left: 0.75rem !important;
        font-weight: 600;
    }

    .tab-link:hover, .admin-tab-link:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-main);
    }

    .sidebar-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 240px !important;
        background: rgba(30, 41, 59, 0.95);
        z-index: 102;
        border-top: 1px solid var(--border);
        padding: 0.75rem 1rem !important;
    }

    .sidebar-footer .business-link {
        margin-bottom: 0.5rem !important;
        padding: 0.6rem 0.85rem !important;
        font-size: 0.85rem !important;
    }

    #btn-add-business {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
    }

    #btn-add-business svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Cards Layout (Unified 4-column layout in a single row) */
    #view-general .general-balance-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 cards in one row on desktop */
        gap: 0.85rem; /* Compact gaps */
    }

    .balance-card.total {
        grid-column: span 1 !important; /* Override layout to fit 4-column single row */
    }

    /* Premium Glassmorphic Cards */
    .balance-card {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.65) 0%, rgba(15, 23, 42, 0.65) 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px; /* Compact borders */
        padding: 1rem 1.25rem; /* Compact padding */
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s, box-shadow 0.3s;
    }

    .balance-card:hover {
        transform: translateY(-2px);
        border-color: var(--primary);
        box-shadow: 0 10px 25px rgba(13, 148, 136, 0.15);
    }

    .balance-card.total {
        background: linear-gradient(135deg, rgba(13, 148, 136, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
        border-color: rgba(13, 148, 136, 0.3);
    }

    .balance-card.total:hover {
        box-shadow: 0 10px 25px rgba(167, 139, 250, 0.15);
        border-color: var(--primary);
    }

    .card-amount {
        font-size: 1.15rem; /* Compact balance card amounts */
    }

    /* Two-Column Dashboard Views */
    #view-liquidez, #view-creditos, #view-pasivos, #view-activos, #view-summary {
        display: grid;
        grid-template-columns: 280px 1fr; /* Tighter left column */
        gap: 1.5rem; /* Compact grid gap */
        align-items: start;
    }

    /* Left-column Balance and Credit Cards */
    #view-liquidez .balance-container,
    #view-pasivos .balance-container,
    #view-activos .balance-container,
    #view-creditos .credit-card-container {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
        width: 100%;
    }

    /* Glassmorphic Balance Cards */
    .balance-container {
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.7) 100%);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px; /* Compact border radius */
        padding: 1.25rem 1.5rem; /* Compact padding */
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .balance-container #balance-amount,
    #grandTotal,
    #average-amount,
    #total-debts-amount {
        font-size: 1.85rem !important; /* Much tighter and premium sizing */
        letter-spacing: -0.5px;
        line-height: 1.2;
    }

    /* Action Buttons Styled Inline in Left Column */
    .main-actions,
    .main-actions-credit,
    .main-actions-assets,
    .main-actions-pasivos,
    .main-actions-summary {
        grid-column: 1;
        grid-row: 2;
        position: static;
        display: flex;
        flex-direction: column;
        gap: 0.5rem; /* Compact gap */
        width: 100%;
        pointer-events: auto;
        background: transparent;
        border: none;
        padding: 0;
        z-index: auto;
        margin-top: 0.75rem; /* Compact margin */
    }

    .main-actions .action-btn,
    .main-actions-credit .action-btn,
    .main-actions-assets .action-btn,
    .main-actions-pasivos .action-btn,
    .main-actions-summary .action-btn {
        width: 100% !important;
        height: auto !important;
        border-radius: 10px !important; /* Compact corners */
        padding: 0.6rem 0.85rem !important; /* Compact padding */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s, background-color 0.2s !important;
        font-size: 0.85rem !important; /* Compact font size */
        font-weight: 600 !important;
        position: static !important;
    }

    .main-actions .action-btn svg,
    .main-actions-credit .action-btn svg,
    .main-actions-assets .action-btn svg,
    .main-actions-pasivos .action-btn svg,
    .main-actions-summary .action-btn svg {
        width: 18px !important; /* Compact icon sizes */
        height: 18px !important;
    }

    .main-actions .action-btn:hover,
    .main-actions-credit .action-btn:hover,
    .main-actions-assets .action-btn:hover,
    .main-actions-pasivos .action-btn:hover,
    .main-actions-summary .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25) !important;
    }

    .main-actions .action-btn:active,
    .main-actions-credit .action-btn:active,
    .main-actions-assets .action-btn:active,
    .main-actions-pasivos .action-btn:active,
    .main-actions-summary .action-btn:active {
        transform: scale(0.98);
    }

    /* Adding descriptions dynamically via CSS Pseudo-elements */
    #btn-ingreso::after { content: "Registrar Ingreso"; }
    #btn-egreso::after { content: "Registrar Egreso"; }
    #btn-delete-fab::after { content: "Eliminar Último"; }
    #btn-credit-action::after { content: "Registrar Crédito"; }
    #btn-delete-credit-fab::after { content: "Eliminar Último"; }
    #btn-add-pasivo-tenant::after { content: "Nuevo Pasivo"; }
    #btn-add-asset::after { content: "Nuevo Activo"; }
    #btn-liquidez::after { content: "Actualizar Liquidez"; }
    #btn-diario::after { content: "Actualizar Diario"; }
    #btn-add-pasivo-summary::after { content: "Agregar Pasivo"; }

    /* Right-column Tables and Lists */
    #view-liquidez .history-section,
    #view-creditos .history-section {
        grid-column: 2;
        grid-row: 1 / span 2;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 14px; /* Compact border radius */
        padding: 1.25rem 1.5rem; /* Compact padding */
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        margin-top: 0;
        padding-bottom: 1.25rem;
    }

    #view-summary .summary-sub-view .history-section {
        grid-column: 1 / span 2;
        grid-row: 2;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 14px; /* Compact border radius */
        padding: 1.25rem 1.5rem; /* Compact padding */
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
        margin-top: 0;
        padding-bottom: 1.25rem;
    }

    #summary-general .history-section {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1.5rem;
        align-items: start;
    }

    #consolidated-balance-section,
    #consolidated-history-section,
    #libro-diario-section {
        margin: 0 !important;
        padding: 0 !important;
    }

    #summary-general .history-section h3 {
        min-height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
    }

    #view-pasivos .pasivos-list-section,
    #view-activos .assets-list-section {
        grid-column: 2;
        grid-row: 1 / span 2;
        padding: 0 !important;
    }

    /* Dynamic auto-fill grids for Assets & Liabilities */
    #view-pasivos .pasivos-list-section #pasivos-list,
    #view-activos .assets-list-section #assets-list {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* Compact grids */
        gap: 0.85rem;
        padding-bottom: 0;
    }

    /* Virtual credit card hover effect */
    .credit-card-new {
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
    }
    .credit-card-new:hover {
        transform: translateY(-3px) scale(1.01);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(37, 99, 235, 0.15);
    }

    /* Summary View Structure */
    #view-summary .summary-sub-view {
        grid-column: 1 / span 2;
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two columns for top elements */
        gap: 1.5rem;
        align-items: start;
    }

    #view-summary .summary-sub-view .balance-container {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 0;
        width: 100%;
        max-width: 340px;
        justify-self: end;
    }

    #view-summary .summary-sub-view .main-actions-summary {
        grid-column: 2;
        grid-row: 1;
        margin-top: 0;
        align-self: center;
        max-width: 300px;
        justify-self: start;
        width: 100%;
    }

    /* Table & Modal Improvements */
    .transaction-table th, .transaction-table td {
        padding: 0.5rem 0.75rem; /* Tighter padding for tables */
        font-size: 0.85rem;
    }

    .transaction-table tbody tr {
        transition: background-color 0.2s ease;
    }

    .transaction-table tbody tr:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }

    /* Override inline paddings/margins to compact the layout */
    .history-section[style*="padding-bottom: 10rem"],
    .history-section[style*="padding-bottom: 5rem"],
    #consolidated-history-section[style*="padding-bottom"],
    #libro-diario-section[style*="padding-bottom"],
    #pasivos-list[style*="padding-bottom"],
    #assets-list[style*="padding-bottom"] {
        padding-bottom: 1.5rem !important;
    }
    
    #consolidated-history-section[style*="padding-top"],
    #libro-diario-section[style*="padding-top"] {
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .modal-overlay {
        padding-top: 3rem;
    }

    .modal {
        max-width: 400px;
        border-radius: 16px;
        padding: 1.25rem;
    }

    .modal-header h2 {
        margin-bottom: 1rem;
        font-size: 1.15rem;
    }

    .input-group {
        margin-bottom: 1rem;
        gap: 0.35rem;
    }

    .input-group label {
        font-size: 0.8rem;
        margin-bottom: 0.25rem;
    }

    input[type="text"], input[type="number"], select, textarea {
        padding: 0.6rem 0.85rem !important;
        font-size: 0.85rem !important;
        border-radius: 10px !important;
    }

    #view-summary .summary-sub-view .month-selector-container {
        grid-column: 2;
        grid-row: 1;
        padding: 0;
        margin-bottom: 0;
        width: 100%;
        display: flex;
        justify-content: start;
        margin-top: 0;
        align-self: center;
        max-width: 300px;
        justify-self: start;
    }

    /* Graficas view compaction overrides */
    .graficas-header-card {
        padding: 1rem 1.5rem;
        border-radius: 16px;
        margin-bottom: 1rem;
    }

    .dashboard-title {
        font-size: 1.35rem;
        margin-top: 0.25rem;
        margin-bottom: 1rem;
    }

    .chart-card {
        padding: 1rem 1.25rem;
        border-radius: 16px;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .chart-title {
        font-size: 0.95rem;
    }

    .custom-chart-bars {
        height: 180px;
        gap: 0.35rem;
    }

    .kpi-card {
        padding: 0.75rem 1rem;
        border-radius: 12px;
        gap: 0.25rem;
    }

    .kpi-title {
        font-size: 0.65rem;
    }

    .kpi-value {
        font-size: 1.05rem;
    }

    .pattern-table-container {
        padding: 1rem 1.25rem;
        border-radius: 16px;
        margin-bottom: 2rem;
    }

    /* Patterns View Desktop Grid Positioning */
    #view-summary #summary-patrones_e .month-selector-container,
    #view-summary #summary-patrones_i .month-selector-container {
        grid-column: 1 / span 2;
        grid-row: 1;
        margin-top: 0;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    #view-summary #summary-patrones_e .patrones-grid,
    #view-summary #summary-patrones_i .patrones-grid {
        grid-column: 1 / span 2;
        grid-row: 2;
        margin-top: 0;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    #view-summary #summary-patrones_e .card-prediction,
    #view-summary #summary-patrones_i .card-prediction {
        grid-column: span 1;
    }

    #view-summary #summary-patrones_e .pattern-table-container,
    #view-summary #summary-patrones_i .pattern-table-container {
        grid-column: 1 / span 2;
        grid-row: 3;
        margin-bottom: 0;
    }

    /* Graficas View Desktop Grid Positioning */
    #view-summary #summary-graficas .graficas-header-card {
        grid-column: 1 / span 2;
        grid-row: 1;
        margin-bottom: 0;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 1rem 1.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    #view-summary #summary-graficas .chart-card {
        grid-column: 1 / span 2;
        grid-row: 2;
        margin-top: 0;
    }

    #view-summary #summary-graficas .graficas-kpi-grid {
        grid-column: 1 / span 2;
        grid-row: 3;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    #view-summary #summary-graficas .pattern-table-container {
        grid-column: 1 / span 2;
        grid-row: 4;
        margin-bottom: 0;
    }
}

/* --- Dashboard & Analytics Styles --- */
.graficas-header-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.6) 100%);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 1.5rem;
}

.dashboard-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #2dd4bf, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.business-selector-wrapper {
    width: 100%;
    max-width: 300px;
    display: flex;
    justify-content: center;
}

.graficas-business-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
    text-align-last: center;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.graficas-business-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(13, 148, 136, 0.2);
}

.chart-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.05rem;
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
}

.custom-chart-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.custom-chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 220px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
    position: relative;
    gap: 0.5rem;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar-columns {
    display: flex;
    align-items: flex-end;
    gap: 0.35rem;
    height: 100%;
    width: 100%;
    justify-content: center;
}

.chart-bar-column {
    width: 16px;
    border-radius: 6px 6px 0 0;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
    cursor: pointer;
    position: relative;
    min-height: 2px;
}

.chart-bar-column:hover {
    opacity: 0.85;
    transform: scaleX(1.05);
}

.chart-bar-column.income {
    background: linear-gradient(to top, #0d9488, #2dd4bf);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.2);
}

.chart-bar-column.expense {
    background: linear-gradient(to top, #b91c1c, #ef4444);
    box-shadow: 0 2px 8px rgba(185, 28, 28, 0.2);
}

.chart-bar-column.net-positive {
    background: linear-gradient(to top, #1d4ed8, #3b82f6);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.2);
}

.chart-bar-column.net-negative {
    background: linear-gradient(to top, #b45309, #f59e0b);
    box-shadow: 0 2px 8px rgba(180, 83, 9, 0.2);
}

.chart-label-x {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    font-weight: 500;
}

/* Custom CSS Tooltip */
.chart-tooltip {
    position: absolute;
    bottom: 105%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    color: white;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 110px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.chart-bar-column:hover .chart-tooltip,
.chart-dot:hover .chart-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.chart-dot-wrapper {
    pointer-events: auto;
}

.chart-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text-main);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s;
    position: relative;
}

.chart-dot:hover {
    transform: scale(1.5);
    background-color: var(--primary);
}

.chart-labels-x-container {
    pointer-events: none;
}

.chart-tooltip span {
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-tooltip strong {
    font-weight: 600;
    color: var(--text-main);
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-color.legend-income {
    background: linear-gradient(to top, #0d9488, #2dd4bf);
}

.legend-color.legend-expense {
    background: linear-gradient(to top, #b91c1c, #ef4444);
}

.legend-color.legend-net-pos {
    background: linear-gradient(to top, #1d4ed8, #3b82f6);
}

.legend-color.legend-net-neg {
    background: linear-gradient(to top, #b45309, #f59e0b);
}

/* KPIs grid */
.graficas-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.kpi-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.kpi-title {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.kpi-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Pattern table container */
.pattern-table-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    margin-bottom: 5rem;
}

@media (min-width: 768px) {
    .graficas-kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Preloader Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(167, 139, 250, 0.4), 0 0 40px rgba(45, 212, 191, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 35px rgba(167, 139, 250, 0.7), 0 0 60px rgba(45, 212, 191, 0.4);
    }
}

/* --- Patterns & Projections General Styling --- */
.patrones-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.patrones-grid .balance-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.patrones-grid .card-prediction {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Scrollable containers for weekly and monthly pattern results */
#patron-e-semanal-results,
#patron-e-mensual-results,
#patron-i-semanal-results,
#patron-i-mensual-results {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#patron-e-semanal-results::-webkit-scrollbar,
#patron-e-mensual-results::-webkit-scrollbar,
#patron-i-semanal-results::-webkit-scrollbar,
#patron-i-mensual-results::-webkit-scrollbar {
    width: 6px;
}
#patron-e-semanal-results::-webkit-scrollbar-track,
#patron-e-mensual-results::-webkit-scrollbar-track,
#patron-i-semanal-results::-webkit-scrollbar-track,
#patron-i-mensual-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}
#patron-e-semanal-results::-webkit-scrollbar-thumb,
#patron-e-mensual-results::-webkit-scrollbar-thumb,
#patron-i-semanal-results::-webkit-scrollbar-thumb,
#patron-i-mensual-results::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
#patron-e-semanal-results::-webkit-scrollbar-thumb:hover,
#patron-e-mensual-results::-webkit-scrollbar-thumb:hover,
#patron-i-semanal-results::-webkit-scrollbar-thumb:hover,
#patron-i-mensual-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Global hidden utility, excluding elements that use opacity/transform transitions */
.hidden:not(.sidebar):not(.sidebar-overlay):not(.modal-overlay) {
    display: none !important;
}
