/* static/css/app.css */

/* ==========================================================================
   INTEGRATED WEB APP LAYOUT STYLES
   (Shell structure: Header, Sidebar, Main Content Area)
   ========================================================================== */

.app-container {
    display: flex; /* Use flexbox to structure header, body */
    flex-direction: column;
    height: 100%; /* Fill the height of its parent (likely .content-main) */
    overflow: hidden; /* Prevent container itself from scrolling */
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0; /* Padding top/bottom, no side padding (handled by parent) */
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.app-header h1 {
    font-size: 1.25rem; /* Slightly smaller header for app view */
    margin: 0;
    color: var(--text-color);
}

.app-body {
    display: flex; /* Arrange sidebar and main content side-by-side */
    flex-grow: 1; /* Allow body to fill remaining vertical space */
    overflow: hidden; /* Prevent body from causing double scrollbars */
}

.app-sidebar {
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    width: 220px;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0; /* Padding top/bottom */
    margin-right: 1.5rem; /* Space between sidebar and content */
    overflow-y: auto; /* Allow sidebar nav to scroll if needed */
}

.app-main-content {
    flex-grow: 1; /* Allow content area to fill remaining horizontal space */
    padding: 1.5rem 0; /* Padding top/bottom */
    overflow-y: auto; /* Allow main content area to scroll */
}


/* ==========================================================================
   APP GRID CONTAINER (for component layout within app-main-content)
   *** ADDED/MODIFIED FOR GRIDSTACK LAYOUT DATA ***
   ========================================================================== */

.app-grid-container {
    display: grid;                      /* Enable CSS Grid */
    grid-template-columns: repeat(12, 1fr); /* Define 12 equal-width columns */

    /* Define how rows are created automatically */
    /* minmax(80px, auto): Rows will be at least 80px tall (matching builder cellHeight)
       but can grow taller ('auto') if the content inside requires more space. */
    grid-auto-rows: minmax(80px, auto);

    gap: 10px;                          /* Space between grid items (should match Gridstack 'margin') */
    align-items: start;                 /* Align items to the top of their grid areas */
    padding-bottom: 1.5rem; /* Add some padding at the bottom */
}

/* Optional: Style for the wrapper div if needed, though positioning is done inline */
.app-grid-item-wrapper {
    /* Add any common styling for component wrappers here if desired */
    /* Example: border: 1px dotted lightgrey; */
    min-width: 0; /* Prevent flex/grid items from overflowing */
    min-height: 0; /* Prevent flex/grid items from overflowing */
}