html, body {
    height: 100%;
    margin: 0;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    background-color: #F5F7FA;
}

/* ── Shell ─────────────────────────────────────────────────────────── */
.app-drawer { border-right: 1px solid var(--mud-palette-lines-default); }

.app-main {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body {
    flex: 1;
    min-height: 0;          /* lets each page scroll inside its own area */
    overflow: hidden;
}

.app-status {
    flex-shrink: 0;
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    font-size: 12px;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* ── Page frame: toolbar on top, scrolling content below ──────────── */
.page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.page-toolbar {
    flex-shrink: 0;
    background: var(--mud-palette-surface);
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Ring-menu commands: room between buttons, wrap instead of colliding */
.page-toolbar .mud-toolbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    gap: 4px 6px;
    padding: 6px 16px;
}
.page-toolbar .mud-toolbar .mud-divider-vertical { margin: 6px 4px; align-self: stretch; }
.page-toolbar .mud-button-root { white-space: nowrap; }

.page-scroll {
    flex: 1;
    overflow: auto;
    padding: 24px;
}

.page-body          { max-width: 1100px; margin: 0 auto; }
.page-body.narrow   { max-width: 780px; }
.page-body.compact  { max-width: 560px; }

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.page-title:focus { outline: none; }   /* FocusOnNavigate target, for screen readers only */

.form-section       { padding: 20px 20px 12px 20px; margin-bottom: 16px; }
.form-section-title { margin-bottom: 12px; color: var(--mud-palette-text-secondary); }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

/* ── Data grids: headers on one line ──────────────────────────────── */
.mud-table-head .mud-table-cell { white-space: nowrap; }

/* ── Main menu cards ──────────────────────────────────────────────── */
.menu-card {
    height: 100%;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}
.menu-card:hover { box-shadow: var(--mud-elevation-4); transform: translateY(-1px); }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
