/* Sempoa theme — experiment on branch ui/sempoa-theme (dark).
   Colours are sampled from the "ERP (Community)" Figma file: page #2c2c44, panels #3a3a5a, sidebar #464667,
   sidebar active tab #2c2c45, table rows #464667/#5a5a82, text #f2f2f2, muted #c7c7c7/#aeaeae, accent #74cdff,
   chip #579aff, primary #007aff. Fonts Poppins + Montserrat. Airy spacing like the design (cards ~24px, rows ~48px).
   Rules sit under `html body` + !important because component <style> blocks and inline styles in the app load later. */
:root {
    --sp-page: #2e2e48;
    --sp-bg-image: url("../img/sempoa-bg-dark.svg");
    --sp-panel: #3a3a5a;
    --sp-sidebar: #464667;
    --sp-active: #2c2c45;
    --sp-row-a: #464667;
    --sp-row-b: #55557a;
    --sp-head: #686892;
    --sp-line: #55557a;
    --sp-text: #f2f2f2;
    --sp-muted: #c7c7c7;
    --sp-accent: #74cdff;
    --sp-primary: #007aff;
}

html body {
    font-family: 'Poppins', 'Helvetica', Arial, sans-serif;
    color: var(--sp-text);
    /* Figma "BG": flat page colour with a translucent blue wave across the lower part (stretched to the window, as in the frame) */
    background: var(--sp-page) var(--sp-bg-image) no-repeat center bottom / 100% 100% fixed;
}

/* ---- Spacing (airier than before) ---- */
html body .mud-main-content { padding: 24px 32px !important; }
html body .mud-container { padding-left: 0; padding-right: 0; }
html body .mud-grid.mud-grid-spacing-xs-3 { margin-top: 0; }

/* ---- Sidebar ---- */
html body .sidebar-drawer { background: var(--sp-sidebar) !important; box-shadow: 10px 0 25px rgba(0, 0, 0, 0.25) !important; }
html body .sidebar-drawer .mud-nav-link { border-radius: 0 !important; margin: 4px 0 4px 18px !important; padding: 12px 16px !important; border-radius: 30px 0 0 30px !important; font-weight: 500; }
html body .nav-active { background: var(--sp-active) !important; color: #fff !important; font-weight: 600; }
html body .nav-active .mud-icon-root, html body .nav-active .mud-nav-link-text { color: #fff !important; }
html body .brand-branch { color: var(--sp-accent) !important; }

/* ---- Top bar: search as a pill ---- */
html body .mud-appbar { background: var(--sp-page) !important; box-shadow: none !important; }
html body .nav-search-box .mud-input-outlined, html body .mud-appbar .mud-input-outlined { background: var(--sp-panel); border-radius: 100px; }

/* ---- Panels ---- */
html body .mud-paper { background-color: var(--sp-panel); border-radius: 10px; }
html body .mud-paper.rounded-lg, html body .mud-card { border-radius: 10px !important; border: none !important; box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3) !important; }
html body .mud-paper.mud-elevation-0 { box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3); }

/* ---- Tables (every list page goes through .list-page-grid) ---- */
html body .list-page-grid .mud-table-head .mud-table-cell {
    background-color: var(--sp-head) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 14px 16px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}
