/* Step 213: shared top quick-command strip across the actual application pages. */
#main-app .ld166-page > .ld213-commands {display:flex;justify-content:flex-end;align-items:center;gap:7px;flex-wrap:wrap;padding:10px 15px 1px;min-height:46px;position:relative;z-index:3;color:var(--ld166-text,#eaf7ff)}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-commands {color:#102b45}
#main-app .ld213-cmd {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:35px;padding:8px 13px!important;font:800 11px/1.15 inherit;letter-spacing:.15px;white-space:nowrap;border-radius:8px;border:1px solid var(--ld166-border,#168ec3);color:var(--ld166-text,#eaf7ff);background:var(--ld166-panel,#0a3049);box-shadow:none!important;text-decoration:none;cursor:pointer}
#main-app .ld213-cmd:hover,#main-app .ld213-cmd:focus-visible {border-color:#09bdf1;outline:2px solid transparent;background:var(--ld166-soft,#0c4262)}
#main-app .ld213-cmd-primary{background:linear-gradient(180deg,#0ec1f1,#087fcf)!important;color:#fff!important;border-color:#11b4ee!important}
#main-app .ld213-cmd-primary:hover{background:linear-gradient(180deg,#00d1fc,#0468bf)!important}
#main-app .ld213-cmd-icon{font-size:14px;font-weight:700;line-height:1}
#main-app .ld213-menu{position:relative}
#main-app .ld213-menu>summary{list-style:none;user-select:none}
#main-app .ld213-menu>summary::-webkit-details-marker{display:none}
#main-app .ld213-menu[open]>summary{border-color:#0ebdf1}
#main-app .ld213-menu-list{position:absolute;right:0;top:calc(100% + 5px);min-width:200px;z-index:200;display:grid;gap:3px;background:var(--ld166-panel,#0b2841);border:1px solid var(--ld166-border,#168ec3);box-shadow:0 12px 25px #0005;border-radius:10px;padding:7px}
#main-app .ld213-menu-list button{width:100%;display:flex;justify-content:flex-start;background:transparent!important;border:0!important;color:var(--ld166-text,#eaf7ff)!important;min-height:35px;padding:9px 11px;text-align:left;border-radius:6px;font-size:12px;font-weight:700;cursor:pointer}
#main-app .ld213-menu-list button:hover{background:var(--ld166-soft,#0e3b55)!important}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-cmd:not(.ld213-cmd-primary){background:#fff!important;border-color:#bfd8ed!important;color:#13314b!important}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-cmd:not(.ld213-cmd-primary):hover{background:#eaf5ff!important;border-color:#158dcc!important}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-menu-list{background:#fff!important;border-color:#bfd8ed!important;box-shadow:0 14px 30px #172e4925}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-menu-list button{color:#102b45!important}
#main-app .ld166-shell[data-ld166-theme="day"] .ld213-menu-list button:hover{background:#ebf5ff!important}
/* All original per-page actions still work; avoid repeating the new global shortcuts. */
#main-app .ld166-shell.ld213-enabled > .ld166-page > .ld166-header [data-ld166-action="add-vehicle"],
#main-app .ld166-shell.ld213-enabled > .ld166-page > .ld166-header [data-ld166-action="add-investment-vehicle"],
#main-app .ld166-shell.ld213-enabled > .ld166-page > .ld166-header [data-ld166-route="checks"],
#main-app .ld166-shell.ld213-enabled > .ld166-page > .ld166-header [data-ld166-action="scan"]{display:none!important}
@media(max-width:800px){#main-app .ld166-page > .ld213-commands{justify-content:flex-start;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:thin;max-width:100%;padding:8px 10px;min-height:44px}#main-app .ld213-cmd{font-size:10px;padding:8px 10px!important}#main-app .ld213-menu-list{position:fixed;right:10px;top:auto;max-width:calc(100vw - 20px)}}
@media print{#main-app .ld213-commands{display:none!important}}

/* Legacy non-shell pages also receive the same commands, replacing only old duplicated quick buttons. */
#main-app #content > .ld213-legacy-bar{display:flex;justify-content:flex-end;align-items:center;gap:7px;flex-wrap:wrap;padding:9px 14px;background:var(--panel,#0a3049);border-bottom:1px solid #176a99;color:#eaf7ff;position:relative;z-index:15}
#main-app #content > .ld213-legacy-bar .ld213-cmd{color:#eaf7ff;background:#0e2f48}
#main-app #content > .ld213-legacy-bar[data-ld166-theme=day]{background:#f3f8fc;color:#102b45;border-color:#bad6ed}
#main-app #content > .ld213-legacy-bar[data-ld166-theme=day] .ld213-cmd:not(.ld213-cmd-primary){background:#fff;color:#102b45;border-color:#bad6ed}
#main-app #content > .ld213-legacy-bar[data-ld166-theme=day] .ld213-menu-list{background:#fff;border-color:#bad6ed}
#main-app #content > .ld213-legacy-bar[data-ld166-theme=day] .ld213-menu-list button{color:#102b45!important}
#main-app:has(#content > .ld213-legacy-bar) .topbar .top-actions{display:none!important}
@media(max-width:800px){#main-app #content > .ld213-legacy-bar{justify-content:flex-start;flex-wrap:nowrap;overflow-x:auto;padding:8px 10px}}

/* Step 342: mobile command controls wrap instead of disappearing off-screen. */
@media screen and (max-width:800px){
 #main-app .ld166-page > .ld213-commands,#main-app #content > .ld213-legacy-bar{box-sizing:border-box;flex-wrap:wrap!important;overflow:visible!important;max-width:100%;min-width:0;justify-content:flex-start;gap:6px;padding:8px 10px}
 #main-app .ld213-cmd{min-height:44px;white-space:normal;max-width:100%;box-sizing:border-box}
 #main-app .ld213-menu-list{position:absolute;top:calc(100% + 5px);right:0;min-width:0;width:min(245px,calc(100vw - 24px));max-height:50dvh;overflow:auto;box-sizing:border-box}
 #main-app .ld213-menu-list button{min-height:44px;white-space:normal}
 /* Anchor the menu to the command strip so it fits even when More wraps left. */
 #main-app .ld213-menu{position:static}
}

/* Step 465-ui4 (F15): command strip must never sit under another layer on desktop.
   Overview landing (#ld133-home, fixed full-screen chooser) already hides the strip visually; take it out of hit-testing/AT while the landing is up. */
body.ld133-home-visible #main-app .ld213-commands{visibility:hidden}
/* Reports opens its own fixed .ld212-reports-shell (z-index 5) inside the management shell, which painted over the strip (z-index 3).
   Lift the strip above it with an opaque background and push the Reports page below it so header/search are not overlapped. */
#main-app .ld166-page:has(> .ld362-management-content .ld212-reports-shell) > .ld213-commands{z-index:6;background:var(--ld166-bg)}
#main-app .ld362-management-content .ld212-reports-shell > .ld212-reports-page{padding-top:62px}
/* The management page header underneath (its own Night toggle/search) is fully covered by the Reports shell; take that hidden duplicate out of hit-testing/AT. Reports keeps its own visible header tools. */
#main-app .ld166-page:has(> .ld362-management-content .ld212-reports-shell) > .ld166-header{visibility:hidden}

/* Step 465-ui5 (D): on Reports the management shell's own sidebar sits fully underneath the Reports layer and duplicated every nav entry
   (incl. a second, unclickable "Master Administration"). Remove that hidden copy from hit-testing and the accessibility tree;
   the Reports layer keeps its own sidebar. */
#main-app .ld166-shell.ld362-management-shell:has(> .ld166-page > .ld362-management-content .ld212-reports-shell) > .ld166-sidebar{visibility:hidden}
