/* App shell: header, menu, footer (MainLayout) */

/* ===== Page frame ===== */
#full-page-div {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#contentPane {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    background: #fff;
}

/* ===== Header ===== */
.app-header {
    flex: 0 0 56px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #dde3de;
    position: relative;
    z-index: 200; /* above the phone header (101), below Radzen dialogs */
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: #1f2a24;
    cursor: pointer;
}

    .app-brand:focus-visible {
        outline: 2px solid #2e7d32;
        outline-offset: 4px;
        border-radius: 6px;
    }

.app-brand-logo {
    height: 30px;
    width: auto;
    display: block;
}

.app-brand-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* ===== Menu (RadzenMenu). !important beats Radzen theme defaults ===== */
.app-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
}

.app-header .rz-menu {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    gap: 2px;
}

    .app-header .rz-menu .rz-navigation-item-link {
        padding: 6px 12px !important;
        color: #36413b !important;
        font-size: 13px;
        font-weight: 500 !important;
        border-radius: 6px !important;
    }

        .app-header .rz-menu .rz-navigation-item-link:hover {
            background: #f4f6f4 !important;
        }

    .app-header .rz-menu > .rz-navigation-item.rz-state-focused > .rz-navigation-item-wrapper {
        background: #e8f3e9 !important;
        box-shadow: none !important;
        border-radius: 6px;
    }

    .app-header .rz-menu .rz-navigation-menu .rz-navigation-item-link {
        padding: 8px 14px !important;
    }

/* ☰ / ✕ toggle (phone): quiet, green focus ring instead of the black box */
.app-header .rz-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #36413b;
    outline: none;
}

    .app-header .rz-menu-toggle:hover {
        background: #f4f6f4;
    }

    .app-header .rz-menu-toggle:focus-visible {
        outline: 2px solid #2e7d32;
        outline-offset: 1px;
    }

/* No black focus box on menu items; keyboard users get a green ring */
.app-header .rz-menu .rz-navigation-item,
.app-header .rz-menu .rz-navigation-item-wrapper,
.app-header .rz-menu .rz-navigation-item-link {
    outline: none !important;
}

    .app-header .rz-menu .rz-navigation-item:focus-visible > .rz-navigation-item-wrapper {
        box-shadow: inset 0 0 0 2px #2e7d32 !important;
        border-radius: 6px;
    }

/* ===== User block + Sign out ===== */
.app-header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #e8f3e9;
    color: #1b5e20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.app-user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.app-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2a24;
}

.app-user-role {
    font-size: 12px;
    color: #5c6862;
}

.app-signout-form {
    margin: 0;
}

.app-signout {
    height: 34px;
    padding: 0 14px;
    border: 1px solid #c9d2cb;
    border-radius: 6px;
    background: #fff;
    color: #36413b;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

    .app-signout:hover {
        background: #f4f6f4;
        border-color: #9aa59f;
    }

    .app-signout:focus-visible {
        outline: 2px solid #2e7d32;
        outline-offset: 1px;
    }

/* ===== Footer ===== */
.app-footer {
    flex: 0 0 28px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #fff;
    border-top: 1px solid #dde3de;
    color: #5c6862;
    font-size: 12px;
}

/* ===== Phone ===== */
@media (max-width: 767.98px) {

    .app-header {
        flex-basis: 52px;
        gap: 8px;
        padding: 0 12px;
    }

    /* Avatar + Sign out only; name/role hidden */
    .app-user-text {
        display: none;
    }

    .app-footer {
        display: none;
    }

    /* Closed menu: only the ☰ shows */
    .app-header .rz-menu.rz-menu-closed > .rz-navigation-item {
        display: none !important;
    }

    /* Open menu: white panel floating under the header, one vertical list */
    .app-header .rz-menu.rz-menu-open {
        position: absolute !important;
        top: 100%;
        left: 12px;
        right: 12px;
        z-index: 20;
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        padding: 6px !important;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        background: #fff !important;
        border: 1px solid #dde3de !important;
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
        width: auto !important;
        gap: 0;
    }

        /* Compact ✕ row */
        .app-header .rz-menu.rz-menu-open .rz-menu-toggle {
            width: 32px;
            height: 32px;
            margin: 0 0 2px auto;
        }

        /* Each top item on its own full-width row */
        .app-header .rz-menu.rz-menu-open > .rz-navigation-item {
            display: block !important;
            width: 100%;
        }

        .app-header .rz-menu.rz-menu-open .rz-navigation-item-link {
            padding: 10px 12px !important;
        }

        /* Submenu opens inline (accordion) instead of as a floating box */
        .app-header .rz-menu.rz-menu-open .rz-navigation-menu {
            position: static !important;
            min-width: 0 !important;
            margin: 0 0 4px 12px;
            padding: 0 0 0 8px !important;
            border: 0 !important;
            border-left: 2px solid #e8f3e9 !important;
            box-shadow: none !important;
            background: transparent !important;
        }
}
