
    /* Modal Container */
    .start-modal-container {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 400px;
        max-width: 90vw;
        background: white;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1050;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
        /* Promote to its own GPU layer so the slide is smooth, not janky. */
        will-change: transform;
        backface-visibility: hidden;
        opacity: 0;
        visibility: hidden;
    }
    .start-modal-container.show {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }

    /* Overlay */
    .modal-overlay {
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.15s ease, visibility 0.15s ease;
        /* No backdrop-filter blur: it forces a full-page re-render every frame
           while sliding, which makes the panel feel stuck/slow on heavy pages. */
    }
    .modal-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Header */
    .menu-header {
        padding: 15px;
        background: var(--mk-slate-50-2);
        border-bottom: 1px solid var(--mk-slate-200-6);
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    }
    .menu-title {
        font-size: 18px;
        font-weight: bold;
        color: var(--mk-slate-900-8);
    }

    /* Sections — show immediately with the panel (no second delayed fade that
       made the content lag behind the slide). */
    .menu-sections-container {
        padding: 15px;
    }

    /* Header dropdown rows match the module side drawer: compact rounded pills with
       a small colour-tinted icon tile (Contacts, HRM, Marketing, Expenses, Inventory,
       Purchases, Reports, Sales, Logistics, Settings, Franchisor). The tint colour is
       assigned per row by the shared script in javascripts.html; these are the
       fallbacks. Works for both the <i> and <img loading="lazy" decoding="async"> flavours of .recommended-icon. */
    .menu-sections-container .menu-section a {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 2px 4px;
        padding: 9px 12px;
        border-radius: 12px;
        font-size: 14px;
        color: var(--mk-gray-800);
        text-decoration: none;
        transition: background .15s ease, color .15s ease;
    }
    .menu-sections-container .menu-section a:hover { background: var(--mk-blue-100); color: var(--mk-gray-950); }
    /* The page you are on, filled in the business theme colour. */
    .menu-sections-container .menu-section a.is-current {
        /* themeFrom/themeTo are the resolved header gradient — business.theme_color
           is a name like "blue", which CSS would render as pure #0000ff. */
        background: linear-gradient(to right, #1e40af, #1e3a8a);
        color: var(--mk-white);
        font-weight: 600;
    }
    /* the icon keeps its own colours on the page you are on (owner 2026-11-12: "why it shows white in the selected
       item": the tile went see-through and its picture pure white -- a blank square); a white ring marks it */
    /* ...marked by a soft white glow that follows the picture's rounded shape, not a ring round its square box
       (owner 2026-11-13: "why it shows a square round the icon of the active item") */
    .menu-sections-container .menu-section a.is-current .recommended-icon { box-shadow: none !important; }
    .menu-sections-container .menu-section a.is-current .recommended-icon > img { filter: drop-shadow(0 0 2px rgba(255,255,255,.85)) !important; }
    .menu-sections-container .recommended-icon {
        width: 28px !important;
        height: 28px !important;
        flex-shrink: 0;
        background: var(--mk-blue-100);
        border: 0;
        border-radius: 8px;
        color: var(--mk-slate-600-2);
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        transition: background .18s ease, transform .18s ease;
    }
    .menu-sections-container img.recommended-icon { padding: 4px; object-fit: contain; }
    .menu-sections-container .recommended-icon i { font-size: 15px !important; color: inherit; }
    .menu-sections-container a:hover .recommended-icon { transform: translateY(-1px); }
    .menu-sections-container .menu-section-title {
        padding: 12px 12px 6px;
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--mk-slate-400);
    }
    .menu-sections-container .menu-section + .menu-section {
        border-top: 1px solid var(--mk-slate-100-15);
        margin-top: 4px;
    }
    /* Home is the way out of a section, so it sits above a rule of its own —
       in the panels it shares a section with the rest, hence the explicit line. */
    .menu-sections-container .menu-section a[href="/desktop"] {
        border-bottom: 1px solid var(--mk-slate-100-15);
        border-radius: 12px 12px 0 0;
        margin-bottom: 6px;
        padding-bottom: 12px;
        font-weight: 600;
    }

    /* Items */
    .menu-item {
        display: flex;
        align-items: center;
        padding: 10px 12px;
        border-radius: 6px;
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        color: var(--mk-slate-900-10);
        text-decoration: none;
        margin-bottom: 4px;
        background: white;
        border-left: 3px solid transparent;
    }
    .menu-item:hover {
        background-color: var(--mk-slate-100-24);
        transform: translateX(3px);
        border-left: 3px solid blue;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .menu-item-icon {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        flex-shrink: 0;
        transition: transform 0.2s ease;
    }
    .menu-item:hover .menu-item-icon {
        transform: scale(1.1);
    }

    /* Close Button */
    .modal-close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
        color: var(--mk-slate-600-4);
        padding: 0 5px;
        line-height: 1;
        border-radius: 50%;
        transition: all 0.2s ease;
    }
    .modal-close-btn:hover {
        color: var(--mk-slate-800-9);
        background-color: var(--mk-slate-200-6);
        transform: rotate(90deg);
    }

    /* Scrollbar */
    .start-modal-container::-webkit-scrollbar { width: 6px; }
    .start-modal-container::-webkit-scrollbar-track { background: var(--mk-gray-100-9); }
    .start-modal-container::-webkit-scrollbar-thumb {
        background: blue;
        border-radius: 3px;
    }

     @media (max-width: 576px) {
        .start-modal-container { width: 85vw; }
        .menu-item { padding: 10px; }
    }

    /* The .dt-footer rules that used to sit here now live in
       layouts/partials/css/datatables.html, next to the DataTables stylesheets they
       belong with, so module_base.html's pages get them too. */

    /* Sidebar menu style: keep the taskbar on screen while the content scrolls.

       .thetop is the row that holds the sidebar and <main>. Nothing capped its height,
       so it grew to its content (measured 1706px inside a 900px body); the BODY became
       the scroller and carried the sticky taskbar off the top, while
       #scrollable-container — the element actually meant to scroll, hence its
       overflow-y:auto — never scrolled at all.

       Capping .thetop at the viewport, plus min-height:0 on the two flex children so
       they may shrink below their content, hands the scrolling back to
       #scrollable-container and leaves the taskbar fixed, like the other menu styles.
       min-height:0 is required: a flex child defaults to min-height:auto and would
       otherwise refuse to shrink. */
    /* ---- Settings ▸ Menu Style ▸ Search (2026-09-30) ----------------------
       No launcher: the search screen (/desktop) is where you start, and the logo in
       the middle of the bar takes you back to it. The module's own tabs on the left
       stay, so a person can still move around inside Sales or Stock; on the right only
       the profile menu is kept (`pm-profile`, layouts/partials/profile_menu.html). */
    body.hd-nav-search #center-menu-launcher,
    body.hd-nav-search #main-taskbar .side-bar-collapse,
    body.hd-nav-search #mac-dock,
    body.hd-nav-wheel #center-menu-launcher,
    body.hd-nav-wheel #main-taskbar .side-bar-collapse,
    body.hd-nav-wheel #mac-dock { display: none !important; }
    /* …but not the page's own Filter and Actions buttons (filter_style.html / mobile_actions.html):
       on a phone they are the only way to Add / Import / filter (owner 2026-11-08: /follow-up
       showed no Add button on mobile -- this rule out-specified their own keep rule) */
    body.hd-nav-search #main-taskbar#main-taskbar .tb-right > *:not(details.pm-profile):not(.mkf-on-bar),
    body.hd-nav-wheel #main-taskbar#main-taskbar .tb-right > *:not(details.pm-profile):not(.mkf-on-bar) {
        display: none !important;
    }
    /* …and the profile survives every section's focus mode: each section menu hides the
       whole right cluster with one #main-taskbar (see the note on `.tbs` in
       taskbar.html), and on this shell the profile is the only way to your account. */
    body.hd-nav-search:not(.side-drawer-open) #main-taskbar#main-taskbar .tb-right > details.pm-profile,
    body.hd-nav-wheel:not(.side-drawer-open) #main-taskbar#main-taskbar .tb-right > details.pm-profile {
        display: inline-block !important;
    }

    /* Plus / Minus: the main menu as an icon rail down the left side, always there (owner 2026-11-12: "I want the
       side bar menu main ... put it in the left side, icons"). 72px of section icons under the bar; pointing at it
       widens it over the page with the names, and a section opens its pages as in the sidebar. */
    /* Plus / Minus: the main menu slides out from the left (owner 2026-11-12: "small handle and auto hide"). Hidden
       behind a small handle on the left edge; pointing at the handle (or tapping it) slides the whole menu out, and
       it hides again by itself a moment after the pointer leaves (layouts/partials/menu.html, the rail script). */
    body.hd-nav-pill #sidebar { display: flex !important; width: 280px !important;
        top: 40px !important; height: calc(100% - 40px) !important; overflow: hidden; z-index: 1035 !important;
        border-right: 1px solid rgba(15,23,42,.08); border-radius: 0 16px 16px 0;
        transform: translateX(-104%) !important; box-shadow: none;
        transition: transform 1.1s cubic-bezier(.45,0,.2,1), box-shadow 1.1s ease; }
    /* the Sidebar style's own .25s slide (body.hd-nav-sidebar #sidebar.side-bar) also matches here: outranked */
    body.hd-nav-pill.hd-nav-sidebar #sidebar.side-bar { transition: transform 1.1s cubic-bezier(.45,0,.2,1), box-shadow 1.1s ease; }
    body.hd-nav-pill #sidebar.rail-open { transform: none !important; box-shadow: 10px 0 34px rgba(15,23,42,.22);
        transition: transform 1.3s cubic-bezier(.22,.9,.24,1), box-shadow 1.3s ease; }     /* slower still (owner 2026-11-12) */
    body.hd-nav-pill.hd-nav-sidebar #sidebar.side-bar.rail-open { transition: transform 1.3s cubic-bezier(.22,.9,.24,1), box-shadow 1.3s ease; }
    body.hd-nav-pill:has(#pm-home) #sidebar, body.hd-nav-pill.wheel-home #sidebar { top: 0 !important; height: 100% !important; }
    /* Plus / Minus and Arimako: a section row opens its dashboard, so it has no open / close arrow (owner 2026-11-14) */
    #sidebar .drop_down.pm-dash-link > .svg { display: none !important; }
    /* …and the sidebar is see-through and frosted: the page shows behind it (owner 2026-11-14) */
    body.hd-nav-sidebar:not(.hd-nav-pill) #sidebar.side-bar, body.hd-nav-pill.hd-nav-wheel #sidebar.side-bar {
        background: rgba(255,255,255,.55) !important;
        -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
        border-right: 1px solid rgba(255,255,255,.45); }
    body.hd-nav-sidebar:not(.hd-nav-pill) #sidebar .sb-back, body.hd-nav-pill.hd-nav-wheel #sidebar .sb-back {
        background: rgba(255,255,255,.45) !important; }
    body.hd-nav-pill #sidebar #side-bar { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
    body.hd-nav-pill #sidebar #side-bar::-webkit-scrollbar { display: none; }
    /* Settings stays in sight at the foot of the list */


    /* the handle: a small frosted tab on the left edge, half way down; it steps aside while the menu is out */
    #pm-rail-handle { display: none; }
    body.hd-nav-pill #pm-rail-handle { display: flex; position: fixed; left: 0; top: 50%; z-index: 1034; width: 16px; height: 72px;
        margin-top: -36px; align-items: center; justify-content: center; border: 0; padding: 0; cursor: grab; touch-action: none;
        border-radius: 0 12px 12px 0; color: #fff; background: rgba(15,23,42,.22);   /* see-through glass (owner 2026-11-13) */
        -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 2px 0 10px rgba(15,23,42,.18);
        transition: width .25s ease, background-color .25s ease, opacity .3s ease, transform .3s ease; }
    body.hd-nav-pill #pm-rail-handle:hover, body.hd-nav-pill #pm-rail-handle:focus-visible { width: 22px; background: rgba(15,23,42,.45); outline: none; }
    body.hd-nav-pill #pm-rail-handle i { font-size: 11px; }
    body.hd-nav-pill.pm-rail-on #pm-rail-handle { opacity: 0; transform: translateX(-100%); pointer-events: none; }
    /* the welcome after a sign-in (menu.html): a slower slide away, then the handle waves and glows */
    body.hd-nav-pill.hd-nav-sidebar #sidebar.side-bar.rail-intro-out, body.hd-nav-pill #sidebar.rail-intro-out { transition: transform 1.8s cubic-bezier(.45,0,.2,1), box-shadow 1.8s ease !important; }
    body.hd-nav-pill #pm-rail-handle.rail-hint { animation: pmRailHint 1.2s ease-in-out 3; }
    @keyframes pmRailHint {
        0%, 100% { width: 16px; background: rgba(15,23,42,.38); box-shadow: 2px 0 10px rgba(15,23,42,.18); }
        30% { width: 26px; background: rgba(79,70,229,.85); box-shadow: 0 0 0 6px rgba(129,140,248,.35), 2px 0 14px rgba(79,70,229,.5); }
        55% { width: 18px; }
        75% { width: 24px; background: rgba(79,70,229,.7); }
    }
    body.hd-nav-pill #pm-rail-handle.rail-hint i { animation: pmRailHintArrow 1.2s ease-in-out 3; }
    @keyframes pmRailHintArrow { 0%, 100% { transform: none; } 30%, 75% { transform: translateX(3px); } }
    body.hd-nav-pill #mk-edge-handle { display: none !important; }
    /* Settings lives in the sidebar now (layouts/partials/menu.html .sb-settings): not in the bar as well
       (owner 2026-11-12: "I don't want it on the top of the taskbar any more") */
    body.hd-nav-sidebar #main-taskbar#main-taskbar a#startMenuButton[href="/settings/section-dashboard"] { display: none !important; }
    /* on the Plus / Minus home it is frosted glass over the picture */
    /* glass on every page (owner 2026-11-12: "why is that blur only on the desktop, I want it on every page") */
    body.hd-nav-pill #sidebar { background: rgba(255,255,255,.55) !important;
        -webkit-backdrop-filter: blur(16px) saturate(1.25); backdrop-filter: blur(16px) saturate(1.25); border-right-color: rgba(255,255,255,.45); }
    body.hd-nav-pill #sidebar .sb-back { background: rgba(255,255,255,.55) !important; }
    body.hd-nav-pill #sidebar a.drop_down:hover, body.hd-nav-pill #sidebar .sb-settings:hover,
    body.hd-nav-pill #sidebar a.drop_down.active, body.hd-nav-pill #sidebar .sb-back:hover { background: rgba(255,255,255,.6) !important; }
    body.hd-nav-pill #sidebar .chiled, body.hd-nav-pill #sidebar .chiled * { background-color: transparent; }
    body.hd-nav-pill #sidebar .sb-settings:not(:hover):not(.is-on) { background: transparent !important; -webkit-backdrop-filter: none; backdrop-filter: none; }

    /* ---- the top bar (owner 2026-11-12) ----
       No Back arrow on any page ("I don't want the back button on the top of every page"): Back is the menu's own
       first row. The buttons on the right: one size, one gap, every icon the same size and none with a ring
       ("make the gaps nicer and the same, the icons the same size; if no border, the same for all"). */
    #main-taskbar#main-taskbar#main-taskbar .tb-left > .tb-back, #main-taskbar#main-taskbar#main-taskbar .tb-back { display: none !important; }
    #main-taskbar#main-taskbar .tb-right { gap: 10px !important; padding-right: 12px; }
    /* three ids: taskbar.html shows these with :is(…, #tb-clock), which counts as an id */
    #main-taskbar#main-taskbar#main-taskbar .tb-right > .tb-pins:not(:has(> a)),
    body.hd-nav-sidebar #main-taskbar#main-taskbar#main-taskbar .tb-right > .start-menu-wrapper:has(> #startMenuButton):not(:has(> a:not(#startMenuButton))) { display: none !important; }
    #main-taskbar#main-taskbar .tb-right > .tbs, #main-taskbar#main-taskbar .tb-right > a,
    #main-taskbar#main-taskbar .tb-right > details.pm-profile, #main-taskbar#main-taskbar .tb-right > .start-menu-wrapper,
    #main-taskbar#main-taskbar .tb-right > li.notifications-menu {
        width: 34px; height: 34px; min-width: 34px; margin: 0 !important; padding: 0 !important;
        display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; }
    #main-taskbar#main-taskbar .tb-right > * > a, #main-taskbar#main-taskbar .tb-right > details > summary {
        padding: 0 !important; margin: 0 !important; display: inline-flex; align-items: center; justify-content: center; }
    /* the bar's own buttons only -- not the pictures inside a menu that opens from them (the profile grid) */
    #main-taskbar#main-taskbar .tb-right > * > img, #main-taskbar#main-taskbar .tb-right > * > a > img,
    #main-taskbar#main-taskbar .tb-right > details > summary > img, #main-taskbar#main-taskbar .tb-right > .tbs .tbs-btn > img {
        width: 28px !important; height: 28px !important; min-width: 0 !important; max-width: 28px !important;
        box-shadow: none !important; border: 0 !important; object-fit: cover; }

    /* ---- the same top bar on module pages (layouts/module_taskbar.html, .module-topbar), owner 2026-11-12 ---- */
    body .module-topbar .mtb-back { display: none !important; }
    body.hd-nav-sidebar .module-topbar .start-menu-wrapper:has(> #startMenuButton) { display: none !important; }
    body .module-topbar > .tbs { margin-right: 8px !important; }   /* + the bar's own 2px = 10px */
    body .module-topbar .mtb-btns { display: inline-flex; align-items: center; gap: 10px !important; padding-right: 12px; }
    body .module-topbar > .tbs, body .module-topbar .mtb-btns > a, body .module-topbar .mtb-btns > details.pm-profile,
    body .module-topbar .mtb-btns > .start-menu-wrapper, body .module-topbar .mtb-btns > li.notifications-menu {
        width: 34px; height: 34px; min-width: 34px; margin: 0; padding: 0 !important;
        display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; }
    body .module-topbar .mtb-btns > * > a, body .module-topbar .mtb-btns > details > summary, body .module-topbar .tbs-btn {
        padding: 0 !important; margin: 0 !important; display: inline-flex; align-items: center; justify-content: center;
        width: 34px !important; height: 34px !important; min-width: 0 !important; }
    body .module-topbar .mtb-btns > * > img, body .module-topbar .mtb-btns > * > a > img,
    body .module-topbar .mtb-btns > details > summary > img, body .module-topbar .tbs-btn > img {
        width: 28px !important; height: 28px !important; min-width: 0 !important; max-width: 28px !important;
        box-shadow: none !important; border: 0 !important; object-fit: cover; }
    /* search open: wide, the other buttons step aside */
    body .module-topbar > .tbs.is-open { width: auto !important; min-width: 0 !important; flex: 0 1 auto !important; }
    body .module-topbar:has(> .tbs.is-open) .mtb-btns { display: none !important; }
    body .module-topbar .tbs.is-open .tbs-input { width: min(560px, 52vw); }
    body .module-topbar .tbs-drop { left: 0; right: auto; width: 100%; min-width: 320px; max-width: min(600px, 94vw); max-height: min(520px, 70vh); }
    body .module-topbar .tbs-drop.is-open { animation: tbsSlideIn .38s cubic-bezier(.22,.9,.24,1); }
    body .module-topbar .tbs-row { padding: 11px 12px; gap: 12px; font-size: 14px; border-radius: 10px; min-height: 52px; }
    body .module-topbar .tbs-tile, body .module-topbar .tbs-tile-img { width: 34px; height: 34px; flex-basis: 34px; border-radius: 10px; font-size: 15px; }
    /* the menu sits under this bar */
    body.hd-nav-pill.mk-module-page #sidebar { top: 46px !important; height: calc(100% - 46px) !important; }

    body.hd-nav-sidebar .thetop { height: 100vh; overflow: hidden; }
    body.hd-nav-sidebar main,
    body.hd-nav-sidebar #scrollable-container { min-height: 0; }

    /* The drawer OVERLAYS the page; it does not push it.

       It used to be a plain flex item inside .thetop, so showing it took 16rem away
       from <main> and the whole page re-flowed underneath — tables re-measured, the
       desktop icon grid re-wrapped, and every open/close jumped the content sideways.
       Taking it out of the flow (position:fixed) and sliding it in on transform means
       nothing behind it moves: the drawer floats above the page and the taskbar.

       display:flex !important is deliberate. The markup carries Tailwind's tw-hidden
       (display:none) as its closed state, and the old toggle animated the element's
       `display` with an inline style; the open/closed state is now the
       body.side-drawer-open class alone, so both of those must lose. Off-screen at
       translateX(-100%) is what "closed" means now.

       The transition is intentionally NOT !important — partials/effects.html turns it
       off for .side-bar when the Animation Style setting has window effects disabled,
       and that rule has to win. */
    body.hd-nav-sidebar #sidebar.side-bar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        /* Wider than the 16rem the markup's tw-w-64 asks for: the menu rows are a 60px
           icon plus a label, and at 16rem the longer Khmer labels wrapped or truncated.
           The phone override below throws this away for full-bleed anyway. */
        width: 20rem; max-width: 85vw;
        height: auto;
        display: flex !important;
        flex-direction: column;
        /* visible, not auto: the close handle deliberately sticks out of the right
           edge, and the inner #side-bar div is the scroller (below). */
        overflow: visible;
        transform: translateX(-100%);
        transition: transform .25s ease-out;
        will-change: transform;
        /* Above the sticky taskbar (z-50) and the backdrop, below a Bootstrap modal
           (1050) so a dialog opened from a menu link still covers it. */
        z-index: 1045;
        box-shadow: 0 10px 30px rgba(15, 23, 42, .25);
    }
    body.hd-nav-sidebar.side-drawer-open #sidebar.side-bar { transform: none; }

    /* Phone: the drawer takes the whole screen. At 16rem it left a ~130px strip of
       dimmed page down the side that was too narrow to read and, sitting under the
       backdrop, could not be touched anyway.

       right:0 with width:auto, not width:100vw — 100vw counts the scrollbar gutter on
       the browsers that reserve one and would hang the drawer past the right edge. The
       rule must stay AFTER the base one above: it matches at the same specificity and
       wins on order alone.

       There is deliberately no "outside" left to tap: the way out is the taskbar's Menu
       button, which the trim keeps above the drawer at z-index 1046, or Escape. */
    @media (max-width: 768px) {
        body.hd-nav-sidebar #sidebar.side-bar {
            width: auto;
            max-width: none;
            right: 0;
        }
    }

    /* The menu list scrolls on its own, so a menu with several groups expanded is
       reachable to the bottom while the drawer stays pinned to the viewport.
       min-height:0 is required: a flex child defaults to min-height:auto and would
       otherwise refuse to shrink below its content. overscroll-behavior stops a flick
       at the end of the menu from carrying on into the page behind it. */
    body.hd-nav-sidebar #sidebar > #side-bar {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    /* No scrollbar on the menu (owner, 2026-10-31); it still scrolls by wheel and touch. */
    #side-bar::-webkit-scrollbar { display: none; }
    #side-bar { scrollbar-width: none; }

    /* Catches every click that lands outside the drawer and dims the page so the
       drawer reads as floating above it. visibility (not display) keeps it fadeable
       both ways; pointer-events go dead with it, so a closed drawer never blocks the
       page underneath. */
    #sidebar-backdrop {
        position: fixed;
        top: 0; right: 0; bottom: 0; left: 0;
        z-index: 1040;
        background: rgba(15, 23, 42, .45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s;
    }
    body.side-drawer-open #sidebar-backdrop { opacity: 1; visibility: visible; }

    /* ---- An open drawer owns the screen ------------------------------------------
       While the drawer is open the taskbar is trimmed to the one button that still
       means anything beside it — Menu, which is the single show/hide control at every
       width. Everything else in the bar was either hidden behind the drawer or, out to
       the right of it, sitting under the backdrop and unclickable: a strip of dimmed
       icons that looked live and was not.

       Three #main-taskbar in the selector is deliberate, and two is not enough.
       partials/taskbar.html pins Back and "Back to <name>" visible with
       `body:not(.desktop-focus-top) #main-taskbar#main-taskbar .tb-left > a.tb-back`
       + !important — two ids AND three classes AND two elements, which outranks the
       obvious two-id version of the rule below. Trimmed to just Menu, the bar was
       showing the Back arrow instead. A third id settles it. */

    /* Over the backdrop AND over the drawer, so Menu stays clickable — it is the way
       back out. The z-index it overrides is an inline style on the element, hence
       !important. */
    body.side-drawer-open #main-taskbar { z-index: 1046 !important; }

    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-center,
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-left > *:not(.side-bar-collapse),
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar
        .tb-right > *:not(.tb-drawer-biz):not(.tb-drawer-biz-logo) {
        display: none !important;
    }

    /* The far end of the trimmed bar carries the business name and logo — see the note
       on the elements in partials/taskbar.html. They are markup that exists on every
       page and is inert until the drawer opens, so they are hidden by default here
       rather than in the bar's own styles. min-width:0 on the flex parent is what lets
       the name's ellipsis work: a flex item defaults to min-width:auto and would push
       the text past the edge instead of truncating it — on a phone the drawer leaves
       the pair barely 130px between them. The logo keeps its size while the name gives
       way, since a squashed logo reads as broken where a shortened name does not. */
    .tb-drawer-biz, .tb-drawer-biz-logo { display: none; }
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-right { min-width: 0; }
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-right > .tb-drawer-biz {
        display: block !important;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 0 6px;
        color: var(--mk-white);
        font-weight: 600;
        font-size: 14px;
        line-height: 1.2;
    }
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-right > .tb-drawer-biz-logo {
        display: block !important;
        flex: 0 0 auto;
        width: auto; height: 30px; max-width: 120px;
        margin-right: 2px;
        object-fit: contain;
    }
    /* …and Menu itself stays, whatever else hid it. A section page (Products, Sales,
       HRM…) swaps the bar for its own module menu with
       `body.<x>-focus-top … > *:not(.<x>-menu-wrap) { display:none !important }`,
       which takes Menu down with everything else — trimming the bar to "just the
       toggle" would otherwise leave an empty bar there. */
    body.side-drawer-open #main-taskbar#main-taskbar#main-taskbar .tb-left > .side-bar-collapse {
        display: inline-flex !important;
    }

    /* The bar now floats above the drawer, so park the drawer under it rather than
       behind it — otherwise the bar eats the first menu row. --tb-h is measured from
       the live bar when the drawer opens (partials/menu.html): the bar is 40px on a
       desktop and 56px+border on a phone, and hard-coding either here would drift the
       moment taskbar.html changed. */
    body.hd-nav-sidebar.side-drawer-open #sidebar.side-bar {
        top: var(--tb-h, 41px);
    }

    @media print {
        #sidebar-backdrop { display: none !important; }
        body.hd-nav-sidebar #sidebar.side-bar { display: none !important; }
    }

