/* Business Control Manager — Web Wave 1 shell: Home + Hub-in-Hub navigation + full-workspace panels.
   External stylesheet only (strict CSP: no inline styles). Extends css/shell.css's brand/login/topbar
   chrome (kept byte-identical to the Executive shell's own file so both shells look like the same
   product) with the Home/Hub/Workspace layer.

   TYPOGRAPHY SCALE (mandatory, C15 UX requirement) — compact, professional, dense but never cramped:
     --fs-body   14px   normal operational text
     --fs-sec    13px   secondary information (meta, captions, helper text)
     --fs-h      17px   section headings
     --fs-title  22px   main workspace / page titles
     --fs-kpi    28px   KPI figures only (genuine emphasis, not decorative)
   Home/Hub surfaces may read a little larger/more visual; operational workspaces stay compact. */
:root{
  --fs-body:14px; --fs-sec:13px; --fs-h:17px; --fs-title:22px; --fs-kpi:28px;
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px; --sp-6:24px;
}
body{font-size:var(--fs-body);line-height:1.45}

/* ── Corporate Visual Closure (release-closure round, 2026-09-26): dark corporate shell ───────────
   Scoped to #shell-app only (an ID selector, so it overrides shell.css's :root defaults for every
   descendant without touching them) -- the login screen (#shell-login, a SIBLING section, already has
   its own tested, good-looking dark-gradient-canvas + white-card treatment from shell.css and is
   deliberately left untouched). --dark/--dark2 (shell.css) already ARE the corporate near-black used
   for the header/sidebar background and are kept exactly as-is; every place in this file that misused
   --dark as a TEXT-emphasis color (correct on the old pale --bg, wrong on this dark one) now uses
   --ink instead, which this override flips to a light tone. --panel is the new "card floats above the
   dark canvas" surface (management-grade KPI/row/detail cards); --muted is secondary/caption text;
   pastel status badges/pills (bw-pill, bw-hub .badge) are deliberately left as their existing light/
   saturated tints -- small, isolated accent chips read clearly against a dark surrounding in every
   real dark-mode enterprise UI (GitHub, Linear, etc.), and re-deriving 8 separate status-color pairs
   under time pressure risks a real contrast regression for no visual gain. */
#shell-app{
  --bg:#12161a; --ink:#e6ebf2; --line:#2c3440; --acc:#6f9bd4; --bad:#e0665c;
  --panel:#1b212a; --panel2:#222933; --muted:#9aa7b6; --divider:rgba(255,255,255,.08);
  background:var(--bg); min-height:100vh; min-height:100dvh;
}

/* ── Top bar additions (Home button, breadcrumb) — kept inside the existing .sh-bar chrome ───── */
.bw-home-btn{background:transparent;border:0;padding:0;margin:0;cursor:pointer;border-radius:8px;line-height:0}
.bw-home-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}
.bw-home-btn img{display:block;border-radius:6px}

/* ── C16 branding: official CGS HUB product logo (icons/cgs-hub-logo.webp, supplied asset, never
   redrawn/recolored/cropped — real 1448x1086 aspect ratio preserved via height+object-fit, never
   forced into a square box). The login card (.sh-brand) is already light, so the logo needs no
   extra framing there; the topbar (.sh-bar, background:var(--dark)) gets a small white chip so the
   logo's own white canvas reads as intentional, not a stray box — the chip is page chrome, the
   image bytes are untouched. Overrides shell.css's own byte-identical .sh-brand/.sh-bar img rules
   via higher selector specificity, without editing that shared file. ─────────────────────────── */
