/* ═══════════════════════════════════════════════════════════════════════════
   lucpac-layout.css - the SHARED LAYOUT SYSTEM of every server-rendered Lucpac app

   The application shell: the sidebar, status bar, page shell, footer and copyright band that
   AdminApp, TenantAdminApp and DocFlow.Web all render, so every application reads as one product
   to the person who works in more than one. The shared layout components (NavMenu, Footer,
   CopyrightBanner, UserAvatarMenu, EngagementBanner, SystemConnectivityStatus) are driven by the
   --nav-*, --sb-*, --pg-*, --fr-*, --cr-*, --ua-* and --cs-* variables below; a host that renders
   them without this sheet gets an unstyled shell rather than a broken one, which is harder to spot.

   ONE copy. Until 2026-11-02 this block lived at the top of each app's app.css - AdminApp's first,
   then TenantAdminApp's copied from it, then DocFlow's copied from that - and a change to one
   reached neither of the others. Every host links it after lucpac-tokens.css (whose values it
   reads) and before its own app.css (which may build on it, never redefine it):
   SharedLayoutStylesheetTests holds both, and refuses an app stylesheet that declares one of these
   variables or restyles one of these selectors.

   An app's own rules stay in its own app.css: AdminApp's reset, error UI and dock override, the
   ta-* and df-* rules. A rule that every app needs goes here instead, once.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    /* ── Base palette — re-pointed at lucpac-tokens.css (2026-10-19). The names stay so every
       consumer below keeps working; the values are the brand's. New rules should read --lucpac-*. ── */
    --base-clr: var(--lucpac-navy);
    --base-1st-clr: var(--lucpac-navy);
    --base-2nd-clr: var(--lucpac-sky);
    --base-3rd-clr: var(--lucpac-mist);
    --text-1st-clr: var(--lucpac-on-navy);
    --text-2nd-clr: var(--lucpac-ink);
    --text-3rd-clr: var(--lucpac-navy);
    --hover-clr: var(--lucpac-navy-deep);
    --text-clr: var(--lucpac-on-navy);
    --accent-clr: var(--lucpac-sky);
    --secondary-text-clr: var(--lucpac-on-navy-muted);
    /* ── Panel ── */
    --panel-divider-clr: 1px solid var(--lucpac-line);
    /* ── Footer tokens ── */
    --fr-height: 80px;
    --fr-bg-clr: var(--base-1st-clr);
    --fr-border-top: 4px solid var(--lucpac-sky);
    /* ── Copyright Banner tokens ── */
    --cr-bg-clr: var(--base-3rd-clr);
    --cr-text-clr: var(--lucpac-ink);
    --cr-name-clr: var(--lucpac-navy);
    --cr-icon-clr: var(--lucpac-navy);
    --cr-icon-size: 1rem;
    --cr-icon-gap: 0.1rem;
    --cr-font-size: 0.8rem;
    --cr-padding: 0.1rem 0.5rem;
    --cr-border-top: 1px solid var(--lucpac-line);
    --cr-border-bottom: 5px solid var(--base-1st-clr);
    /* ── Page Shell tokens ── */
    --pg-content-padding: 1.1rem 1.5rem;
    --pg-layout-breakpoint: 800px;
    /* ── Status Bar tokens ── */
    --sb-bg-clr: var(--base-1st-clr);
    --sb-height: 4rem;                       /* was 3.5rem: the logo filled it edge to edge */
    --sb-border-bottom: 5px solid var(--base-2nd-clr);
    --sb-padding-inline: 1.5rem;
    --sb-text-clr: var(--text-1st-clr);
    --sb-logo-height: 1.75rem;               /* the wordmark, with a clear "x" above and below */
    /* ── User Avatar tokens ── */
    --ua-size: 2.2rem;
    --ua-bg-clr: var(--lucpac-sky);
    --ua-text-clr: var(--lucpac-navy-deep);
    --ua-font-size: 0.85rem;
    --ua-font-weight: 600;
    --ua-border: 2px solid var(--lucpac-on-navy);
    /* ── Connection Status tokens ── */
    --cs-dot-size: 0.6rem;
    --cs-online-clr: var(--lucpac-success);
    --cs-offline-clr: var(--lucpac-danger);
    --cs-pulse-duration: 1.5s;
    /* ── Sync Status tokens ── */
    /*  --sy-icon-size: 1.1rem;
    --sy-synced-clr: #26b050;
    --sy-pending-clr: #f59e0b;
    --sy-syncing-clr: var(--accent-clr);
    --sy-failed-clr: #e53935;
    --sy-badge-size: 0.9rem;
    --sy-badge-bg: #f59e0b;
    --sy-badge-clr: #fff;
    --sy-spin-duration: 1s;*/
    /* ── System Settings tokens ── */
    --ss-icon-size: 1.3rem;
    --ss-panel-width: 24rem;
    --ss-panel-bg: var(--base-3rd-clr);
    --ss-panel-text: var(--base-1st-clr);
    --ss-panel-shadow: 0 8px 24px color-mix(in srgb, var(--lucpac-navy-deep) 25%, transparent);
    --ss-section-bg: var(--lucpac-mist);
    --ss-section-radius: var(--lucpac-radius);
    --ss-section-title-clr: var(--base-2nd-clr);
    --ss-label-clr: var(--lucpac-text-muted);
    --ss-value-clr: var(--base-1st-clr);
    --ss-badge-pwa-bg: var(--lucpac-success);
    --ss-badge-pwa-clr: var(--lucpac-paper);
    --ss-badge-browser-bg: var(--lucpac-navy);
    --ss-badge-browser-clr: var(--lucpac-on-navy);
    --ss-divider-clr: 1px solid var(--lucpac-line-soft);
    /* ── NavMenu / Sidebar tokens ── */
    --nav-width: 250px;
    --nav-width-collapsed: 60px;
    --nav-bg-clr: var(--base-clr);
    --nav-text-clr: var(--text-clr);
    --nav-icon-clr: var(--text-clr);
    --nav-active-clr: var(--accent-clr);
    --nav-hover-bg: var(--hover-clr);
    --nav-hover-border-clr: var(--accent-clr);
    --nav-header-border: 5px solid var(--base-2nd-clr);
    --nav-border-clr: var(--lucpac-navy-tint);
    --nav-link-radius: var(--lucpac-radius);
    --nav-link-padding: 0.85em;
    --nav-transition: 300ms ease-in-out;
    --nav-logo-height: 1.75rem;
    --nav-mobile-height: 60px;
    --nav-mobile-item-size: 60px;
    --nav-sidebar-icon-color: var(--lucpac-sky);
}

