/* App Specific Layout (Grid) */

.app-container {
    max-width: 1800px;
    /* Increased to fill more screen */
    margin: 0 auto;
    padding: 20px;
    /* Slightly reduced padding */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 24px;
    /* Reduced vertical gap significantly */
}

/* Topbar Region */
.region-topbar {
    height: 60px;
    /* Placeholder flex alignment handled by block */
}

/* Main Grid: 4 Equal Columns on Desktop */
.region-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* grid-template-rows: 1fr; removed to stop forcing height */
    gap: var(--gap-grid);
    /* flex: 1; removed to stop taking all space */
    height: 600px;
    /* Fixed height for consistency */
    min-height: 0;
}

.card-container {
    height: 100%;
    min-height: 0;
    /* Important: Allow shrinking below content size */
    overflow: hidden;
    /* Contain internal scrolls */
    display: flex;
    flex-direction: column;
}

/* Analytics Region: Bottom wide area */
.region-analytics {
    min-height: 250px;
    height: auto;
    /* Hauteur flexible pour contenir le contenu */
}

/* Responsive */
@media (max-width: 1024px) {
    .region-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-container {
        height: auto;
        overflow-y: auto;
    }

    .app-container {
        height: auto;
        overflow-y: auto;
    }
}

/* --- Focus Mode (Expanded Card) --- */
.card-expanded {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 2000;
    margin: 0 !important;
    height: auto !important;
    /* Override layout constraints */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    background: var(--bg-card);
    border-radius: var(--radius-sq);
    /* Ensure bg is opaque */
    transition: all 0.4s var(--ease-ios);
}

/* Backdrop when focus mode is active */
body.has-expanded-card::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}