/* The row-number column is a position, not data: grey, so the eye goes to the
   figures beside it. `td.row-no` is what the DataTables columns set, `th.rtp-num`
   /`td.rtp-num` what the report templates render. */
table td.row-no, table th.row-no,
table td.rtp-num, table th.rtp-num { color: var(--mk-slate-400) !important; }

/* Sidebar ▸ a group's SUB-GROUP header (Extra-Advance holds AI, Manufacturing, Pawn
   Shop …). The captured markup outdents each header by -12px, so its icon sat 12px
   left of the plain rows in the same list — the group read as two ragged columns.
   Everything at this level now starts on one line; the sub-group's own children keep
   their deeper indent (their box carries padding-left:16px). */
.side-bar a.drop_down.sub_drop[style] { margin-left: 0 !important; }

/* select2's open list is capped at 200px by the library default in vendor.css. With 13
   users or 28 leave types that is a ~436px list crammed into a 200px window — about six
   rows visible, the rest reached by scrolling inside a small box, which reads as the
   dropdown being stuck. Three pages had already patched this for themselves
   (manage_user/show 500px, contact modals 500px, the POS customer picker 480px), so the
   app was inconsistent as well as cramped. One rule here, 500px everywhere: short lists
   are unaffected (max-height only bites once the content exceeds it) and long ones show
   roughly fifteen rows before they scroll. */
.select2-container .select2-results > .select2-results__options,
.select2-results__options { max-height: 500px; }

/* On a short screen 500px would run past the bottom of the window; cap by viewport
   there so the list is never taller than the space it has. */
@media (max-height: 700px) {
    .select2-container .select2-results > .select2-results__options,
    .select2-results__options { max-height: 60vh; }
}

/* The bare `.select2-results__options` selector above also matches the NESTED list select2
   draws inside every <optgroup>. Capped at 500px with `overflow: visible`, a group taller
   than that (the Telegram report picker: ~30 reports under one department) spilled out of
   its own box and was painted over the rows of the group below — names printed on top of
   each other. Only the outer list scrolls; a group's own list is as tall as its rows. */
.select2-results__options.select2-results__options--nested { max-height: none; }