/* ═══════════════════════════════════════════════
   Parent to:
   NavMenu / Sidebar – global reusable component
   All values driven by --nav-* variables in :root
   ═══════════════════════════════════════════════ */
.layout-row {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════
   Main Parent to:
   Statusbar
   Pageshell
   Footer
   Copyright Banner
   ═══════════════════════════════════════════════ */
.main-area {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background: var(--lucpac-mist);
}

/* ═══════════════════════════════════════════════
   Content Scroll Wrapper – scrollable zone
   Contains: page content, Footer, CopyrightBanner
   ═══════════════════════════════════════════════ */
.content-scroll-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    /* Self-contained stacking context capped below the statusbar (z-index:2).
       Without this, positioned descendants inside a page (Telerik cards/gauges)
       leak into the parent context and paint over the avatar/logout popover. */
    position: relative;
    z-index: 0;
}

/* ═══════════════════════════════════════════════
   Status Bar – global reusable component
   All values driven by --sb-* variables in :root
  ═══════════════════════════════════════════════ */
.statusbar-container {
    display: flex;
    flex-shrink: 0;
    height: var(--sb-height);
    min-height: var(--sb-height);
    max-height: var(--sb-height);
    align-items: center;
    background: var(--sb-bg-clr);
    border-bottom: var(--sb-border-bottom);
    color: var(--sb-text-clr);
    padding-inline: var(--sb-padding-inline);
    z-index: 2;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-right: 0.5rem;
}

.statusbar-logo {
    height: var(--sb-logo-height);
    max-height: 100%;
    width: auto;
    object-fit: contain;
    margin-right: auto;
    display: block;
    flex-shrink: 0;
}

.statusbar-container a,
.statusbar-container .btn-link {
    white-space: nowrap;
    text-decoration: none;
    color: inherit;
}

    .statusbar-container a:hover,
    .statusbar-container .btn-link:hover {
        text-decoration: underline;
    }

/* ═══════════════════════════════════════════════
   Page Shell – global reusable component
   All values driven by --pg-* variables in :root
   ═══════════════════════════════════════════════ */
.page-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-shell-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page-shell-content {
    flex: 1 1 auto;
    padding: var(--pg-content-padding);
}

/* Responsive: mobile nav */
@media (max-width: 800px) {
    .layout-row {
        flex-direction: column;
    }

    .main-area {
        margin-left: 0 !important;
    }
}

/* ── Popups: one design (Add Plan is the reference, 2026-11-04) ──────────────────────────────────
   Every TelerikWindow and TelerikDialog: the title bar is the navy of the page banner, and the footer -
   where PopupActions and EditorActions put the buttons - is a band that stays in view under the scrolling
   content, its buttons on the right at their own width. On .k-window, which a Dialog also carries, rather
   than on a class, so a popup cannot miss the design by leaving one off. Here rather than in a component's
   own sheet because a popup renders at the root of the page, out of reach of scoped CSS; Telerik 15 has
   no ThemeColor on the Window. The footer is .k-window-footer, or .k-dialog-actions on a Dialog, or in
   older Kendo markup a .k-window-actions directly under the window (the title bar's own actions are
   .k-window-titlebar-actions and are not touched). */
.k-window .k-window-titlebar {
    background: var(--lucpac-navy);
    color: var(--lucpac-on-navy);
    border-bottom: 3px solid var(--lucpac-sky);
}

.k-window .k-window-title {
    font-family: var(--lucpac-font-display);
    font-weight: 600;
}

.k-window .k-window-titlebar .k-button {
    color: var(--lucpac-on-navy);
}

.k-window .k-window-footer,
.k-window .k-dialog-actions,
.k-window > .k-window-actions {
    background: var(--lucpac-mist-soft);
    border-top: 1px solid var(--lucpac-line);
}

/* Telerik stretches a Dialog's buttons across its footer by default. */
.k-window .k-dialog-actions {
    justify-content: flex-end;
}

.k-window .k-dialog-actions .k-button {
    flex: 0 0 auto;
}