html body .list-page-grid .mud-table-head .mud-icon-root, html body .list-page-grid .mud-table-head .mud-icon-button { color: #fff !important; }
html body .list-page-grid .mud-table-cell { padding: 14px 16px !important; border-bottom: none !important; border-right-color: transparent !important; color: var(--sp-text); }
html body .list-page-grid .mud-table-body .mud-table-row:nth-child(odd) .mud-table-cell { background-color: var(--sp-row-a); }
html body .list-page-grid .mud-table-body .mud-table-row:nth-child(even) .mud-table-cell { background-color: var(--sp-row-b); }
html body .list-page-grid .mud-table-body .mud-table-row:hover .mud-table-cell { background-color: #6b6b9a !important; }
html body .list-page-grid-wrapper .mud-table-container { border-radius: 10px; }
html body .mud-table-pagination, html body .mud-table-pagination .mud-select, html body .mud-table-pagination .mud-icon-button { color: var(--sp-muted); }

/* ---- Buttons, chips, inputs ---- */
html body .mud-button-root { border-radius: 5px !important; text-transform: none; font-weight: 500; }
html body .mud-chip { border-radius: 100px !important; }
html body .mud-chip.mud-chip-filled.mud-chip-color-default { background-color: #579aff; color: #fff; }
html body .mud-input-outlined .mud-input-outlined-border { border-color: #6a6a92; border-radius: 8px; }

/* ---- Hard-coded light-theme colours used inline across pages, mapped to the dark palette ---- */
html body [style*="color:#1A237E"] { color: var(--sp-text) !important; }
html body [style*="color:#607D8B"], html body [style*="color:#546E7A"], html body [style*="color:#616161"] { color: var(--sp-muted) !important; }
html body [style*="color:#90A4AE"], html body [style*="color:#B0BEC5"] { color: #aeaeae !important; }
html body [style*="background:#F4F6F9"], html body [style*="background:#F5F5F5"], html body [style*="background:#ECEFF1"],
html body [style*="background:#F8F9FA"], html body [style*="background:#FAFBFC"], html body [style*="background:#EEF1FB"],
html body [style*="background:white"], html body [style*="background:#fff"], html body [style*="background:#FFFFFF"] { background: var(--sp-row-a) !important; }
html body [style*="background:#1A237E"]:not(.sidebar-drawer) { background: var(--sp-primary) !important; }
html body [style*="solid #E8ECF0"], html body [style*="solid #ECEFF1"] { border-color: var(--sp-line) !important; }

/* ---- Date filters ---- */
/* Native <input type=date> (AppDateInput): dark control + visible calendar icon. */
html body input[type="date"] { color-scheme: dark; }
html body input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.85); cursor: pointer; }

/* Quick range chips (Today / Last 7 Days / ...) */
html body .mud-button-group-outlined .mud-button-root { border-color: #6a6a92 !important; color: var(--sp-text) !important; background: transparent; }
html body .mud-button-group-outlined .mud-button-root:hover { background: var(--sp-row-b) !important; }

/* Range text field: pill, panel colour */
html body .date-range-input .mud-input-outlined { background: var(--sp-panel); border-radius: 8px; }
html body .date-range-input .mud-input-outlined-border { border-color: #6a6a92 !important; border-radius: 8px; }
html body .date-range-input input { color: var(--sp-text); }
html body .date-range-input .mud-icon-root { color: var(--sp-muted); }

/* Calendar popup (MudBlazor 8 classes): selected ends = primary, days in between = light blue like the design */
html body .mud-picker-paper, html body .mud-picker-content { background-color: var(--sp-panel) !important; }
html body .mud-picker-calendar .mud-day { color: var(--sp-text); border-radius: 50%; }
html body .mud-picker-calendar .mud-day.mud-selected, html body .mud-picker-calendar .mud-day.mud-range-start-selected,
html body .mud-picker-calendar .mud-day.mud-range-end-selected { background-color: var(--sp-primary) !important; color: #fff !important; }
html body .mud-picker-calendar .mud-day.mud-range.mud-range-between { background-color: #d5efff !important; color: #1f2a44 !important; background-image: none !important; }
html body .mud-picker-calendar .mud-day.mud-range.mud-range-between:hover { background-color: #bfe3fb !important; }
html body .mud-picker-calendar-header-day .mud-day-label { color: var(--sp-muted); }
html body .mud-picker-actions .mud-button-root { color: var(--sp-text); }
html body .mud-picker-actions .mud-button-root.mud-button-text-primary { background: var(--sp-primary); color: #fff; }

/* ---- Top bar: page headline left, search, notifications, user right (replaces the old empty blue strip) ---- */
html body .mud-main-content { background: transparent !important; }
html body .topbar { display: flex; align-items: center; gap: 20px; padding: 18px 32px; position: sticky; top: 0; z-index: 50; background: var(--sp-page); }
html body .topbar-title { font-family: 'Montserrat', 'Poppins', sans-serif; font-weight: 700; font-size: 1.4rem; color: var(--sp-text); white-space: nowrap; }
html body .topbar-search { flex: 0 1 340px; min-width: 200px; margin: 0 0 0 auto; position: relative; }
html body .topbar-filters { margin-left: auto; display: flex; align-items: center; flex: 0 0 auto; }
html body .topbar-filters + .topbar-search { margin-left: 0; }
html body .topbar-search .mud-input-outlined { background: var(--sp-panel); border-radius: 100px; }
html body .topbar-search .mud-input-outlined input { color: var(--sp-text); }
html body .topbar-search .mud-input-outlined fieldset { border-color: #6a6a92; border-radius: 100px; }
html body .topbar-search .mud-icon-root { color: var(--sp-muted); }
html body .topbar-search .nav-search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100; background: var(--sp-panel); }
html body .topbar-search .nav-search-result-item { color: var(--sp-text); }
html body .topbar-search .nav-search-result-item:hover { background: var(--sp-row-b); }
html body .topbar-user { display: flex; align-items: center; gap: 10px; }
html body .topbar-user-name { color: var(--sp-text); font-weight: 600; font-size: 0.875rem; line-height: 1.2; }
html body .topbar-user-role { color: var(--sp-muted); font-size: 0.75rem; }

/* ---- Sidebar heading: the company name, large and readable ---- */
html body .sidebar-drawer .brand-title { font-family: 'Montserrat', 'Poppins', sans-serif; font-size: 1.05rem; font-weight: 700; letter-spacing: 0.2px; line-height: 1.25; white-space: normal; color: #fff; }
html body .sidebar-drawer .brand-tenant { color: var(--sp-muted); font-size: 0.72rem; letter-spacing: 0.5px; margin-top: 2px; }

/* ---- One headline, in the top bar: hide each page's own title + back button, and win the space back for the table ---- */
html body .page-flex-root .mud-typography-h5[style*="color:#1A237E"] { display: none !important; }
html body .page-flex-root .page-back-btn { display: none !important; }
html body .page-flex-root { padding: 4px 32px 20px !important; }
html body .topbar { padding: 10px 32px; }
html body .list-page-root > .d-flex.mb-4 { margin-bottom: 8px !important; }
html body .topbar .page-back-btn { margin-right: 0 !important; }

/* ---- Sidebar: open by default (company name + menu labels visible). The top bar's menu button collapses it to the
   72px icon rail, which expands again on hover (the base layout's own rules) — those only apply with .sidebar-collapsed. ---- */
html body .mud-layout:not(.sidebar-collapsed),
html body .mud-layout:not(.sidebar-collapsed):has(.sidebar-drawer:hover) { --mud-drawer-width-left: 236px !important; }
html body .sidebar-drawer { overflow-x: hidden !important; }
html body .mud-layout:not(.sidebar-collapsed) .sidebar-hide-collapsed,
html body .mud-layout:not(.sidebar-collapsed) .sidebar-drawer .mud-nav-link-text,
html body .mud-layout:not(.sidebar-collapsed) .sidebar-drawer .mud-nav-group-title-text,
html body .mud-layout:not(.sidebar-collapsed) .sidebar-drawer .mud-nav-group .mud-expand-icon,
html body .mud-layout:not(.sidebar-collapsed) .sidebar-drawer .mud-button-root .mud-button-label { display: revert !important; }
html body .sidebar-brand { gap: 12px; min-width: 0; }
html body .sidebar-brand > div:last-child { min-width: 0; }
html body .sidebar-drawer .brand-title { overflow-wrap: anywhere; }

/* ---- Date filter (the range field keeps its natural width; only the quick ranges were collapsed into a menu) ---- */
html body .mud-menu .mud-button-root { white-space: nowrap; }

/* ---- Collapsed = fully hidden (no half-visible icon rail, no hover-expand). The top bar's menu button brings it back. ---- */
html body .mud-layout.sidebar-collapsed,
html body .mud-layout.sidebar-collapsed:has(.sidebar-drawer:hover) { --mud-drawer-width-left: 0px !important; }
html body .mud-layout.sidebar-collapsed .sidebar-drawer { transform: translateX(-100%) !important; visibility: hidden; width: 0 !important; box-shadow: none !important; }

/* ---- Hidden sidebar still opens with the mouse: hover the left screen edge (or the sidebar itself) and it slides over the
   content as an overlay, without pushing the page. ---- */
html body .sidebar-edge { display: none; position: fixed; left: 0; top: 0; bottom: 0; width: 12px; z-index: 1250; }
html body .mud-layout.sidebar-collapsed .sidebar-edge { display: block; }
html body .mud-layout.sidebar-collapsed:has(.sidebar-edge:hover) .sidebar-drawer,
html body .mud-layout.sidebar-collapsed .sidebar-drawer:hover {
    transform: translateX(0) !important; visibility: visible !important; width: 236px !important;
    box-shadow: 10px 0 25px rgba(0, 0, 0, 0.45) !important; z-index: 1300;
}

/* ---- Forms: compact. Less padding around cards, tighter grid gutters and input boxes (the airy spacing is for page chrome,
   not for data entry). ---- */
html body .mud-grid-spacing-xs-2, html body .mud-grid-spacing-xs-3, html body .mud-grid-spacing-xs-4 { width: calc(100% + 8px) !important; margin-left: -8px !important; margin-top: -8px !important; }
html body .mud-grid-spacing-xs-2 > .mud-grid-item, html body .mud-grid-spacing-xs-3 > .mud-grid-item, html body .mud-grid-spacing-xs-4 > .mud-grid-item { padding-left: 8px !important; padding-top: 8px !important; }
html body .mud-input-control.mud-input-control-margin-dense { margin: 2px 0 !important; }
html body .mud-input-control.mud-input-control-margin-dense.mud-input-outlined-with-label,
html body .mud-input-control.mud-input-outlined-with-label { margin-top: 6px !important; margin-bottom: 2px !important; }
html body .mud-input-root-outlined.mud-input-root-margin-dense { padding: 7px 12px !important; }
html body .mud-input { font-size: 0.8125rem; }
html body .mud-input-control-helper-container { margin-top: 1px; }
html body .page-flex-root .pa-6 { padding: 14px !important; }
html body .page-flex-root .pa-5 { padding: 12px !important; }
html body .page-flex-root .pa-4 { padding: 10px !important; }
html body .page-flex-root .pa-3 { padding: 8px !important; }
html body .page-flex-root .mb-4 { margin-bottom: 10px !important; }
html body .page-flex-root .mb-3 { margin-bottom: 8px !important; }
html body .page-flex-root .mt-4 { margin-top: 10px !important; }
html body .page-flex-root .mt-3 { margin-top: 8px !important; }
html body .page-flex-root .mud-divider { margin: 4px 0 !important; }

/* ---- Sidebar, as in the Figma "Dashboard Sidebar": #464667 panel with rounded bottom corner, big logo block,
   semibold white items with icons on one left line, the ACTIVE item is a slot cut out of the panel (page colour, rounded
   on the left, open to the right with rounded panel corners above and below), white Logout pill and copyright at the bottom. ---- */
html body .sidebar-drawer { background: #464667 !important; border-radius: 0 0 20px 0 !important; box-shadow: 10px 0 25px rgba(0, 0, 0, 0.25) !important; }
html body .sidebar-drawer .mud-drawer-header { padding: 34px 28px 22px 28px !important; }
html body .sidebar-drawer .mud-navmenu { padding: 0 !important; margin-top: 6px; }
html body .sidebar-drawer .mud-nav-link {
    position: relative; width: auto !important; margin: 5px 0 5px 28px !important; padding: 11px 16px 11px 18px !important;
    border-radius: 30px 0 0 30px !important; color: #fff !important; font-weight: 600; font-size: 0.866rem;
}
html body .sidebar-drawer .mud-nav-link .mud-nav-link-icon { margin-right: 14px; font-size: 1.25rem; }
html body .sidebar-drawer .mud-nav-link:hover:not(.nav-active) { background: rgba(255, 255, 255, 0.09) !important; }
html body .sidebar-drawer .mud-nav-link.nav-active { background: var(--sp-page) !important; color: #fff !important; }
html body .sidebar-drawer .mud-nav-link.nav-active::before,
html body .sidebar-drawer .mud-nav-link.nav-active::after { content: ""; position: absolute; right: 0; width: 26px; height: 26px; pointer-events: none; }
html body .sidebar-drawer .mud-nav-link.nav-active::before { top: -26px; background: radial-gradient(circle at 0 0, transparent 26px, var(--sp-page) 26px); }
html body .sidebar-drawer .mud-nav-link.nav-active::after { bottom: -26px; background: radial-gradient(circle at 0 100%, transparent 26px, var(--sp-page) 26px); }
html body .sidebar-drawer .mud-nav-group .mud-nav-link { color: #fff !important; }
html body .sidebar-footer { padding: 14px 0 18px 28px !important; }
html body .sidebar-pill { width: auto !important; min-width: 122px; justify-content: flex-start; background: #fff !important; color: #273a34 !important; border-radius: 10.8px !important; font-weight: 600; padding: 9px 14px !important; }
html body .sidebar-pill-ghost { background: transparent !important; color: #fff !important; border: 1px solid rgba(255, 255, 255, 0.35); }
html body .sidebar-pill .mud-button-icon-start { margin-right: 8px; }
html body .sidebar-copy { color: #fff; font-size: 0.7rem; font-weight: 600; margin-top: 14px; letter-spacing: 0.2px; }

/* ---- Continuity between the selected tab and the page: the active slot must read as one surface with the content area.
   Anything at the sidebar's right edge breaks that: the panel's own shadow (it darkened the page right next to the slot)
   and the menu's scrollbar (a visible strip at the edge). Both are removed; colours of slot and page are the same variable. ---- */
html body .sidebar-drawer { box-shadow: none !important; }
html body .sidebar-drawer .mud-drawer-content { scrollbar-width: none; -ms-overflow-style: none; }
html body .sidebar-drawer .mud-drawer-content::-webkit-scrollbar { display: none; }
html body .mud-layout, html body .mud-main-content { background-color: transparent !important; }
html body .sidebar-drawer .mud-nav-link.nav-active { margin-right: -2px !important; }

/* ---- Everything a list page needs sits in the top bar: [headline] ...... [date range][filters][search][columns/download/New] ---- */
html body .topbar { flex-wrap: wrap; row-gap: 6px; }
html body .topbar-filter-group, html body .topbar-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
html body .topbar-actions-slot { flex: 0 0 auto; }
html body .topbar-search { flex: 0 1 260px; min-width: 160px; }
html body .topbar-filter-group .mud-input-control { margin: 0 !important; }
html body .topbar-actions .mud-button-root { white-space: nowrap; }

/* ---- One line, always: the top bar never wraps. When space runs short the headline is ellipsised and the search shrinks first;
   the user shows as an avatar only (name on hover) and the record count hides on narrower screens. ---- */
html body .topbar { flex-wrap: nowrap !important; gap: 10px; padding: 8px 20px !important; min-height: 56px; }
html body .topbar-title { flex: 0 1 auto; min-width: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.15rem; }
html body .topbar-filters { flex: 0 0 auto; margin-left: auto; }
html body .topbar-filters + .topbar-search { margin-left: 0; }
html body .topbar-search { flex: 1 1 140px !important; min-width: 110px !important; max-width: 240px; }
html body .topbar-user > div:not(.mud-avatar) { display: none; }
html body .topbar-actions .mud-button-root { padding: 4px 12px; }

/* ---- Use the space between the headline and the controls: filters follow the headline, the search grows to fill the rest. ---- */
html body .topbar-filters { margin-left: 8px !important; }
html body .topbar-search { flex: 1 1 160px !important; max-width: 560px !important; margin-left: 0 !important; }
html body .topbar-avatar { margin-left: 4px; }

/* ---- Search: compact (it had grown to fill the bar). Controls stay together after the headline; actions + avatar sit at the right. ---- */
html body .topbar-search { flex: 0 1 260px !important; min-width: 130px !important; max-width: 260px !important; }
html body .topbar-actions-slot { margin-left: auto; }
html body .topbar-actions-slot ~ .topbar-avatar { margin-left: 4px; }

/* ---- Even distribution: headline at the left; filters + search centred in the space between it and the right-hand
   actions/avatar. Auto margins on both ends of the middle group share the free space equally. ---- */
html body .topbar-filters { margin-left: auto !important; }
html body .topbar-search { margin-left: 0 !important; margin-right: auto !important; }
html body .topbar-search:not(.topbar-filters + .topbar-search) { margin-left: auto !important; }
html body .topbar-actions-slot { margin-left: 0 !important; }
html body .topbar-title + .mud-menu { margin-left: auto; }

/* ---- Date range field was clipping the dates: wide enough for "dd-mm-yyyy – dd-mm-yyyy" + icon, and never shrunk by the flex row ---- */
/* The picker's own rule gives it max-width:100% of a shrink-to-fit parent, which let it overflow its slot and sit on top of the
   next control (Branch). Fixed slot for the whole date control, no percentage max-width, and a gap before the next filter. */
html body .topbar-filter-group { gap: 14px; }
html body .topbar-filter-group .date-range-root { flex: 0 0 auto; width: 310px; min-width: 310px; }
/* flex-basis must stay `auto`: the picker root is itself a column flex box, so a 282px basis was read as a HEIGHT of 282px. */
/* MudBlazor copies the picker's Class onto its inner .mud-input and both <input>s too — sizing `.date-range-input` made EVERY one of them 336px
   wide, so the inputs overflowed the box and landed on the Branch picker. Size only the root. */
html body .topbar-filter-group .mud-picker.date-range-input { width: 262px !important; min-width: 262px !important; max-width: none !important; flex: 0 0 auto !important; height: 40px !important; align-self: center; }
html body .topbar-filter-group .date-range-root { height: 40px; align-items: center; }
html body .topbar-filter-group .date-range-input input { text-align: left; }
html body .topbar-filter-group .date-range-input input { font-size: 0.8125rem; min-width: 0; padding: 7px 4px !important; }
html body .topbar-filter-group .mud-select { min-width: 170px !important; }
html body .topbar-search { max-width: 200px !important; flex-basis: 200px !important; }
html body .topbar-filter-group { flex-shrink: 0; }

/* ---- Measured in a real browser at 1440px: the headline was squeezed to "LR …". Keep it readable and give the room back by
   shrinking the date field (dates need ~172px), Branch and the search. ---- */
html body .topbar-title { flex: 0 0 auto !important; min-width: 120px; max-width: 240px; }
html body .topbar-filter-group .mud-picker.date-range-input { width: 232px !important; min-width: 232px !important; }
html body .topbar-filter-group .date-range-root { width: 280px; min-width: 280px; }
html body .topbar-filter-group .mud-select { min-width: 140px !important; }
html body .topbar-search { flex: 1 1 120px !important; min-width: 90px !important; max-width: 200px !important; }
html body .topbar-filter-group { gap: 10px; }

/* ---- Fit check #2 (browser-measured): the avatar was pushed past the bar's right edge and the year clipped in the date. ---- */
html body .topbar { padding: 8px 14px !important; gap: 8px; }
html body .topbar-title { font-size: 1.05rem; }
html body .topbar-filter-group .mud-picker.date-range-input { width: 250px !important; min-width: 250px !important; }
html body .topbar-filter-group .date-range-root { width: 296px; min-width: 296px; }
html body .topbar-filter-group .mud-select { min-width: 118px !important; }
html body .topbar-filter-group { gap: 8px; }
html body .topbar-actions { gap: 4px; }

/* ---- Fit check #3: smaller icon buttons and avatar so everything stays inside the bar at 1440px ---- */
html body .topbar > .mud-icon-button, html body .topbar > .mud-button-root.mud-icon-button { padding: 6px !important; }
html body .topbar .page-back-btn { padding: 6px !important; margin: 0 !important; }
html body .topbar-avatar { width: 34px !important; height: 34px !important; margin-left: 0 !important; }
html body .topbar-search { min-width: 80px !important; }

/* ---- Sidebar fixes found by looking at it in a real browser ----
   1. The link sat in a flex row and shrank to its text (188px), so the active "slot" stopped 20px short of the page instead of opening
      into it. Links fill the row now.
   2. MudBlazor gives .mud-nav-link overflow:hidden, which clipped the two corner pieces that round the slot. Visible on the active item.
   3. The drawer header is a fixed 64px tall; the two-line company name overflowed it and was cut off at the top. */
html body .sidebar-drawer .mud-nav-link { flex: 1 1 auto !important; }
html body .sidebar-drawer .mud-nav-link.nav-active { overflow: visible !important; }
html body .sidebar-drawer .mud-drawer-header { height: auto !important; min-height: 96px; align-items: flex-end; }
html body .sidebar-drawer .sidebar-brand { align-items: center; }
html body .sidebar-drawer .mud-drawer-header { height: 130px !important; min-height: 130px !important; align-items: center !important; padding-top: 14px !important; padding-bottom: 14px !important; }

/* ---- A page's header row can live in the top bar (TopBarSlot): it takes the free width and scrolls rather than wrapping ---- */
html body .topbar-actions-slot { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 8px; }
html body .topbar-actions-slot::-webkit-scrollbar { display: none; }
html body .topbar-actions-slot > * { flex: 0 0 auto; }
html body .topbar-record-no { font-family: 'Montserrat', 'Poppins', sans-serif; font-weight: 700; color: var(--sp-text); white-space: nowrap; }
html body .topbar-actions-slot .mud-spacer { flex: 1 1 auto; }

/* Header-row items inside the top bar: compact quick-jump, readable chips */
/* only the quick-jump field (inside its own d-flex wrapper) is held to 150px; search boxes and checkboxes size themselves */
html body .topbar-actions-slot > div.d-flex .mud-input-control { width: 150px; max-width: 150px; }
html body .topbar-actions-slot .mud-button-root { white-space: nowrap; }
html body [style*="color:#455A64"] { color: #c7c7c7 !important; }

/* ---- Instant tooltips for icon-only buttons (the browser's own title tooltip waits ~1s and is easy to miss) ---- */
html body [data-tip] { position: relative; }
html body .mud-icon-button[data-tip] { overflow: visible !important; }
html body .mud-icon-button[data-tip]:disabled { pointer-events: auto !important; }
/* ::before, not ::after: MudBlazor's ripple effect owns ::after on buttons (opacity 0 + scale), which is why the first version stayed invisible */
html body [data-tip]:hover::before {
    content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: #12121f; color: #fff; font: 500 12px 'Poppins', sans-serif; line-height: 1.2; padding: 6px 10px;
    border-radius: 6px; white-space: nowrap; z-index: 2000; pointer-events: none; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* ---- Login page (EmptyLayout): same dark Sempoa look; the compact-forms rules above squeezed these fields, so they get their size back ---- */
html body .login-bg { background: var(--sp-page) var(--sp-bg-image) no-repeat right bottom / 118% 100% fixed !important; }
html body .login-card { background: var(--sp-panel) !important; border-radius: 10px !important; box-shadow: 5px 5px 14px rgba(0, 0, 0, 0.4) !important; }
html body .login-card .brand-logo { background: var(--sp-primary) !important; }
html body .login-card .brand-name { color: var(--sp-text) !important; font-family: 'Montserrat', 'Poppins', sans-serif; letter-spacing: 1.5px; }
html body .login-card .brand-sub { color: var(--sp-muted) !important; }
html body .login-card .login-select { background: #2c2c44 !important; color: var(--sp-text) !important; border: 1px solid #6a6a92 !important; border-radius: 8px !important; height: 46px; padding: 0 12px; }
html body .login-card .login-select-label { background: transparent !important; color: var(--sp-muted) !important; }
html body .login-card .mud-input-control { margin: 8px 0 16px !important; }
html body .login-card .mud-input-root-outlined { padding: 13px 14px !important; }
html body .login-card .mud-input-outlined .mud-input-outlined-border { border-color: #6a6a92 !important; }
html body .login-btn { background: var(--sp-primary) !important; border-radius: 8px !important; }
html body .login-footer { color: var(--sp-muted) !important; }

/* ---- Select-branch page: dark panels, readable names (the white card with a white title came from the attribute colour mapping) ---- */
/* Full-screen pages have no sidebar, so the wave's left edge (drawn for the sidebar boundary) is pushed off-screen instead of showing as a hard cut. */
html body .branch-page { background: var(--sp-page) var(--sp-bg-image) no-repeat right bottom / 118% 100% fixed !important; }
html body .branch-card { background: var(--sp-panel) !important; border-radius: 10px !important; box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.35) !important; }
html body .branch-card:hover { border-color: var(--sp-primary) !important; background: var(--sp-sidebar) !important; }
html body .branch-card .mud-typography { color: var(--sp-text) !important; }
html body .branch-code-badge { background: rgba(127, 127, 160, 0.18) !important; color: var(--sp-text) !important; }
html body .branch-city { color: var(--sp-muted) !important; }
html body .branch-card .mud-icon-root { color: var(--sp-muted) !important; }
html body .brand-row .brand-logo { background: var(--sp-primary) !important; }
html body .branch-footer .mud-button-root { color: var(--sp-muted) !important; }
html body .selecting-overlay { background: rgba(44, 44, 68, 0.75) !important; }

/* ---- List pages: the actions slot must NOT grow (it was given flex:1 for the View-page header rows). With it fixed-size the auto
   margins around filters + search share the free space again, so those boxes sit centred between the headline and the buttons. ---- */
html body .topbar-actions-slot:has(> .topbar-actions) { flex: 0 0 auto; }
html body .topbar-filters { margin-left: auto !important; }
html body .topbar-search { margin-right: auto !important; }

/* ---- Make room so the centring is visible with the sidebar open: shorter date format (dd/MM/yy), tighter bar padding and gaps ---- */
html body .topbar { padding: 8px 8px !important; gap: 6px; }
html body .topbar-filter-group { gap: 6px; }
html body .topbar-filter-group .mud-picker.date-range-input { width: 206px !important; min-width: 206px !important; }
html body .topbar-filter-group .date-range-root { width: 246px; min-width: 246px; }
html body .topbar-filter-group .date-range-input input { padding: 7px 2px !important; }
/* The search no longer soaks up the free space (that is what made the boxes look left-aligned): fixed width, so the free space goes
   to the auto margins on both sides of the filter+search group. */
html body .topbar-search { flex: 0 1 112px !important; width: 112px; max-width: 112px !important; min-width: 90px !important; }

/* ---- Pastel tinted boxes (green/red/amber/blue... backgrounds set inline) stay light in the dark theme, so text inside must be dark:
   the dark palette's light text was landing on a light tint and vanishing (LHC "Freight & Additions"). The list is generated from every
   inline `background:#...` in the pages whose luminance is above 0.78. ---- */
html body [style*="background:#C8E6C9" i], html body [style*="background:#DCEDC8" i], html body [style*="background:#E0F2F1" i], html body [style*="background:#E3F2FD" i], html body [style*="background:#E8EAF6" i], html body [style*="background:#E8F5E9" i], html body [style*="background:#EDE7F6" i], html body [style*="background:#F0F8FF" i], html body [style*="background:#F1F8E9" i], html body [style*="background:#F1F8F2" i], html body [style*="background:#F2F2F2" i], html body [style*="background:#F4F7FF" i], html body [style*="background:#F4FBF4" i], html body [style*="background:#F5F7FA" i], html body [style*="background:#F8F9FF" i], html body [style*="background:#FAFAFA" i], html body [style*="background:#FFCDD2" i], html body [style*="background:#FFEBEE" i], html body [style*="background:#FFF3C4" i], html body [style*="background:#FFF3E0" i], html body [style*="background:#FFF3F3" i], html body [style*="background:#FFF8E1" i], html body [style*="background:#FFF8F0" i] { color: #263238; }
html body [style*="background:#C8E6C9" i] .mud-typography:not([style*="color:"]), html body [style*="background:#DCEDC8" i] .mud-typography:not([style*="color:"]), html body [style*="background:#E0F2F1" i] .mud-typography:not([style*="color:"]), html body [style*="background:#E3F2FD" i] .mud-typography:not([style*="color:"]), html body [style*="background:#E8EAF6" i] .mud-typography:not([style*="color:"]), html body [style*="background:#E8F5E9" i] .mud-typography:not([style*="color:"]), html body [style*="background:#EDE7F6" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F0F8FF" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F1F8E9" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F1F8F2" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F2F2F2" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F4F7FF" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F4FBF4" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F5F7FA" i] .mud-typography:not([style*="color:"]), html body [style*="background:#F8F9FF" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FAFAFA" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFCDD2" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFEBEE" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFF3C4" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFF3E0" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFF3F3" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFF8E1" i] .mud-typography:not([style*="color:"]), html body [style*="background:#FFF8F0" i] .mud-typography:not([style*="color:"]) { color: #263238 !important; }
/* Inputs inside those pastel boxes (LHC entry "Freight & Additions" / "Deductions"): MudBlazor sets input, label and icon colours from the
   theme palette (light in the dark theme) so they do not inherit the box colour set above — force dark text on the light tint. */
html body [style*="background:#C8E6C9" i] .mud-input, html body [style*="background:#C8E6C9" i] .mud-input-slot, html body [style*="background:#C8E6C9" i] .mud-input-root, html body [style*="background:#C8E6C9" i] input, html body [style*="background:#C8E6C9" i] textarea, html body [style*="background:#C8E6C9" i] .mud-input-label, html body [style*="background:#C8E6C9" i] .mud-input-adornment-icon, html body [style*="background:#C8E6C9" i] .mud-input-helper-text, html body [style*="background:#C8E6C9" i] .mud-select-input, html body [style*="background:#DCEDC8" i] .mud-input, html body [style*="background:#DCEDC8" i] .mud-input-slot, html body [style*="background:#DCEDC8" i] .mud-input-root, html body [style*="background:#DCEDC8" i] input, html body [style*="background:#DCEDC8" i] textarea, html body [style*="background:#DCEDC8" i] .mud-input-label, html body [style*="background:#DCEDC8" i] .mud-input-adornment-icon, html body [style*="background:#DCEDC8" i] .mud-input-helper-text, html body [style*="background:#DCEDC8" i] .mud-select-input, html body [style*="background:#E0F2F1" i] .mud-input, html body [style*="background:#E0F2F1" i] .mud-input-slot, html body [style*="background:#E0F2F1" i] .mud-input-root, html body [style*="background:#E0F2F1" i] input, html body [style*="background:#E0F2F1" i] textarea, html body [style*="background:#E0F2F1" i] .mud-input-label, html body [style*="background:#E0F2F1" i] .mud-input-adornment-icon, html body [style*="background:#E0F2F1" i] .mud-input-helper-text, html body [style*="background:#E0F2F1" i] .mud-select-input, html body [style*="background:#E3F2FD" i] .mud-input, html body [style*="background:#E3F2FD" i] .mud-input-slot, html body [style*="background:#E3F2FD" i] .mud-input-root, html body [style*="background:#E3F2FD" i] input, html body [style*="background:#E3F2FD" i] textarea, html body [style*="background:#E3F2FD" i] .mud-input-label, html body [style*="background:#E3F2FD" i] .mud-input-adornment-icon, html body [style*="background:#E3F2FD" i] .mud-input-helper-text, html body [style*="background:#E3F2FD" i] .mud-select-input, html body [style*="background:#E8EAF6" i] .mud-input, html body [style*="background:#E8EAF6" i] .mud-input-slot, html body [style*="background:#E8EAF6" i] .mud-input-root, html body [style*="background:#E8EAF6" i] input, html body [style*="background:#E8EAF6" i] textarea, html body [style*="background:#E8EAF6" i] .mud-input-label, html body [style*="background:#E8EAF6" i] .mud-input-adornment-icon, html body [style*="background:#E8EAF6" i] .mud-input-helper-text, html body [style*="background:#E8EAF6" i] .mud-select-input, html body [style*="background:#E8F5E9" i] .mud-input, html body [style*="background:#E8F5E9" i] .mud-input-slot, html body [style*="background:#E8F5E9" i] .mud-input-root, html body [style*="background:#E8F5E9" i] input, html body [style*="background:#E8F5E9" i] textarea, html body [style*="background:#E8F5E9" i] .mud-input-label, html body [style*="background:#E8F5E9" i] .mud-input-adornment-icon, html body [style*="background:#E8F5E9" i] .mud-input-helper-text, html body [style*="background:#E8F5E9" i] .mud-select-input, html body [style*="background:#EDE7F6" i] .mud-input, html body [style*="background:#EDE7F6" i] .mud-input-slot, html body [style*="background:#EDE7F6" i] .mud-input-root, html body [style*="background:#EDE7F6" i] input, html body [style*="background:#EDE7F6" i] textarea, html body [style*="background:#EDE7F6" i] .mud-input-label, html body [style*="background:#EDE7F6" i] .mud-input-adornment-icon, html body [style*="background:#EDE7F6" i] .mud-input-helper-text, html body [style*="background:#EDE7F6" i] .mud-select-input, html body [style*="background:#F0F8FF" i] .mud-input, html body [style*="background:#F0F8FF" i] .mud-input-slot, html body [style*="background:#F0F8FF" i] .mud-input-root, html body [style*="background:#F0F8FF" i] input, html body [style*="background:#F0F8FF" i] textarea, html body [style*="background:#F0F8FF" i] .mud-input-label, html body [style*="background:#F0F8FF" i] .mud-input-adornment-icon, html body [style*="background:#F0F8FF" i] .mud-input-helper-text, html body [style*="background:#F0F8FF" i] .mud-select-input, html body [style*="background:#F1F8E9" i] .mud-input, html body [style*="background:#F1F8E9" i] .mud-input-slot, html body [style*="background:#F1F8E9" i] .mud-input-root, html body [style*="background:#F1F8E9" i] input, html body [style*="background:#F1F8E9" i] textarea, html body [style*="background:#F1F8E9" i] .mud-input-label, html body [style*="background:#F1F8E9" i] .mud-input-adornment-icon, html body [style*="background:#F1F8E9" i] .mud-input-helper-text, html body [style*="background:#F1F8E9" i] .mud-select-input, html body [style*="background:#F1F8F2" i] .mud-input, html body [style*="background:#F1F8F2" i] .mud-input-slot, html body [style*="background:#F1F8F2" i] .mud-input-root, html body [style*="background:#F1F8F2" i] input, html body [style*="background:#F1F8F2" i] textarea, html body [style*="background:#F1F8F2" i] .mud-input-label, html body [style*="background:#F1F8F2" i] .mud-input-adornment-icon, html body [style*="background:#F1F8F2" i] .mud-input-helper-text, html body [style*="background:#F1F8F2" i] .mud-select-input, html body [style*="background:#F2F2F2" i] .mud-input, html body [style*="background:#F2F2F2" i] .mud-input-slot, html body [style*="background:#F2F2F2" i] .mud-input-root, html body [style*="background:#F2F2F2" i] input, html body [style*="background:#F2F2F2" i] textarea, html body [style*="background:#F2F2F2" i] .mud-input-label, html body [style*="background:#F2F2F2" i] .mud-input-adornment-icon, html body [style*="background:#F2F2F2" i] .mud-input-helper-text, html body [style*="background:#F2F2F2" i] .mud-select-input, html body [style*="background:#F4F7FF" i] .mud-input, html body [style*="background:#F4F7FF" i] .mud-input-slot, html body [style*="background:#F4F7FF" i] .mud-input-root, html body [style*="background:#F4F7FF" i] input, html body [style*="background:#F4F7FF" i] textarea, html body [style*="background:#F4F7FF" i] .mud-input-label, html body [style*="background:#F4F7FF" i] .mud-input-adornment-icon, html body [style*="background:#F4F7FF" i] .mud-input-helper-text, html body [style*="background:#F4F7FF" i] .mud-select-input, html body [style*="background:#F4FBF4" i] .mud-input, html body [style*="background:#F4FBF4" i] .mud-input-slot, html body [style*="background:#F4FBF4" i] .mud-input-root, html body [style*="background:#F4FBF4" i] input, html body [style*="background:#F4FBF4" i] textarea, html body [style*="background:#F4FBF4" i] .mud-input-label, html body [style*="background:#F4FBF4" i] .mud-input-adornment-icon, html body [style*="background:#F4FBF4" i] .mud-input-helper-text, html body [style*="background:#F4FBF4" i] .mud-select-input, html body [style*="background:#F5F7FA" i] .mud-input, html body [style*="background:#F5F7FA" i] .mud-input-slot, html body [style*="background:#F5F7FA" i] .mud-input-root, html body [style*="background:#F5F7FA" i] input, html body [style*="background:#F5F7FA" i] textarea, html body [style*="background:#F5F7FA" i] .mud-input-label, html body [style*="background:#F5F7FA" i] .mud-input-adornment-icon, html body [style*="background:#F5F7FA" i] .mud-input-helper-text, html body [style*="background:#F5F7FA" i] .mud-select-input, html body [style*="background:#F8F9FF" i] .mud-input, html body [style*="background:#F8F9FF" i] .mud-input-slot, html body [style*="background:#F8F9FF" i] .mud-input-root, html body [style*="background:#F8F9FF" i] input, html body [style*="background:#F8F9FF" i] textarea, html body [style*="background:#F8F9FF" i] .mud-input-label, html body [style*="background:#F8F9FF" i] .mud-input-adornment-icon, html body [style*="background:#F8F9FF" i] .mud-input-helper-text, html body [style*="background:#F8F9FF" i] .mud-select-input, html body [style*="background:#FAFAFA" i] .mud-input, html body [style*="background:#FAFAFA" i] .mud-input-slot, html body [style*="background:#FAFAFA" i] .mud-input-root, html body [style*="background:#FAFAFA" i] input, html body [style*="background:#FAFAFA" i] textarea, html body [style*="background:#FAFAFA" i] .mud-input-label, html body [style*="background:#FAFAFA" i] .mud-input-adornment-icon, html body [style*="background:#FAFAFA" i] .mud-input-helper-text, html body [style*="background:#FAFAFA" i] .mud-select-input, html body [style*="background:#FFCDD2" i] .mud-input, html body [style*="background:#FFCDD2" i] .mud-input-slot, html body [style*="background:#FFCDD2" i] .mud-input-root, html body [style*="background:#FFCDD2" i] input, html body [style*="background:#FFCDD2" i] textarea, html body [style*="background:#FFCDD2" i] .mud-input-label, html body [style*="background:#FFCDD2" i] .mud-input-adornment-icon, html body [style*="background:#FFCDD2" i] .mud-input-helper-text, html body [style*="background:#FFCDD2" i] .mud-select-input, html body [style*="background:#FFEBEE" i] .mud-input, html body [style*="background:#FFEBEE" i] .mud-input-slot, html body [style*="background:#FFEBEE" i] .mud-input-root, html body [style*="background:#FFEBEE" i] input, html body [style*="background:#FFEBEE" i] textarea, html body [style*="background:#FFEBEE" i] .mud-input-label, html body [style*="background:#FFEBEE" i] .mud-input-adornment-icon, html body [style*="background:#FFEBEE" i] .mud-input-helper-text, html body [style*="background:#FFEBEE" i] .mud-select-input, html body [style*="background:#FFF3C4" i] .mud-input, html body [style*="background:#FFF3C4" i] .mud-input-slot, html body [style*="background:#FFF3C4" i] .mud-input-root, html body [style*="background:#FFF3C4" i] input, html body [style*="background:#FFF3C4" i] textarea, html body [style*="background:#FFF3C4" i] .mud-input-label, html body [style*="background:#FFF3C4" i] .mud-input-adornment-icon, html body [style*="background:#FFF3C4" i] .mud-input-helper-text, html body [style*="background:#FFF3C4" i] .mud-select-input, html body [style*="background:#FFF3E0" i] .mud-input, html body [style*="background:#FFF3E0" i] .mud-input-slot, html body [style*="background:#FFF3E0" i] .mud-input-root, html body [style*="background:#FFF3E0" i] input, html body [style*="background:#FFF3E0" i] textarea, html body [style*="background:#FFF3E0" i] .mud-input-label, html body [style*="background:#FFF3E0" i] .mud-input-adornment-icon, html body [style*="background:#FFF3E0" i] .mud-input-helper-text, html body [style*="background:#FFF3E0" i] .mud-select-input, html body [style*="background:#FFF3F3" i] .mud-input, html body [style*="background:#FFF3F3" i] .mud-input-slot, html body [style*="background:#FFF3F3" i] .mud-input-root, html body [style*="background:#FFF3F3" i] input, html body [style*="background:#FFF3F3" i] textarea, html body [style*="background:#FFF3F3" i] .mud-input-label, html body [style*="background:#FFF3F3" i] .mud-input-adornment-icon, html body [style*="background:#FFF3F3" i] .mud-input-helper-text, html body [style*="background:#FFF3F3" i] .mud-select-input, html body [style*="background:#FFF8E1" i] .mud-input, html body [style*="background:#FFF8E1" i] .mud-input-slot, html body [style*="background:#FFF8E1" i] .mud-input-root, html body [style*="background:#FFF8E1" i] input, html body [style*="background:#FFF8E1" i] textarea, html body [style*="background:#FFF8E1" i] .mud-input-label, html body [style*="background:#FFF8E1" i] .mud-input-adornment-icon, html body [style*="background:#FFF8E1" i] .mud-input-helper-text, html body [style*="background:#FFF8E1" i] .mud-select-input, html body [style*="background:#FFF8F0" i] .mud-input, html body [style*="background:#FFF8F0" i] .mud-input-slot, html body [style*="background:#FFF8F0" i] .mud-input-root, html body [style*="background:#FFF8F0" i] input, html body [style*="background:#FFF8F0" i] textarea, html body [style*="background:#FFF8F0" i] .mud-input-label, html body [style*="background:#FFF8F0" i] .mud-input-adornment-icon, html body [style*="background:#FFF8F0" i] .mud-input-helper-text, html body [style*="background:#FFF8F0" i] .mud-select-input { color: #263238 !important; }
/* Page-level light row states (Dispatch Entry LR table, Inward Challan Entry challan table): hover = #F8F9FF, selected = #EDE7F6 are set in the pages' own
   <style> blocks, so the dark theme's light text vanished on them. Dark text on hover/selected rows. */
html body .row-selected td, html body .lr-select-table tr:hover td, html body .challan-select-table tr:hover td { color: #263238 !important; }
html body .row-selected td .mud-typography:not([style*="color:"]), html body .lr-select-table tr:hover td .mud-typography:not([style*="color:"]), html body .challan-select-table tr:hover td .mud-typography:not([style*="color:"]) { color: #263238 !important; }
/* Table cells (or whole rows) tinted inline with a pastel background, e.g. EWB Expiring "No LR linked" rows: MudBlazor's
   .mud-table-root … .mud-table-cell text colour out-ranks the generic pastel rule above, so the dark theme's light text stayed and vanished.
   Cells that set their own colour (expiry red/orange) are left alone. */
html body .mud-table-cell[style*="background:#C8E6C9" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#DCEDC8" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#E0F2F1" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#E3F2FD" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#E8EAF6" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#E8F5E9" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#EDE7F6" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F0F8FF" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F1F8E9" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F1F8F2" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F2F2F2" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F4F7FF" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F4FBF4" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F5F7FA" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#F8F9FF" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FAFAFA" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFCDD2" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFEBEE" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFF3C4" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFF3E0" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFF3F3" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFF8E1" i]:not([style*="color:"]), html body .mud-table-cell[style*="background:#FFF8F0" i]:not([style*="color:"]), html body .mud-table-row[style*="background:#C8E6C9" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#DCEDC8" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#E0F2F1" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#E3F2FD" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#E8EAF6" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#E8F5E9" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#EDE7F6" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F0F8FF" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F1F8E9" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F1F8F2" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F2F2F2" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F4F7FF" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F4FBF4" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F5F7FA" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#F8F9FF" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FAFAFA" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFCDD2" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFEBEE" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFF3C4" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFF3E0" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFF3F3" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFF8E1" i] > .mud-table-cell:not([style*="color:"]), html body .mud-table-row[style*="background:#FFF8F0" i] > .mud-table-cell:not([style*="color:"]) { color: #263238 !important; }
/* Driver Attendance grid: the page's own <style> paints every cell white / #F5F7FA / #FAFAFA, so the dark theme's light text (names, day numbers,
   totals, unmarked days) vanished. Dark text on the grid; present (.att-p) and absent (.att-a) cells keep their green / red. */
html body .att-grid th, html body .att-grid td:not(.att-p):not(.att-a) { color: #263238; }
html body .att-grid th .mud-typography:not([style*="color:"]), html body .att-grid td:not(.att-p):not(.att-a) .mud-typography:not([style*="color:"]) { color: #263238; }
/* Status colours used on the page itself (not inside a pastel box) are brightened so they read on the dark panels */
/* Parts / Stock cards (Tyres #FFF8F0, Consumables #F0F8FF) and any other pastel box: the global rules above turn inline navy / grey text light for
   the dark theme, which vanishes on the light tint. Inside a pastel box keep the authored dark colours. (White boxes are repainted dark by the
   theme, so they are NOT in this list.) */
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#1A237E"] { color: #1A237E !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#607D8B"] { color: #607D8B !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#546E7A"] { color: #546E7A !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#616161"] { color: #616161 !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#90A4AE"] { color: #90A4AE !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#B0BEC5"] { color: #B0BEC5 !important; }
html body :is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) [style*="color:#455A64"] { color: #455A64 !important; }
/* Same for the light hover / selected rows of the Dispatch Entry LR table and Inward Challan Entry challan table: their LR No / To / etc. are MudText with
   inline navy or grey, which the global rules force light — put the authored dark colour back while the row is light. */
html body .row-selected [style*="color:#1A237E"], html body .lr-select-table tr:hover [style*="color:#1A237E"], html body .challan-select-table tr:hover [style*="color:#1A237E"] { color: #1A237E !important; }
html body .row-selected [style*="color:#607D8B"], html body .lr-select-table tr:hover [style*="color:#607D8B"], html body .challan-select-table tr:hover [style*="color:#607D8B"] { color: #607D8B !important; }
html body .row-selected [style*="color:#546E7A"], html body .lr-select-table tr:hover [style*="color:#546E7A"], html body .challan-select-table tr:hover [style*="color:#546E7A"] { color: #546E7A !important; }
html body .row-selected [style*="color:#616161"], html body .lr-select-table tr:hover [style*="color:#616161"], html body .challan-select-table tr:hover [style*="color:#616161"] { color: #616161 !important; }
html body .row-selected [style*="color:#90A4AE"], html body .lr-select-table tr:hover [style*="color:#90A4AE"], html body .challan-select-table tr:hover [style*="color:#90A4AE"] { color: #90A4AE !important; }
html body .row-selected [style*="color:#B0BEC5"], html body .lr-select-table tr:hover [style*="color:#B0BEC5"], html body .challan-select-table tr:hover [style*="color:#B0BEC5"] { color: #B0BEC5 !important; }
html body .row-selected [style*="color:#455A64"], html body .lr-select-table tr:hover [style*="color:#455A64"], html body .challan-select-table tr:hover [style*="color:#455A64"] { color: #455A64 !important; }
html[data-theme="dark"] body :not(:is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) *)[style*="color:#2E7D32"] { color: #66BB6A !important; }
html[data-theme="dark"] body :not(:is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) *)[style*="color:#C62828"] { color: #EF5350 !important; }
html[data-theme="dark"] body :not(:is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) *)[style*="color:#E65100"] { color: #FFA726 !important; }
html[data-theme="dark"] body :not(:is([style*="background:#C8E6C9" i], [style*="background:#DCEDC8" i], [style*="background:#E0F2F1" i], [style*="background:#E3F2FD" i], [style*="background:#E8EAF6" i], [style*="background:#E8F5E9" i], [style*="background:#EDE7F6" i], [style*="background:#F0F8FF" i], [style*="background:#F1F8E9" i], [style*="background:#F1F8F2" i], [style*="background:#F2F2F2" i], [style*="background:#F4F7FF" i], [style*="background:#F4FBF4" i], [style*="background:#F5F7FA" i], [style*="background:#F8F9FF" i], [style*="background:#FAFAFA" i], [style*="background:#FFCDD2" i], [style*="background:#FFEBEE" i], [style*="background:#FFF3C4" i], [style*="background:#FFF3E0" i], [style*="background:#FFF3F3" i], [style*="background:#FFF8E1" i], [style*="background:#FFF8F0" i]) *)[style*="color:#1565C0"] { color: #64B5F6 !important; }


/* =====================================================================================================================
   LIGHT THEME — html[data-theme="light"]. Same layout; the colour variables flip, and the few rules that hard-code a dark value
   are overridden here. The sidebar stays the purple #464667 panel in both themes (as in the Figma Assets sheet).
   ===================================================================================================================== */
html[data-theme="light"] {
    --sp-page: #f4f5fa;
    --sp-bg-image: url("../img/sempoa-bg-light.svg");
    --sp-panel: #ffffff;
    --sp-active: #e9eaf5;
    --sp-row-a: #ffffff;
    --sp-row-b: #f3f3fa;
    --sp-head: #4d4d6c;
    --sp-line: #e2e2ee;
    --sp-text: #2b2b3d;
    --sp-muted: #6b6b80;
}
html[data-theme="light"] body { color: var(--sp-text); }

html[data-theme="light"] body .mud-paper.rounded-lg, html[data-theme="light"] body .mud-card, html[data-theme="light"] body .mud-paper.mud-elevation-0 { box-shadow: 0 2px 10px rgba(40, 40, 80, 0.10) !important; }
html[data-theme="light"] body .login-card, html[data-theme="light"] body .branch-card { box-shadow: 0 4px 18px rgba(40, 40, 80, 0.14) !important; }
html[data-theme="light"] body .list-page-grid .mud-table-body .mud-table-row:hover .mud-table-cell { background-color: #eaf2ff !important; }
html[data-theme="light"] body .list-page-grid .mud-table-cell { border-bottom: 1px solid var(--sp-line) !important; }
html[data-theme="light"] body .mud-input-outlined .mud-input-outlined-border,
html[data-theme="light"] body .date-range-input .mud-input-outlined-border,
html[data-theme="light"] body .login-card .mud-input-outlined .mud-input-outlined-border { border-color: #c5c5d6 !important; }
html[data-theme="light"] body .login-card .login-select { background: #fff !important; border-color: #c5c5d6 !important; }
html[data-theme="light"] body .topbar-search .mud-input-outlined fieldset, html[data-theme="light"] body .topbar-search .mud-input-outlined-border { border-color: #c5c5d6 !important; }
html[data-theme="light"] body .mud-button-group-outlined .mud-button-root { border-color: #c5c5d6 !important; color: var(--sp-text) !important; }
html[data-theme="light"] body .mud-picker-calendar .mud-day { color: var(--sp-text); }
html[data-theme="light"] body .mud-picker-calendar-header-day .mud-day-label { color: var(--sp-muted); }
html[data-theme="light"] body .mud-picker-actions .mud-button-root { color: var(--sp-text); }
html[data-theme="light"] body .mud-picker-actions .mud-button-root.mud-button-text-primary { background: var(--sp-primary); color: #fff; }
html[data-theme="light"] body .topbar-count, html[data-theme="light"] body .topbar-user-role { color: var(--sp-muted); }
html[data-theme="light"] body .topbar-theme { color: var(--sp-text); }
html[data-theme="light"] body .page-flex-root .mud-divider { border-color: var(--sp-line); }
html[data-theme="light"] body .mud-table-pagination, html[data-theme="light"] body .mud-table-pagination .mud-select, html[data-theme="light"] body .mud-table-pagination .mud-icon-button { color: var(--sp-muted); }
html[data-theme="light"] body .nav-search-results { box-shadow: 0 4px 16px rgba(40, 40, 80, 0.18); }
/* sidebar header: the company name sits on the purple panel in both themes */
html[data-theme="light"] body .sidebar-drawer { box-shadow: 4px 0 16px rgba(40, 40, 80, 0.18) !important; }
/* the toggle button itself */
html body .topbar-theme { color: var(--sp-text); flex: 0 0 auto; }

/* ---- Light theme: the active sidebar slot is the (light) page colour, so its label and icon go dark; sidebar captions stay readable on the purple ---- */
html[data-theme="light"] body .sidebar-drawer .mud-nav-link.nav-active,
html[data-theme="light"] body .sidebar-drawer .mud-nav-link.nav-active .mud-icon-root,
html[data-theme="light"] body .sidebar-drawer .mud-nav-link.nav-active .mud-nav-link-text { color: #464667 !important; }
html body .sidebar-drawer .brand-tenant { color: rgba(255, 255, 255, 0.72) !important; }
html[data-theme="light"] body .sidebar-drawer .brand-branch { color: #cfe8ff !important; }

/* ---- Filters inside the top bar (Active Consignments): fixed compact widths so the row stays on one line and nothing overlaps ---- */
html body .topbar-actions-slot .mud-select { min-width: 120px !important; width: 120px; }
html body .topbar-actions-slot .mud-checkbox { flex: 0 0 auto; white-space: nowrap; margin: 0; }
html body .topbar-actions-slot .mud-checkbox .mud-typography { white-space: nowrap; }


/* =====================================================================================================================
   TOP BAR, evenly spaced. [☰ ← headline] [ .topbar-body: every filter / search / action box, spread over ALL the free width ] [theme, avatar]
   The groups that used to wrap their children (.topbar-filters, .topbar-filter-group, .topbar-actions-slot) are display:contents, so each
   box is its own item of the body row and space-evenly gives equal gaps between all of them — instead of one clump in the middle.
   When there are too many boxes for one line the body wraps (nothing is cut off); a better answer for that case is a later step.
   ===================================================================================================================== */
html body .topbar-body { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-evenly; gap: 6px 12px; }
html body .topbar-body > .topbar-filters, html body .topbar-body .topbar-filter-group, html body .topbar-body > .topbar-actions-slot { display: contents; }
html body .topbar-filters, html body .topbar-search, html body .topbar-actions-slot { margin: 0 !important; }
html body .topbar-body > .topbar-search { flex: 1 1 200px !important; width: auto; min-width: 130px !important; max-width: 340px !important; }
html body .topbar-body .topbar-actions-slot > * { flex: 0 0 auto; }
html body .topbar-title + .topbar-body { margin-left: 8px; }
/* The search wraps by its small basis (90px) and then grows, so a crowded bar keeps everything on one line and a roomy one spreads out. */
html body .topbar-body { gap: 6px 8px; }
html body .topbar-body > .topbar-search { flex: 1 1 90px !important; min-width: 90px !important; max-width: 240px !important; }

/* Ledger / vehicle pickers inside the top bar need room to show what they hold */
html body .topbar-body .mud-autocomplete, html body .topbar-body .mud-picker:not(.date-range-input) { min-width: 200px; }

/* Date range: the end date ran flush against (1px past) the right border. Right padding inside the field, a little more width, and
   inputs wide enough for "dd/MM/yy" (checked by measuring scrollWidth <= clientWidth). */
html body .topbar-filter-group .mud-picker.date-range-input { width: 228px !important; min-width: 228px !important; }
html body .topbar-filter-group .date-range-root { width: 268px; min-width: 268px; }
html body .mud-picker.date-range-input .mud-input { padding-right: 14px !important; }
html body .topbar-filter-group .date-range-input input { min-width: 66px; padding: 7px 4px !important; }
html body .topbar-filter-group .date-range-input input { width: 66px !important; min-width: 66px !important; max-width: 66px !important; flex: 0 0 66px !important; }
html body .topbar-filter-group .date-range-input .mud-range-input-separator { margin: 0 2px; }
/* the inputs are content-box (width excludes the 4px side padding), so 60px content = 68px box */
html body .topbar-filter-group .date-range-input input { width: 60px !important; min-width: 60px !important; max-width: 60px !important; flex: 0 0 68px !important; box-sizing: content-box; }

/* ---- Pages with a centre group (TopBarCenter) + actions (TopBarSlot): the middle boxes sit in the centre, the actions are one tight group at the right ---- */
html body .topbar-body.has-center { justify-content: flex-start; }
html body .topbar-body.has-center > .topbar-center { display: flex; align-items: center; gap: 12px; margin: 0 auto; }
html body .topbar-body.has-center > .topbar-actions-slot { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* List pages: centre group = date range + page filters + search. Search wraps by a 90px basis, then grows to 220px; the group may shrink. */
html body .topbar-center { flex: 0 1 auto; min-width: 0; }
html body .topbar-center > .topbar-search { flex: 1 1 90px !important; min-width: 90px !important; max-width: 220px !important; width: auto; margin: 0 !important; position: relative; }
html body .topbar-center .topbar-filter-group { display: contents; }
html body .topbar-filter-group .date-range-root { width: 262px; min-width: 262px; }

/* ---- Fit at 1440px with the sidebar open: tighter chrome so [centre group] + [actions] stay on ONE line (measured). ---- */
html body .topbar { padding: 6px 6px !important; gap: 4px; }
html body .topbar-title { font-size: 0.98rem; }
html body .topbar-body { gap: 6px 8px; }
html body .topbar-center { gap: 8px; }
html body .topbar-filter-group { gap: 8px; }
html body .topbar-filter-group .mud-picker.date-range-input { width: 216px !important; min-width: 216px !important; }
html body .topbar-filter-group .date-range-root { width: 252px; min-width: 252px; }
html body .mud-picker.date-range-input .mud-input { padding-left: 6px !important; padding-right: 10px !important; }
html body .topbar-filter-group .mud-select { min-width: 124px !important; width: 124px; }
html body .topbar-actions { gap: 2px; }
html body .topbar-actions .mud-button-root { padding: 4px 10px; }
/* The body stays on one line; the centre group is what gives way: its search shrinks first (basis 90px) and, if that is not enough, the
   group wraps inside its own box — nothing is clipped and the actions stay at the right. */
html body .topbar-body.has-center { flex-wrap: nowrap; }
html body .topbar-center { flex-wrap: wrap; justify-content: center; row-gap: 6px; }
html body .mud-picker.date-range-input .mud-input { padding-right: 12px !important; }
html body .topbar-filter-group .mud-picker.date-range-input { width: 226px !important; min-width: 226px !important; }
html body .topbar-filter-group .date-range-root { width: 262px; min-width: 262px; }

/* The page could be scrolled sideways by ~160px: MudBlazor's button ripple pseudo-element (scaled up, opacity 0) on the buttons at the right end of the
   top bar counted toward the document's scrollable width. `clip` (unlike `hidden`) keeps position:sticky on the top bar working. */
html body .mud-main-content { overflow-x: clip; }

/* ---- Round of fixes after the full-page survey ----
   B: single-line bars were 72px tall because outlined fields in the bar carry label margins; they are compact now (bar 56px).
   A/C: the crowded bars get tighter spacing so the centre group + actions fit on one line at 1440px. ---- */
html body .topbar .mud-input-control { margin-top: 0 !important; margin-bottom: 0 !important; }
html body .topbar .mud-input-control.mud-input-outlined-with-label { margin-top: 0 !important; margin-bottom: 0 !important; }
html body .topbar .mud-input-root-outlined { padding-top: 6px !important; padding-bottom: 6px !important; }
html body .topbar { min-height: 56px; }
html body .topbar-center, html body .topbar-filter-group { gap: 6px; }
html body .topbar-center .mud-button-root, html body .topbar-actions .mud-button-root { padding-left: 8px; padding-right: 8px; }
html body .topbar-filter-group .mud-select { min-width: 112px !important; width: 112px; }
html body .topbar-center > .topbar-search { min-width: 72px !important; }
html body .topbar-title { max-width: 190px; }
html body .quickjump .mud-button-root { min-width: 44px; padding-left: 8px; padding-right: 8px; }
html body .quickjump .mud-input-control { width: 112px; }
html body .topbar-body.has-center .topbar-center, html body .topbar-center .topbar-filter-group { flex-wrap: nowrap; min-width: 0; }
html body .topbar-center > .topbar-search { flex: 1 1 72px; min-width: 72px !important; }
html body .topbar .mud-button-root { white-space: nowrap; }
html body .topbar-title { flex: 0 0 auto; }
html body .topbar .mud-radio .mud-typography { white-space: nowrap; }

/* Menu search lives in the sidebar (it used to float in the top bar). The sidebar is dark in both themes, so keep its colours fixed. */
html body .sidebar-search { padding: 10px 16px 0; }
html body .sidebar-search .nav-search-box .mud-input-outlined { background: rgba(255,255,255,0.10) !important; border-radius: 100px; }
html body .sidebar-search .nav-search-box input { color: #fff !important; }
html body .sidebar-search .nav-search-box fieldset { border-color: rgba(255,255,255,0.25) !important; border-radius: 100px; }
html body .sidebar-search .nav-search-box .mud-icon-root { color: rgba(255,255,255,0.65) !important; }
html body .sidebar-search .nav-search-box input::placeholder { color: rgba(255,255,255,0.55); opacity: 1; }
html body .sidebar-search-results { padding-top: 8px; }
html body .sidebar-search-results .nav-search-result-item { display: flex; align-items: center; padding: 9px 12px; border-radius: 8px; color: rgba(255,255,255,0.9); cursor: pointer; }
html body .sidebar-search-results .nav-search-result-item:hover { background: rgba(255,255,255,0.12); }
html body .sidebar-search-empty { padding: 10px 12px; color: rgba(255,255,255,0.6); font-size: 13px; }
html body .sidebar-drawer .mud-divider { flex: 0 0 auto; height: 1px; min-height: 1px; }