.sh-brand img.cgs-hub-logo{width:auto;height:44px;object-fit:contain;border-radius:0}
.cgs-hub-logo-chip{display:inline-flex;align-items:center;justify-content:center;background:#fff;border-radius:6px;padding:3px 5px;line-height:0}
.sh-bar img.cgs-hub-logo{width:auto;height:20px;object-fit:contain;border-radius:0;display:block}
.bw-breadcrumb{font-size:var(--fs-sec);color:#c6d2e0;max-width:38vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bw-breadcrumb .seg{color:#e8eef6}
.bw-breadcrumb .sep{margin:0 6px;color:#7c8ba0}
@media (max-width:860px){.bw-breadcrumb{display:none}}

/* ── C17 Executive Header additions: role label, real attention-count indicator ─────────────────── */
.sh-bar .u .r{margin-left:6px;padding-left:6px;border-left:1px solid #4a5563;color:#8a97a8;font-size:11px}
.bw-attn-btn{position:relative;display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;margin-right:2px;border:1px solid #4a5563;border-radius:9px;background:transparent;color:#fff;font-size:13px;font-weight:600;cursor:pointer}
.bw-attn-btn .dot{width:8px;height:8px;border-radius:50%;background:#e0653f;flex:none}
.bw-attn-btn:hover{border-color:#8a97a8}
@media (max-width:640px){.bw-attn-btn{padding:0 10px}}

/* ── Final Enterprise Web Closure (2026-09-26) §8: date / exchange-rate / system-status chips ──── */
.bw-hdr-info{display:flex;align-items:center;gap:10px;margin-right:10px}
.bw-hdr-chip{font-size:11px;color:#8a97a8;white-space:nowrap}
.bw-hdr-chip:empty{display:none}
.bw-hdr-chip.ok{color:#7fd08a}
.bw-hdr-chip.warn{color:#e0a53f}
.bw-hdr-chip.bad{color:#e0653f}
@media (max-width:860px){.bw-hdr-info{display:none}}

.bw-main{padding:var(--sp-5) var(--sp-6) var(--sp-6);padding-left:calc(var(--sp-6) + env(safe-area-inset-left));padding-right:calc(var(--sp-6) + env(safe-area-inset-right));padding-bottom:calc(var(--sp-6) + env(safe-area-inset-bottom));max-width:1240px;margin:0 auto}

/* ── HOME — may be more visual: larger heading, card-style hub tiles ─────────────────────────── */
.bw-h1{font-size:var(--fs-title);font-weight:800;margin:0 0 var(--sp-1);color:var(--ink)}
.bw-home-head{margin-bottom:var(--sp-5)}
.bw-home-sub{font-size:var(--fs-body);color:var(--muted);margin:0}
.bw-section-title{font-size:var(--fs-h);font-weight:700;color:var(--ink);margin:var(--sp-6) 0 var(--sp-3)}

.bw-kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:var(--sp-3)}
/* P0.4 full responsive matrix finding (2026-09-29): confirmed live at 1024x768 (tablet-landscape) a real
   page-level horizontal scrollbar on Fleet Command Center. Root cause: grid items get `min-width:auto`
   by default (the same well-known flexbox quirk, but for grid), so a tile whose CONTENT is wider than its
   assigned column -- here, the disclosed "not yet implemented" placeholder tiles, whose .v slot shows a
   whole word ("Indisponibil"/"Neimplementata") in the same large/bold font meant for a short number --
   overflows its own cell without being allowed to shrink or wrap, inflating the WHOLE row's (and then the
   whole page's) scrollWidth even though visually nothing looked clipped. `min-width:0` lets the grid item
   actually shrink to its column width; `overflow-wrap` lets its long-word content wrap instead of forcing
   the column wider. Affects every KPI row in the app that can carry a longer text value, not just Fleet. */
.bw-kpi{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:var(--sp-4);min-height:84px;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:2px}
.bw-kpi .v{font-size:var(--fs-kpi);font-weight:800;color:var(--ink);line-height:1.1;overflow-wrap:break-word}
.bw-kpi .v.warn{color:#b5601f}
.bw-kpi .v.bad{color:var(--bad)}
.bw-kpi .l{font-size:var(--fs-sec);color:var(--muted);font-weight:600;letter-spacing:.02em}
.bw-kpi-empty{grid-column:1/-1;font-size:var(--fs-sec);color:var(--muted);padding:var(--sp-3) 0}
/* KPI visual hierarchy (Enterprise UX mandate section 5.B, 2026-09-27) -- Project 360's Executive
   Summary used to show 11-20 identically-sized tiles with no way to tell "Cost Actual" apart from
   "Progres Fizic" at a glance. bw-kpi-primary gives the headline financial figures real visual weight
   (larger value text, a subtle accent border) without hiding or removing any secondary data. */
.bw-kpi-primary{border-color:var(--acc);border-width:2px;padding:calc(var(--sp-4) + 2px)}
.bw-kpi-primary .v{font-size:calc(var(--fs-kpi) * 1.3)}
.bw-kpi-group-label{font-size:var(--fs-sec);color:var(--muted);font-weight:700;letter-spacing:.03em;text-transform:uppercase;margin:var(--sp-3) 0 6px}
.bw-kpi-group-label:first-child{margin-top:0}
/* Final Enterprise Web Closure §13 (2026-09-26): real-data-only bar charts, no library, no decoration */
.bw-chart{display:block;width:100%;max-width:480px;height:auto;margin:var(--sp-2) 0}

/* ── C17 Attention Center ("Necesită atenție") — Layer B of the Command Center, real data only.
   Severity is never color-only: every item also carries a plain-text priority label (sev-label). ─── */
.bw-attention{display:flex;flex-direction:column;gap:var(--sp-2);margin-bottom:var(--sp-2)}
.bw-attn-item{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--sp-2);width:100%;text-align:left;background:var(--panel);border:1px solid var(--line);border-left:4px solid #a7b0bc;border-radius:11px;padding:var(--sp-3) var(--sp-4);font:inherit;cursor:default}
button.bw-attn-item{cursor:pointer}
button.bw-attn-item:hover,button.bw-attn-item:focus-visible{border-color:var(--acc);border-left-color:var(--acc);outline:none}
.bw-attn-item.sev-high{border-left-color:var(--bad)}
.bw-attn-item.sev-medium{border-left-color:#b5601f}
.bw-attn-item.sev-low{border-left-color:#8a97a8}
.bw-attn-item .sev-label{flex:none;font-size:10px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}
.bw-attn-item.sev-high .sev-label{color:var(--bad)}
.bw-attn-item.sev-medium .sev-label{color:#b5601f}
.bw-attn-item .t{font-size:var(--fs-body);font-weight:700;color:var(--ink)}
.bw-attn-item .m{font-size:var(--fs-sec);color:var(--muted)}
.bw-attn-item .due{margin-left:auto;flex:none;font-size:var(--fs-sec);color:var(--muted)}
.bw-attn-empty{font-size:var(--fs-body);color:var(--muted);background:var(--panel);border:1px dashed var(--line);border-radius:11px;padding:var(--sp-4);text-align:center}

.bw-hub-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:var(--sp-3)}
.bw-hub{display:flex;flex-direction:column;gap:6px;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:var(--sp-4);cursor:pointer;min-height:112px;transition:box-shadow .15s,border-color .15s}
.bw-hub:hover,.bw-hub:focus-visible{border-color:var(--acc);box-shadow:0 6px 18px rgba(63,95,138,.14);outline:none}
.bw-hub .icon{font-size:24px;line-height:1}
.bw-hub .name{font-size:var(--fs-h);font-weight:700;color:var(--ink)}
.bw-hub .desc{font-size:var(--fs-sec);color:var(--muted);line-height:1.35}
.bw-hub .badge{align-self:flex-start;font-size:11px;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:2px 8px;border-radius:999px;margin-top:2px}
.bw-hub .badge.live{background:#e3f3ea;color:#1c7a45}
.bw-hub .badge.readonly{background:#eaf0f8;color:var(--acc)}
.bw-hub .badge.preview{background:#fdf1e0;color:#b5601f}
.bw-hub .badge.hidden,.bw-hub .badge.blocked{background:#f1f2f4;color:#6b7380}
.bw-hub[aria-disabled="true"]{cursor:not-allowed;opacity:.72}
.bw-hub[aria-disabled="true"]:hover{border-color:var(--line);box-shadow:none}

/* ── C17 EWT Command Center visibility rule: every one of the 23 frozen modules is ALWAYS rendered,
   in its fixed group/position — only the badge + emphasis changes as a module matures (addendum
   "VISUAL CONSISTENCY": same card, same position, only lifecycle state changes). Never color-only:
   each state also carries its own plain-text badge label. ────────────────────────────────────────── */
.bw-hub .badge.construction{background:#fdf1e0;color:#b5601f}
.bw-hub .badge.planned{background:#f1f2f4;color:#6b7380}
.bw-hub.status-in-implementation{opacity:.88}
.bw-hub.status-planned{opacity:.68}
.bw-hub.status-planned .name{color:var(--muted)}
.bw-hub.status-unavailable-for-role{opacity:.72;cursor:not-allowed}
.bw-hub.status-unavailable-for-role:hover{border-color:var(--line);box-shadow:none}

/* ── FULL WORKSPACE — the C15 UX requirement: Hub/Business Object open in the FULL app workspace,
   never a modal/small panel. Not OS fullscreen: Back + breadcrumb + user/session chrome (the .sh-bar
   topbar above) always stay visible. "Extinde" only trims THIS panel's own sub-header for focused
   work — it never touches the topbar's Back/Home/session controls. ─────────────────────────────── */
.bw-workspace{display:flex;flex-direction:column;min-height:calc(100vh - var(--header-h));min-height:calc(100dvh - var(--header-h))}
.bw-ws-header{display:flex;align-items:flex-start;gap:var(--sp-3);padding-bottom:var(--sp-4);margin-bottom:var(--sp-4);border-bottom:1px solid var(--line)}
.bw-ws-back{flex:none;min-height:40px;padding:0 var(--sp-3);border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--ink);font-size:var(--fs-sec);font-weight:600;cursor:pointer}
.bw-ws-back:hover{border-color:var(--acc);color:var(--acc)}
/* P0.4 human-gate live finding (2026-09-28): this button had NO disabled styling at all (unlike
   .sh-btn:disabled elsewhere), so a "Testeaza conexiunea"-style busy state (disabled=true, text swapped
   to "Se testeaza...") looked nearly identical to the normal enabled button -- combined with a fast
   (<50ms) round trip against a local/mocked adapter, this made a real, working action genuinely
   imperceptible as "doing something" to a human clicking it. */
.bw-ws-back:disabled{opacity:.55;cursor:wait}
.bw-ws-headinfo{min-width:0}
.bw-ws-breadcrumb{font-size:var(--fs-sec);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-bottom:2px}
.bw-ws-breadcrumb .seg{color:var(--ink)}
.bw-ws-breadcrumb .sep{margin:0 6px;color:var(--muted)}
/* Clickable breadcrumb segments (Enterprise UX mandate, 2026-09-27) -- a .seg-link is a <button>
   reset to look like the plain text label it replaces, with a hover/focus affordance so it reads as
   navigable; the current (non-link) .seg segment is unchanged, so "you are here" still looks static. */
.seg-link{font:inherit;background:none;border:none;padding:0;margin:0;color:inherit;cursor:pointer;text-decoration:none}
.seg-link:hover,.seg-link:focus-visible{color:var(--acc);text-decoration:underline}
.bw-ws-title{font-size:var(--fs-title);font-weight:800;color:var(--ink);margin:0;line-height:1.2}
.bw-ws-expand{flex:none;min-height:40px;padding:0 var(--sp-3);border:1px solid var(--line);border-radius:9px;background:var(--panel);color:var(--ink);font-size:var(--fs-sec);font-weight:600;cursor:pointer}
.bw-ws-expand:hover{border-color:var(--acc);color:var(--acc)}
body.bw-expanded .bw-ws-header{padding-bottom:var(--sp-2);margin-bottom:var(--sp-3)}
body.bw-expanded .bw-ws-title{font-size:19px}
body.bw-expanded .sh-bar{padding-top:calc(4px + env(safe-area-inset-top));padding-bottom:4px}
.bw-ws-body{flex:1;font-size:var(--fs-body)}

.bw-placeholder{background:var(--panel);border:1px dashed var(--line);border-radius:14px;padding:var(--sp-6);text-align:center;color:var(--muted);font-size:var(--fs-body);max-width:520px;margin:var(--sp-5) auto}
.bw-placeholder strong{color:var(--ink);display:block;font-size:var(--fs-h);margin-bottom:6px}
.bw-desktop-hint{display:inline-block;margin-top:var(--sp-3);font-size:var(--fs-sec);color:var(--acc);background:rgba(111,155,212,.15);padding:6px 12px;border-radius:8px}

/* ── List / detail screens shared by every hub's own business-object view (Phase 6 onward) ─────── */
.bw-toolbar{display:flex;flex-wrap:wrap;gap:var(--sp-2);align-items:center;margin-bottom:var(--sp-4)}
.bw-search{flex:1;max-width:420px;min-height:40px;padding:0 var(--sp-3);border:1px solid var(--line);border-radius:9px;font-size:var(--fs-body);color:var(--ink);background:var(--panel)}
.bw-search:focus{outline:2px solid var(--acc);outline-offset:1px}
.bw-loading,.bw-empty{padding:var(--sp-4) 0;color:var(--muted);font-size:var(--fs-body)}
/* Skeleton loading state (Enterprise UX mandate section 5.C, 2026-09-27) -- a shape-of-the-real-content
   placeholder instead of plain "Se încarcă..." text, for screens whose real layout (KPI tiles, chart
   cards, rows) is known up front. Pure CSS, no library; respects reduced-motion. */
.bw-skeleton-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:var(--sp-3);margin-bottom:var(--sp-3)}
.bw-skeleton-tile,.bw-skeleton-bar{background:linear-gradient(90deg,var(--line) 25%,var(--panel) 50%,var(--line) 75%);background-size:200% 100%;animation:bw-skel-pulse 1.4s ease-in-out infinite;border-radius:10px}
.bw-skeleton-tile{min-height:84px}
.bw-skeleton-bar{height:16px;margin-bottom:8px}
.bw-skeleton-bar:nth-child(2){width:85%}
.bw-skeleton-bar:nth-child(3){width:70%}
@keyframes bw-skel-pulse{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.bw-skeleton-tile,.bw-skeleton-bar{animation:none}}
.bw-count{font-size:var(--fs-sec);color:var(--muted);margin-bottom:var(--sp-2)}
.bw-rows{display:flex;flex-direction:column;gap:6px}
.bw-row{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);width:100%;text-align:left;background:var(--panel);border:1px solid var(--line);border-radius:11px;padding:var(--sp-3) var(--sp-4);min-height:56px;cursor:pointer;font:inherit}
.bw-row:hover,.bw-row:focus-visible{border-color:var(--acc);outline:none}
.bw-row .main{display:flex;flex-direction:column;gap:2px;min-width:0}
.bw-row .t{font-size:var(--fs-body);font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bw-row .m{font-size:var(--fs-sec);color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bw-pill{flex:none;font-size:11px;font-weight:700;letter-spacing:.02em;padding:3px 10px;border-radius:999px;background:#f1f2f4;color:#6b7380}
.bw-pill.live{background:#e3f3ea;color:#1c7a45}
.bw-pill.bad{background:#f8e3e1;color:var(--bad)}
.bw-pill.warn{background:#fdf1e0;color:#b5601f}
.bw-detail-card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:var(--sp-2) var(--sp-5)}
.bw-field-row{display:flex;gap:var(--sp-4);padding:var(--sp-3) 0;border-bottom:1px solid var(--divider)}
.bw-field-row:last-child{border-bottom:0}
.bw-field-row .l{flex:none;width:180px;font-size:var(--fs-sec);color:var(--muted);font-weight:600}
.bw-field-row .v{font-size:var(--fs-body);color:var(--ink);word-break:break-word}
.bw-field-row .v .empty{color:var(--muted)}
@media (max-width:640px){
  .bw-field-row{flex-direction:column;gap:2px}
  .bw-field-row .l{width:auto}
}

/* ── My Work sections (Phase 13) ─────────────────────────────────────────────────────────────── */
.bw-mw-section{margin-bottom:var(--sp-6)}
.bw-mw-section h3{font-size:var(--fs-h);font-weight:700;color:var(--ink);margin:0 0 var(--sp-2)}
.bw-mw-item{padding:var(--sp-2) 0;border-bottom:1px solid var(--divider)}
.bw-mw-item:last-child{border-bottom:0}
.bw-mw-item .t{font-size:var(--fs-body);color:var(--ink)}
.bw-mw-item .m{font-size:var(--fs-sec);color:var(--muted)}
.bw-mw-link{color:var(--acc);text-decoration:none;font-weight:600}
.bw-mw-link:hover{text-decoration:underline}
.bw-mw-desktop{font-size:var(--fs-sec);color:var(--muted);font-style:italic}

/* ── Small, atomic-action affordances (Phase's own §2: confirmations/short lookups stay small) ── */
/* P0.4 full responsive matrix finding (2026-09-29): this overlay is `position:fixed` with no scroll
   affordance of its own, and .bw-sheet had no max-height -- confirmed live at 1366x768 that a
   longer-than-usual sheet (the new Vehicle Edit form, 9 fields) overflows past the fixed overlay's own
   box with no way to scroll to it: page scroll does nothing (the overlay is fixed, not in normal flow),
   and the overlay itself had overflow:visible (nothing to scroll). The Salvează/Renunța buttons were
   provably unreachable -- a real scroll trap, not merely a layout quirk. Any current or future action
   sheet taller than the viewport hits this identically; fixed once here for all of them rather than per-
   form. `overflow-y:auto` on the overlay + a `max-height` on the sheet itself makes the SHEET scroll
   internally when it doesn't fit, the standard modal pattern, while staying pixel-identical for every
   existing shorter sheet (no visible change unless content actually exceeds the viewport).             */
.bw-sheet-overlay{position:fixed;inset:0;background:rgba(20,24,30,.45);display:flex;align-items:center;justify-content:center;padding:var(--sp-4);z-index:80;overflow-y:auto}
.bw-sheet{width:100%;max-width:420px;max-height:calc(100vh - var(--sp-4) * 2);overflow-y:auto;background:#fff;border-radius:14px;padding:var(--sp-5);box-shadow:0 20px 60px rgba(0,0,0,.35)}
.bw-sheet h3{margin:0 0 var(--sp-2);font-size:var(--fs-h);color:var(--dark)}
.bw-sheet p{margin:0 0 var(--sp-4);font-size:var(--fs-body);color:#4f5864;line-height:1.4}
.bw-sheet .row{display:flex;gap:var(--sp-2);justify-content:flex-end}

/* ── Final Enterprise Web Closure §10 (2026-09-26): persistent left navigation ───────────────────
   Desktop-only (≥1024px) addition, deliberately gated at a min-width breakpoint that never overlaps
   any of the existing, already-qualified max-width breakpoints below (860/640/420/340px) -- the
   pre-existing mobile/tablet layout is completely unchanged; a narrower viewport simply never renders
   the sidebar or reserves space for it (own, disclosed scope limit, not a broken responsive state).
   Groups module links WITHOUT duplicating Home's own module grid (mandate's own explicit allowance) --
   collapsed state is a per-viewer convenience remembered in localStorage, never shared/authoritative. */
.bw-sidenav{display:none}
.bw-sidenav-toggle{display:none}
@media (min-width:1024px){
  .bw-sidenav{
    display:block; position:fixed; left:0; top:0; bottom:0; width:220px; overflow-y:auto;
    background:var(--dark); color:#fff; padding:calc(var(--header-h) + var(--sp-3)) 0 var(--sp-4); z-index:30;
    border-right:1px solid rgba(255,255,255,.08);
  }
  body.bw-sidenav-collapsed .bw-sidenav{width:56px}
  body.bw-sidenav-collapsed .bw-sidenav .bw-sn-label{display:none}
  .bw-sidenav .bw-sn-group{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#8a97a8;padding:var(--sp-3) var(--sp-3) var(--sp-1)}
  body.bw-sidenav-collapsed .bw-sidenav .bw-sn-group{display:none}
  .bw-sidenav .bw-sn-item{display:flex;align-items:center;gap:10px;width:100%;padding:8px var(--sp-3);border:0;background:transparent;color:#e8eef6;font-size:13px;text-align:left;cursor:pointer;white-space:nowrap}
  .bw-sidenav .bw-sn-item:hover{background:rgba(255,255,255,.08)}
  .bw-sidenav .bw-sn-item.active{background:rgba(255,255,255,.14);font-weight:600}
  .bw-sidenav-toggle{display:flex;position:fixed;left:8px;bottom:8px;z-index:31;width:32px;height:32px;align-items:center;justify-content:center;border-radius:8px;border:1px solid var(--line);background:var(--panel);color:var(--ink);cursor:pointer}
  .bw-main{margin-left:220px;transition:margin-left .15s ease}
  body.bw-sidenav-collapsed .bw-main{margin-left:56px}
  .sh-bar{padding-left:calc(220px + 14px)}
  body.bw-sidenav-collapsed .sh-bar{padding-left:calc(56px + 14px)}
}

/* ── Responsive: same principle, adapted, never a naive shrink ───────────────────────────────── */
@media (max-width:860px){
  .bw-main{padding:var(--sp-4)}
  .bw-hub-grid{grid-template-columns:repeat(auto-fill,minmax(160px,1fr))}
  .bw-ws-title{font-size:19px}
}
@media (max-width:640px){
  .bw-kpi-row{grid-template-columns:repeat(2,1fr)}
  .bw-hub-grid{grid-template-columns:1fr 1fr}
  .bw-ws-header{flex-wrap:wrap}
  .bw-ws-expand{order:3;margin-left:52px}
}
@media (max-width:420px){
  .bw-kpi-row{grid-template-columns:1fr 1fr}
  .bw-hub-grid{grid-template-columns:1fr}
}
/* C15 Phase 22 (Multi-Device Qualification) — a real, evidenced finding: at extreme-narrow widths
   (confirmed at 264px in the Browser pane, narrower than any common phone in portrait, e.g. iPhone
   SE's 375px) the shared topbar chrome (shell.css, kept byte-identical to the Executive shell's own
   file on purpose — see docs/C15_WEB_SHELL_HOME_HUB.md Sec.1) overflows: icon + title + company name
   + logout button don't all fit. shell.css already hides the username and caps the company-name width
   at <=640px, but not the logout button itself. Fixed here, in THIS shell's own stylesheet only —
   shell.css itself is not touched, so the Executive shell's behavior is completely unaffected. */
@media (max-width:340px){
  .sh-bar .t{display:none}
  .bw-home-btn img{width:24px;height:24px}
  .sh-bar button{padding:0 8px;min-width:0;font-size:11px}
}

/* ── PRINT (P0.2 mandate section 4, 2026-09-27) — Project 360's Export PDF button is a plain
   window.print() of this SAME rendered, already-filtered page (no separate calculation engine, no
   separate PDF-generation code path — on-screen and PDF values reconcile by construction). Generic
   and app-wide on purpose: window.print() has exactly one caller in this app today (Project 360's
   Export PDF), so hiding app chrome/toolbars/navigation whenever ANYTHING in this shell is printed is
   the correct, reusable default rather than a Project-360-specific hack. A future screen that adds its
   own print button inherits this same "clean report, no app chrome" baseline for free. */
@media print{
  /* CONFIRMED FIX (independent UX audit, 2026-09-27): #shell-app hardcodes a DARK theme (--ink near-
     white, --panel near-black -- see this file's own #shell-app rule above) with no print override.
     Every KPI tile/card/chart-text color reads one of those variables, so without resetting them here
     the printed page would show near-black tiles with near-white text on white paper -- the opposite
     of "clean report." Reset to print-safe light values, scoped to #shell-app so the on-screen dark
     theme is completely unaffected outside of printing. */
  #shell-app{--ink:#111;--muted:#555;--panel:#fff;--panel2:#f4f4f4;--line:#ccc;--divider:#ddd;--bg:#fff}
  .sh-bar, #bw-sidenav, #bw-sidenav-toggle, #bw-ws-back, #bw-ws-expand, #bw-home, .bw-toolbar{display:none !important}
  #bw-workspace{display:block !important}
  .bw-ws-header{display:block}
  .bw-ws-headinfo{width:100%}
  .bw-main{padding:0}
  #bw-ws-body{padding:0}
  body{background:#fff;color:#000}
  .bw-detail-card,.bw-kpi-row,.bw-row{box-shadow:none;border:1px solid #ccc}
  .p360-print-header{display:block !important}
  /* Page-break hygiene — never split a KPI tile row, a chart card, or a data row across two pages;
     always start a fresh page before the two long, table-shaped sections. */
  .bw-section-title{break-after:avoid;break-inside:avoid}
  .bw-detail-card,.bw-row,.bw-kpi{break-inside:avoid}
  .p360-print-break{break-before:page}
  a[href]:after{content:""}
}
/* .p360-print-header is part of the normal (on-screen) DOM so its content is always populated from
   the SAME already-filtered `cost`/`project`/`currentFilters` data as the rest of the page — hidden
   on screen (redundant with the visible title/breadcrumb above it) and shown only for print/PDF. */
.p360-print-header{display:none}
/* Standard visually-hidden pattern (Chart quality mandate, 2026-09-28) -- used for the textual
   label:value fallback list next to each Chart.js canvas (a <canvas> carries no text a screen reader
   can read on its own; this keeps the real numbers available to assistive tech without duplicating
   them visually for sighted users). Hidden on screen, but still selectable/printable if ever needed. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Chart.js canvas container (Chart quality mandate, 2026-09-28) -- Chart.js needs an explicitly-sized
   parent to compute responsive width/height against; a bare <canvas> with no sized wrapper collapses
   to 0 height. Fixed height chosen to comfortably fit up to ~10 horizontal bars with labels. */
.bw-chartjs-wrap{position:relative;height:280px;max-width:640px}
@media print{.bw-chartjs-wrap{height:220px;max-width:100%;break-inside:avoid}}
/* Searchable Enterprise selectors (mandate item 1, 2026-09-28) -- a lightweight, dependency-free
   type-ahead: text input + absolutely-positioned dropdown, clear button, keyboard-navigable options.
   VISUAL CONSISTENCY FIX (mandate item 7, 2026-09-28, independent UX audit finding: "a smaller
   near-clone of .bw-search rather than reusing it") -- height/radius/border/focus/hover now byte-
   identical to .bw-search (the existing shell-wide search-input treatment), never a separate value. */
.p360-lookup-input{min-height:40px;padding:0 28px 0 var(--sp-3);border:1px solid var(--line);border-radius:9px;font-size:var(--fs-body);color:var(--ink);background:var(--panel)}
.p360-lookup-input:focus{outline:2px solid var(--acc);outline-offset:1px}
.p360-lookup-clear{position:absolute;right:6px;top:50%;transform:translateY(-50%);border:none;background:none;color:var(--muted);font-size:16px;line-height:1;cursor:pointer;padding:2px 4px;border-radius:4px}
.p360-lookup-clear:hover{color:var(--bad);background:var(--panel2)}
.p360-lookup-clear:focus-visible{outline:2px solid var(--acc);outline-offset:1px}
.p360-lookup-dropdown{position:absolute;top:100%;left:0;right:0;z-index:20;background:var(--panel);border:1px solid var(--line);border-radius:9px;margin-top:2px;max-height:220px;overflow-y:auto;box-shadow:0 4px 14px rgba(0,0,0,.25)}
.p360-lookup-option{display:block;width:100%;text-align:left;padding:7px 10px;border:none;background:none;color:var(--ink);font-size:var(--fs-body);cursor:pointer}
.p360-lookup-option:hover,.p360-lookup-option.active{background:var(--panel2)}
.p360-lookup-option:focus-visible{outline:2px solid var(--acc);outline-offset:-2px}
.p360-lookup-empty{padding:8px 10px;color:var(--muted);font-size:var(--fs-sec)}
@media print{.p360-lookup-dropdown{display:none !important}}
/* VISUAL CONSISTENCY (mandate item 7) -- <select> elements inside a toolbar (the pre-existing Payment/
   Lifecycle/Scope filter selects, and the new pagination page-size select below) previously had zero
   shell styling at all (this app never defined a generic `select` rule) -- now share the SAME height/
   radius/border/focus treatment as .bw-search/.p360-lookup-input, not a 3rd, uncontrolled visual idiom. */
.bw-toolbar select{min-height:40px;padding:0 var(--sp-3);border:1px solid var(--line);border-radius:9px;font-size:var(--fs-body);color:var(--ink);background:var(--panel)}
.bw-toolbar select:focus-visible{outline:2px solid var(--acc);outline-offset:1px}
.bw-toolbar select:disabled,.bw-toolbar button:disabled{opacity:.5;cursor:not-allowed}
/* Information architecture -- tabs (mandate item 2, 2026-09-28) -- CONFIRMED FIX for an independent UX
   audit finding: "one extremely long scrolling page is not acceptable at this feature density."
   Executive Summary/Filters/toolbar stay OUTSIDE these tabs (always visible); everything else is
   organized into the mandate's own recommended sections, one visible at a time on screen. */
.bw-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid var(--line);margin-bottom:var(--sp-3)}
.bw-tab-btn{padding:8px 14px;border:none;border-bottom:3px solid transparent;background:none;color:var(--muted);font-size:var(--fs-body);font-weight:600;cursor:pointer;white-space:nowrap}
.bw-tab-btn:hover{color:var(--ink)}
.bw-tab-btn.active{color:var(--acc);border-bottom-color:var(--acc)}
/* Accessibility (mandate item 8, 2026-09-28): a visible keyboard focus ring -- Tab-key navigation
   between tab buttons must be visually traceable, same outline treatment as every other interactive
   control on this screen (.p360-lookup-input/select above), never a color-only or invisible state. */
.bw-tab-btn:focus-visible{outline:2px solid var(--acc);outline-offset:-2px;border-radius:4px}
.bw-tab-panel{animation:none}
@media (max-width:640px){.bw-tabs{overflow-x:auto;flex-wrap:nowrap;-webkit-overflow-scrolling:touch}}
/* Printing must show the FULL report (every tab's content together), not just whichever tab happens to
   be selected on screen -- the tab strip itself is a screen-only navigation aid. */
@media print{
  .bw-tabs{display:none !important}
  .bw-tab-panel{display:block !important}
  .bw-tab-panel[data-tab]:not([data-tab="overview"]){break-before:page}
  /* Forcing every tab panel visible for print (above) means the Allocated Expenses / Internal Costs /
     Documents-Sources tabs' own ON-SCREEN row lists are all now PAGINATED (one page of up to 100 rows
     each, not the full ledger) -- printing them as-is would silently show only whatever page happened
     to be loaded. ALL THREE are skipped from print; the real print content is .p360-print-full-ledger
     below, the complete, unbounded filtered result set fetched fresh at Export PDF click time (CONFIRMED
     FIX, independent final UX audit, 2026-09-28: "PDF/print export now silently truncates the
     Documents/Sources ledger to one page ... zero on-page indication anything was cut off"). */
  .p360-print-skip{display:none !important}
  .p360-print-full-ledger{display:block !important}
}
/* .p360-print-full-ledger starts empty and hidden on screen -- populated by Export PDF's own click
   handler (never stale data from a previous export, since it's rebuilt fresh every click), or by a
   'beforeprint' fallback for Ctrl+P/the browser's own print icon (see app.js); never shown on screen
   at all, only under @media print above. */
.p360-print-full-ledger{display:none}
