/* ============================================================================
   Application shell layout (MainLayout / NavMenu / TopBar)
   ----------------------------------------------------------------------------
   Structure:   .lyt-shell (flex row)
                 ├─ .lyt-sidebar         flex sibling, sticky, 232px (72px collapsed)
                 └─ .lyt-main-col        flex:1, min-width:0
                      ├─ .lyt-topbar     60px, sticky
                      └─ .lyt-main       page content – zero offset, zero padding
   The sidebar is a normal flex item (NOT position:fixed) so the content starts
   exactly where the sidebar ends. There is no margin-left / padding-left offset.
   ========================================================================== */

html, body { margin: 0; }

.lyt-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;               /* clip (not hidden) so sticky children keep working */
    background: #f1f5f9;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    font-family: 'Benton Sans Pro', 'BentonSans', 'Roboto', 'Segoe UI', 'SF Pro', -apple-system, BlinkMacSystemFont, sans-serif;
}

.lyt-main-col {
    display: flex;
    flex: 1 1 0%;
    flex-direction: column;
    min-width: 0;
}

.lyt-main {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;                     /* pages carry their own 28px padding */
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.lyt-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    align-self: flex-start;
    position: sticky;
    top: 0;
    width: 232px;
    height: 100vh;
    padding: 16px 12px;
    box-sizing: border-box;
    overflow: hidden;
    color: #e2e8f0;
    background: #003FCA;
    transition: width 0.2s ease;
}

.lyt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 16px;
    flex: none;
}
.lyt-brand-img {
    height: 38px;
    width: auto;
    max-width: 195px;
    object-fit: contain;
    display: block;
}
.lyt-brand-icon {
    display: none;
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.lyt-brand-mark { flex: none; width: 30px; height: 34px; }
.lyt-brand-text { display: flex; flex-direction: column; min-width: 0; }
.lyt-brand-name { font-size: 19px; font-weight: 700; line-height: 1.1; color: #fff; white-space: nowrap; }
.lyt-brand-sub  { margin-top: 2px; font-size: 9.5px; line-height: 1.2; color: #94a3b8; white-space: nowrap; }

.lyt-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.lyt-nav::-webkit-scrollbar { width: 4px; }
.lyt-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 4px; }

.lyt-nav-title {
    padding: 12px 12px 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
}

.lyt-nav-divider { height: 1px; margin: 10px 6px; background: rgba(255, 255, 255, 0.16); flex: none; }

.lyt-nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 2px;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    font: inherit;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.lyt-nav-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; }
.lyt-nav-link.is-active,
.lyt-nav-link.is-active:hover {
    color: #fff;
    background: #0051FF;
    box-shadow: 0 4px 14px -2px rgba(0, 81, 255, 0.45);
}
.lyt-nav-link:focus-visible { outline: 2px solid #60a5fa; outline-offset: 1px; }
.lyt-nav-icon { flex: none; width: 18px; height: 18px; }

.lyt-cta-wrap { flex: none; margin-top: auto; padding-top: 8px; }
.lyt-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-align: left;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.lyt-cta:hover { background: rgba(255, 255, 255, 0.16); }
.lyt-cta svg { flex: none; width: 16px; height: 16px; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.lyt-topbar {
    position: sticky;
    top: 0;
    z-index: 1100;
    display: flex;
    flex: 0 0 60px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 60px;
    box-sizing: border-box;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}
.lyt-topbar-left, .lyt-topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }

.lyt-icon-btn {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #fff;
    color: #0f172a;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.lyt-icon-btn:hover { background: #f8fafc; border-color: #cbd5e1; }
.lyt-icon-btn:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.lyt-icon-btn svg { width: 18px; height: 18px; transition: transform 0.2s ease; }
.lyt-icon-btn svg.is-flipped { transform: rotate(180deg); }

.lyt-status { display: flex; align-items: center; gap: 8px; }
.lyt-bell-wrap { position: relative; display: flex; align-items: center; }
.lyt-user-wrap { position: relative; display: flex; align-items: center; }
.lyt-topbar .bell-icon-wrap { width: 36px; height: 36px; border-radius: 11px; }
.lyt-topbar .user-profile-pill { margin-left: 0; padding: 4px 10px 4px 4px; }
.lyt-topbar .user-profile-name { font-size: 14px; max-width: 180px; }
.lyt-topbar .user-avatar-small { width: 28px !important; height: 28px !important; }

.lyt-backdrop { display: none; }

/* ── Collapsed rail (desktop only) ───────────────────────────────────────── */
@media (min-width: 1024px) {
    .lyt-sidebar.is-collapsed { width: 72px; }
    .lyt-sidebar.is-collapsed .lyt-brand { justify-content: center; padding: 0 0 16px; }
    .lyt-sidebar.is-collapsed .lyt-brand-img,
    .lyt-sidebar.is-collapsed .lyt-brand-mark,
    .lyt-sidebar.is-collapsed .lyt-brand-text,
    .lyt-sidebar.is-collapsed .lyt-nav-label,
    .lyt-sidebar.is-collapsed .lyt-nav-title,
    .lyt-sidebar.is-collapsed .lyt-cta-text { display: none; }
    .lyt-sidebar.is-collapsed .lyt-brand-icon { display: block; }
    .lyt-sidebar.is-collapsed .lyt-nav-link,
    .lyt-sidebar.is-collapsed .lyt-cta { justify-content: center; padding-left: 0; padding-right: 0; }
    .lyt-only-mobile { display: none !important; }
}

/* ── Off-canvas drawer (< 1024px) ────────────────────────────────────────── */
@media (max-width: 1023.98px) {
    .lyt-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1250;
        width: 232px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }
    .lyt-sidebar.is-open { transform: translateX(0); box-shadow: 0 0 40px rgba(0, 0, 0, 0.35); }
    .lyt-backdrop { display: block; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1240; background: rgba(0, 0, 0, 0.4); }
    .lyt-only-desktop { display: none !important; }
    .lyt-topbar { padding: 0 16px; }
}
@media (max-width: 599.98px) {
    .lyt-hide-sm { display: none !important; }
}

/* ── Global MudDialog Stacking (ensure modals & backdrops sit above sticky topbar and sidebar) ── */
.mud-dialog-container {
    z-index: 2500 !important;
}
.mud-overlay {
    z-index: 2490 !important;
}
