/* ==========================================================================
   Layout: app shell, sidebar (NavMenu), page header, article
   ========================================================================== */

.app { display: flex; height: 100vh; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* --- Sidebar: icon rail, expands over the content on hover / keyboard focus --- */
.side { --rail: 60px; flex: none; width: var(--rail); height: 100vh; position: sticky; top: 0; z-index: 20; }
.side-inner {
    position: absolute; top: 0; bottom: 0; left: 0;
    width: var(--rail);
    overflow: hidden;
    background: linear-gradient(180deg, #112043 0%, #0A1430 100%);
    padding: 14px 10px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    display: flex; flex-direction: column; gap: 2px;
    transition: width .18s ease, box-shadow .18s ease;
}
.side:hover .side-inner,
.side:focus-within .side-inner { width: 216px; box-shadow: 10px 0 34px rgba(8,16,40,.35); }

.side .brand { display: flex; align-items: center; gap: 12px; padding: 2px 0 16px 4px; white-space: nowrap; text-decoration: none; }
.side .emblem { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 2px 8px rgba(214,178,94,.35)); }
.side .brand b { display: block; font-size: 14.5px; color: #FFFFFF; }
.side .brand span { font-size: 11px; color: #8EA0C6; }

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 11px; border-radius: 8px;
    font-size: 13.5px; color: #8EA0C6;
    cursor: pointer; white-space: nowrap; text-decoration: none;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #FFFFFF; }
.nav-item:focus-visible { outline: 2px solid #7AA2FF; outline-offset: -2px; }
.nav-item.active { background: linear-gradient(90deg, #3B6FE0, #5B8CFF); color: #FFFFFF; font-weight: 600; box-shadow: 0 6px 16px -4px rgba(59,111,224,.6); }
.nav-item .badge { margin-left: auto; font-size: 10.5px; font-weight: 700; background: var(--red); color: #FFFFFF; padding: 1px 7px; border-radius: 20px; }
.nav-item .ic { position: relative; display: flex; }
.nav-item .ic .pip { position: absolute; top: -2px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--navy); }
.nav-spacer { flex: 1; }

/* Labels only appear while the rail is expanded */
.side .brand > div, .nav-item .txt, .nav-item .badge { opacity: 0; transition: opacity .12s ease; }
.side:hover .brand > div, .side:hover .nav-item .txt, .side:hover .nav-item .badge,
.side:focus-within .brand > div, .side:focus-within .nav-item .txt, .side:focus-within .nav-item .badge { opacity: 1; }

/* --- Page header: title (from site map), toolbar section, meta chips --- */
.page-header {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 12px 22px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    background: rgba(255,255,255,.75);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(203,213,232,.7);
}
.page-header .title { min-width: 0; padding-right: 18px; border-right: 1px solid var(--line); }
.page-header .title h1 {
    font-size: 18px; line-height: 1.15; margin: 0; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: linear-gradient(90deg, #14213D 20%, #3B6FE0);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-header .title span { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-header .title span b { color: var(--text); font-weight: 600; }
.page-header .meta { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.page-header .partner { display: flex; align-items: center; gap: 8px; padding-right: 12px; margin-right: 2px; border-right: 1px solid var(--line); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.page-header .partner img { height: 30px; width: auto; border-radius: 4px; }
.page-header .signout { margin: 0; display: contents; }
.page-header .signout button { font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.page-header .signout button:hover { color: var(--red); border-color: #F4C6CE; background: #FFF7F8; }

/* --- Article: page body --- */
.view { flex: 1; min-height: 0; padding: 12px 18px 16px; overflow: auto; }

@media (max-height: 760px) and (min-width: 1101px) {
    .view { padding-top: 9px; padding-bottom: 10px; }
}
@media (max-width: 1100px) {
    .app { height: auto; min-height: 100vh; }
    .view { overflow: visible; }
}
@media (max-width: 700px) {
    .side { --rail: 52px; }
    .side-inner { padding-left: 6px; padding-right: 6px; }
    .side .brand { padding-left: 4px; }
    .side .emblem { width: 28px; height: 28px; }
    .page-header .partner { display: none; }
    .page-header { padding: 12px 16px; gap: 12px; }
    .page-header .meta > span.chip { display: none; } /* hide the user name, keep clock + Sign out */
    .view { padding: 12px 16px 20px; }
}
