/* =====================================================
   INRADR Design System — Custom Template Shell (M1)
   inradr-design layer · SingleWindowSDI shell layout.

   Binding SDI height chain (plan §3.4):
     .inradr-shell (flex column, height:100%)
       ├─ .inradr-app-header      flex:0 0 var(--inradr-height-nav-bar)   (auto row; grid logo | menu | actions)
       ├─ .view-caption-area      flex:0 0 auto                           (inradr-caption.css)
       ├─ .inradr-content         flex:1 1 auto, min-height:0       (fills)
       │    ├─ .inradr-content-toolbar   flex:0 0 auto
       │    └─ .inradr-content-body      flex:1 1 auto, overflow:auto  ← THE single scroll surface
       └─ .inradr-footer          flex:0 0 var(--inradr-height-footer)     (auto row, M3)
   min-height:0 on the flex children is what bounds the view container so DxGrid virtual
   scrolling gets a definite height (avoids UnableToRequestItemsException). xaf-flex-auto
   (XAF-owned, bridged) is kept alongside as the framework expects it. No Bootstrap utilities.
   Caption, content toolbar and content body share one horizontal gutter (--inradr-content-gutter),
   so the page title lines up with the grid and the form.
   ===================================================== */

.inradr-shell {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    background: var(--inradr-color-canvas);
}

/* Header row: the single owner of the header geometry (the former .inradr-nav-bar is merged here).
   Two equal outer columns centre the menu (OQ-05) and give the action area a definite width: the
   adaptive DxToolbar lays its items out of flow, so a content-sized container would leave it only its
   inline min-width and DevExpress would hide every item behind the ellipsis.
   The menu column is not content-sized either: DxMenu re-measures only when its own root resizes, so a
   track that follows the collapsed menu would never let it expand again. DxMenu centres its items
   (ItemsPosition=Center, InradrNavigationItemActionControlComponent.razor).
   DxMenu keeps its items expanded only while the column holds the items plus about 40px for the hamburger
   button it reserves when it re-measures, which it does after every navigation (the item data changes). The
   root items depend on the user's navigation permissions; an administrator sees eight (Übersicht ...
   Administration). Measured 2026-10-19 with those eight, in the Debug head, window narrowed in 2-4px steps:
   - centred grid: the menu column is half the window; the menu collapses at 2372px and expands again at 2380px.
     It is therefore used from 2400px only (until 2026-10-19 from 2000px, measured with seven root items, which
     left administrators on the hamburger between 2000 and 2371px);
   - below, the logo column shrinks to its content and the actions keep a fixed 10rem column: since the account
     panel (ClickUp 124ca7cpyje) the header holds only the bell with its count and the user icon. The adaptive
     header toolbar hides the bell's caption (XAF writes the notification count there) once its column is too
     narrow; 8rem did that, 10rem keeps a three-digit count visible. The root items drop to 14px at 1440px
     (inradr-feature-navigation.css), and the menu collapses at 1506px (1508px holds, 1510px expands it again) -
     with the 8rem column at 1474px, so the wider column costs exactly 32px. Narrowing step by step and jumping
     from 1920px straight to the target width gave the same values; the difference measured on 2026-10-01 with
     seven root items (1140px step by step, 1230px after a jump) no longer shows.
   A user with fewer root items collapses later; these values are the administrator's worst case. */
.inradr-app-header {
    flex: 0 0 var(--inradr-height-nav-bar);
    height: var(--inradr-height-nav-bar);
    display: grid;
    grid-template-columns: 1fr minmax(0, 2fr) 1fr;
    align-items: center;
    column-gap: var(--inradr-space-md);
    position: relative;
    z-index: var(--inradr-layer-app-header);
    background: var(--inradr-color-navy);
    color: var(--inradr-color-text-on-navy);
    border-bottom: 1px solid var(--inradr-color-border);
}

/* Logo image via content:url; the path is relative to this file (css/inradr-design/). */
.inradr-shell-logo {
    grid-column: 1;
    justify-self: start;
    display: block;
    content: url(../../images/logo_white.svg);
    width: 120px;
    height: 33px;
    object-fit: contain; /* keeps the aspect ratio at the narrower width below */
    margin-inline-start: var(--inradr-space-sm);
    cursor: pointer;

    &:focus-visible {
        outline: var(--inradr-focus-ring-width) solid var(--inradr-color-text-on-navy);
        outline-offset: var(--inradr-focus-ring-offset);
    }
}

@media (max-width: 2399px) {
    .inradr-app-header {
        /* 10rem: the bell with a three-digit count, the user icon, their gap and the column paddings */
        grid-template-columns: auto minmax(0, 1fr) minmax(0, 10rem);
    }
}

@media (max-width: 1399px) {
    .inradr-shell-logo {
        width: 100px;
    }
}

.inradr-shell-nav {
    grid-column: 2;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* No flex:0 0 auto here: the column width, not the content, must size the adaptive toolbar. */
.inradr-shell-header-right {
    grid-column: 3;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--inradr-space-xs);
    padding-inline: var(--inradr-space-sm);
}

/* Content column (fills remaining height; single scroll surface on the body) */
.inradr-content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--inradr-color-canvas);
}

.inradr-content-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--inradr-space-xs);
    min-height: var(--inradr-height-toolbar);
    padding: var(--inradr-toolbar-padding-y) var(--inradr-content-gutter);
}

.inradr-content-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 0 var(--inradr-content-gutter) var(--inradr-space-sm);
}
