/* Shapes, icons, buttons and switches */

/* ===== Design: Material 3 (approved Nov 2026) — shapes, icons, buttons, switches; colours unchanged ===== */
html:not(#zA):not(#zB):not(#zC) body .btn, html:not(#zA):not(#zB):not(#zC) body .ir-save, html:not(#zA):not(#zB):not(#zC) body .add-load-btn, html:not(#zA):not(#zB):not(#zC) body .up-btn, html:not(#zA):not(#zB):not(#zC) body .form-control:not(textarea), html:not(#zA):not(#zB):not(#zC) body .ss-selected, html:not(#zA):not(#zB):not(#zC) body .dtf-btn, html:not(#zA):not(#zB):not(#zC) body .card-status-select, html:not(#zA):not(#zB):not(#zC) body .dock-team-select, html:not(#zA):not(#zB):not(#zC) body .dock-theme, html:not(#zA):not(#zB):not(#zC) body #loadForm .tb input:not([type=checkbox]):not([type=radio]):not([type=file]), html:not(#zA):not(#zB):not(#zC) body #loadForm select, html:not(#zA):not(#zB):not(#zC) body .search-clear, html:not(#zA):not(#zB):not(#zC) body .wc-toggle, html:not(#zA):not(#zB):not(#zC) body .date-range-filter, html:not(#zA):not(#zB):not(#zC) body .dsx-notes, html:not(#zA):not(#zB):not(#zC) body .dsx-toggle, html:not(#zA):not(#zB):not(#zC) body .tb-add { border-radius: 999px !important; }
html:not(#zA):not(#zB):not(#zC) body .btn, html:not(#zA):not(#zB):not(#zC) body .ir-save, html:not(#zA):not(#zB):not(#zC) body .add-load-btn, html:not(#zA):not(#zB):not(#zC) body .up-btn { min-height: 40px !important; padding-left: 20px !important; padding-right: 20px !important; font-weight: 600 !important; gap: 7px; transition: background-color .15s, border-color .15s, box-shadow .2s, transform .12s !important; }
html:not(#zA):not(#zB):not(#zC) body .btn:active, html:not(#zA):not(#zB):not(#zC) body .ir-save:active, html:not(#zA):not(#zB):not(#zC) body .add-load-btn:active, html:not(#zA):not(#zB):not(#zC) body .up-btn:active { transform: scale(.97); }
html:not(#zA):not(#zB):not(#zC) body .btn:not(.btn-outline):not(.btn-danger), html:not(#zA):not(#zB):not(#zC) body .ir-save, html:not(#zA):not(#zB):not(#zC) body .add-load-btn { box-shadow: var(--shadow-sm) !important; }
html:not(#zA):not(#zB):not(#zC) body .btn.btn-outline { background: var(--soft-fill) !important; border-color: transparent !important; }
html:not(#zA):not(#zB):not(#zC) body .view-toggle, html:not(#zA):not(#zB):not(#zC) body .alx-seg { background: transparent !important; border: 0 !important; border-radius: 999px !important; padding: 0px !important; gap: 2px; box-shadow: none !important; }
html:not(#zA):not(#zB):not(#zC) body .view-toggle-btn, html:not(#zA):not(#zB):not(#zC) body .alx-seg button { border-radius: 999px !important; border: 0 !important; background: transparent !important; transition: background-color .2s, color .2s, box-shadow .2s !important;  }
html:not(#zA):not(#zB):not(#zC) body .view-toggle-btn.active, html:not(#zA):not(#zB):not(#zC) body .alx-seg button[aria-checked="true"] { background: var(--primary-soft) !important; box-shadow: var(--shadow-sm) !important; color: var(--text-main) !important; box-shadow: none !important; color: var(--primary) !important; }
html:not(#zA):not(#zB):not(#zC) body .view-toggle, html:not(#zA):not(#zB):not(#zC) body .alx-seg { border: 1px solid var(--border-strong) !important; gap: 0 !important; }
html:not(#zA):not(#zB):not(#zC) body .wc-switch, html:not(#zA):not(#zB):not(#zC) body .alx-sw input, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input { box-sizing: border-box !important; width: 44px !important; height: 26px !important; border-radius: 999px !important; background: transparent !important; border: 2px solid var(--border-strong) !important; transition: background-color .25s ease, border-color .25s ease !important; position: relative; }
html:not(#zA):not(#zB):not(#zC) body .wc-switch::after, html:not(#zA):not(#zB):not(#zC) body .alx-sw input::after, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input::after { left: 4.0px !important; top: 4.0px !important; width: 14px !important; height: 14px !important; border-radius: 50% !important; background: var(--border-strong) !important; box-shadow: var(--shadow-sm) !important; transition: transform .38s cubic-bezier(.2,0,0,1), width .25s ease, height .25s ease, top .25s ease, left .25s ease, background-color .2s !important; }
html:not(#zA):not(#zB):not(#zC) body .wc-toggle input:checked + .wc-switch, html:not(#zA):not(#zB):not(#zC) body .alx-sw input:checked, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input:checked { border-color: transparent !important; }
html:not(#zA):not(#zB):not(#zC) body .wc-toggle input:checked + .wc-switch { background: var(--primary-fill) !important; }
html:not(#zA):not(#zB):not(#zC) body .alx-sw input:checked { background: var(--success) !important; }
html:not(#zA):not(#zB):not(#zC) body .wc-toggle input:checked + .wc-switch::after, html:not(#zA):not(#zB):not(#zC) body .alx-sw input:checked::after, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input:checked::after { width: 20px !important; height: 20px !important; top: 1.0px !important; left: 1.0px !important; transform: translateX(15.0px) !important; background: #fff !important; }
html:not(#zA):not(#zB):not(#zC) body .wc-switch::before, html:not(#zA):not(#zB):not(#zC) body .alx-sw input::before, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input::before { content: ""; position: absolute; z-index: 2; width: 20px; height: 20px; top: 1.0px; left: 1.0px; transform: translateX(15.0px) scale(.45); opacity: 0; background: var(--primary-fill); -webkit-mask: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27none%27%20stroke-width=%273.4%27%20viewBox=%270%200%2024%2024%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20d=%27M20%206%209%2017l-5-5%27%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27none%27%20stroke-width=%273.4%27%20viewBox=%270%200%2024%2024%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20d=%27M20%206%209%2017l-5-5%27%3E%3C/path%3E%3C/svg%3E") center/contain no-repeat; transition: opacity .2s ease .1s; }
html:not(#zA):not(#zB):not(#zC) body .wc-toggle input:checked + .wc-switch::before, html:not(#zA):not(#zB):not(#zC) body .alx-sw input:checked::before, html:not(#zA):not(#zB):not(#zC) body .tb .tb-sw input:checked::before { opacity: 1; }
html:not(#zA):not(#zB):not(#zC) body .alx-sw input::before { background: var(--success); }
html:not(#zA):not(#zB):not(#zC) body .dock .dock-tab { border-radius: 999px !important; transition: background-color .2s, color .2s !important; }

/* List view: one profit line per dispatcher, level with the names */
.list-pf2 { display: grid; gap: 0; justify-items: end; }
.list-pf2 .list-pf { line-height: 17px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Users: all columns visible without sideways scrolling */
#usersTableContainer .table-responsive { overflow-x: visible; }
table.users-table { table-layout: fixed; width: 100%; }
table.users-table col.uc-name { width: 18%; } table.users-table col.uc-login { width: 10%; } 
table.users-table col.uc-roles { width: 13%; } table.users-table col.uc-teams { width: 12%; } table.users-table col.uc-st { width: 7%; } table.users-table col.uc-act { width: 25%; }
table.users-table th, table.users-table td { white-space: normal !important; overflow-wrap: anywhere; vertical-align: middle; }
table.users-table .ua-name { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
table.users-table .user-roles { line-height: 1.9; }
html:not(#zA):not(#zB):not(#zC) body table.users-table .row-actions { display: flex !important; flex-wrap: wrap !important; justify-content: flex-end; gap: 6px; white-space: normal !important; width: auto !important; max-width: 100%; }
html:not(#zA):not(#zB):not(#zC) body table.users-table .row-actions .btn { white-space: nowrap; min-height: 32px !important; height: 32px; padding: 0 12px !important; font-size: 12.5px !important; gap: 5px; }
html:not(#zA):not(#zB):not(#zC) body table.users-table .row-actions .btn .ic { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 1180px) {
    table.users-table, table.users-table tbody, table.users-table tr, table.users-table td { display: block; width: auto; }
    table.users-table colgroup, table.users-table thead { display: none; }
    table.users-table tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; padding: 12px; }
    table.users-table tbody tr { display: flex !important; flex-direction: column; gap: 7px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg-card); }
    table.users-table td { position: relative; padding: 0 0 0 112px !important; border: 0 !important; text-align: left !important; min-height: 20px; line-height: 1.5; max-width: none !important; width: auto !important; background: transparent !important; overflow: visible; }
    table.users-table td::before { content: attr(data-label); position: absolute; left: 0; top: 1px; width: 104px; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
    table.users-table td.db-name, table.users-table td.u-act { padding-left: 0 !important; }
    table.users-table td.db-name::before, table.users-table td.u-act::before { content: none; }
    table.users-table td.db-name .ua-name { font-weight: 700; font-size: 14px; padding-bottom: 2px; }
    table.users-table td.user-roles { line-height: 1.6; }
    html:not(#zA):not(#zB):not(#zC) body table.users-table td.u-act .row-actions { justify-content: flex-start; padding-top: 4px; margin-left: 0 !important; width: 100% !important; }
}
@media (max-width: 520px) { table.users-table tbody { grid-template-columns: 1fr; padding: 8px 0; } table.users-table td { padding-left: 96px !important; } table.users-table td::before { width: 90px; } }

/* ===== Fixes 189 ===== */
.ic-lg-add { --i: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27black%27%20stroke-width=%270%27%20viewBox=%270%200%2024%2024%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20fill=%27none%27%20d=%27M0%200h24v24H0z%27%3E%3C/path%3E%3Cpath%20d=%27M13%207h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48%202%202%206.48%202%2012s4.48%2010%2010%2010%2010-4.48%2010-10S17.52%202%2012%202m0%2018c-4.41%200-8-3.59-8-8s3.59-8%208-8%208%203.59%208%208-3.59%208-8%208%27%3E%3C/path%3E%3C/svg%3E"); }
.ic-lg-status { --i: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27black%27%20stroke-width=%270%27%20viewBox=%270%200%2024%2024%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20fill=%27none%27%20d=%27M0%200h24v24H0z%27%3E%3C/path%3E%3Cpath%20d=%27m14%206-1-2H5v17h2v-7h5l1%202h7V6zm4%208h-4l-1-2H7V6h5l1%202h5z%27%3E%3C/path%3E%3C/svg%3E"); }
.ic-lg-pay { --i: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27black%27%20stroke-width=%270%27%20viewBox=%270%200%2024%2024%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20fill=%27none%27%20d=%27M0%200h24v24H0z%27%3E%3C/path%3E%3Cpath%20d=%27M19%2014V6c0-1.1-.9-2-2-2H3c-1.1%200-2%20.9-2%202v8c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2m-9-1c-1.66%200-3-1.34-3-3s1.34-3%203-3%203%201.34%203%203-1.34%203-3%203m13-6v11c0%201.1-.9%202-2%202H4v-2h17V7z%27%3E%3C/path%3E%3C/svg%3E"); }
.ic-lg-edit { --i: url("data:image/svg+xml,%3Csvg%20stroke=%27black%27%20fill=%27black%27%20stroke-width=%270%27%20viewBox=%270%200%2024%2024%27%20xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath%20fill=%27none%27%20d=%27M0%200h24v24H0z%27%3E%3C/path%3E%3Cpath%20d=%27M3%2010h11v2H3zm0-2h11V6H3zm0%208h7v-2H3zm15.01-3.13.71-.71a.996.996%200%200%201%201.41%200l.71.71c.39.39.39%201.02%200%201.41l-.71.71zm-.71.71-5.3%205.3V21h2.12l5.3-5.3z%27%3E%3C/path%3E%3C/svg%3E"); }
/* Activity Log: one small icon in front of each change */
ul.lg-c li.lg-li, html:not(#zA):not(#zB):not(#zC) body ul.lg-c li.lg-li { display: grid !important; grid-template-columns: 16px minmax(0, 1fr) !important; column-gap: 8px; align-items: start; }
ul.lg-c li.lg-li > .lg-i { grid-column: 1 !important; grid-row: 1 !important; }
ul.lg-c li.lg-li > .lg-tx { display: block; grid-column: 2 !important; grid-row: 1 !important; }
ul.lg-c .lg-i { font-size: 14px; margin-top: 2px; color: var(--tb-muted, var(--text-muted)); }
ul.lg-c .lg-tx { min-width: 0; }
ul.lg-c .lg-t-created .lg-i, ul.lg-c .lg-t-money .lg-i { color: var(--success); }
ul.lg-c .lg-t-status .lg-i, ul.lg-c .lg-t-updated .lg-i { color: var(--primary); }
ul.lg-c .lg-t-payment .lg-i { color: var(--warning); }
ul.lg-c .lg-off .lg-i { color: var(--danger); }
/* View Load: the status right before the Close (X) button */
.st1v .st-tt.st-vtt { flex-wrap: nowrap; }
.st1v .st-tt.st-vtt .ih-idl { flex: 1 1 auto; }
.st1v .st-tt .vst-st { flex: none; margin-left: auto; display: inline-flex; align-items: center; }
.st1v .st-tt .vst-st .tb-pillv { height: 26px; font-size: 12px; white-space: nowrap; }
#viewModalOverlay .st1v .st-tt { padding-right: 58px; min-height: 52px; }
@media (max-width: 639px) { #viewModalOverlay .st1v .st-tt { padding-right: 56px; } }
/* Database: Enable / Disable */
@media (min-width: 900px) { .data-table td.db-en-c { width: 1%; white-space: nowrap; } }
@media (max-width: 899px) { .data-table td.db-en-c .wc-toggle.db-en { justify-self: end; } }
.wc-toggle.db-en { height: 32px; padding: 0 10px; font-size: 12.5px; }
.wc-toggle.db-en .db-en-t { min-width: 56px; }
.data-table tr.db-off td.db-name, .data-table tr.db-off td:not(.db-en-c):not(.align-right) { color: var(--text-faint, var(--text-muted)); }
.data-table tr.db-off .db-en-t { color: var(--text-muted); }
@media (max-width: 600px) { .wc-toggle.db-en .db-en-t { min-width: 0; } }
/* ===== Fixes 186: Statistics "Include active loads" switch ===== */
#statsView .header-actions { flex-wrap: wrap; }
.stats-active-toggle { white-space: nowrap; order: 99; }

/* status at the top centre (signing in / out, file uploads) — theme colours only */
.app-status { position: fixed; top: 14px; left: 50%; z-index: 2147483000; display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); box-sizing: border-box;
    padding: 9px 18px 9px 14px; border-radius: 999px; background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border); box-shadow: var(--shadow-md);
    font: 600 13.5px var(--font); white-space: nowrap; opacity: 0; transform: translate(-50%, -14px) scale(.97); pointer-events: none;
    transition: opacity .28s cubic-bezier(.2,0,0,1), transform .42s cubic-bezier(.2,0,0,1); }
.app-status.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.app-status .as-t { overflow: hidden; text-overflow: ellipsis; }
.app-status .as-ic { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.app-status .as-ic .ic { font-size: 17px; }
.app-status.busy .as-ic { box-sizing: border-box; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--primary); animation: as-spin .8s linear infinite; }
.app-status.ok .as-ic { color: var(--success); }
.app-status.err .as-ic { color: var(--danger); }
.app-status .as-bar { width: 84px; height: 4px; border-radius: 99px; background: var(--soft-fill); overflow: hidden; flex: none; }
.app-status .as-bar[hidden] { display: none; }
.app-status .as-bar i { display: block; height: 100%; width: 3%; border-radius: inherit; background: var(--primary); transition: width .25s ease; }
@keyframes as-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .app-status { transition: opacity .2s; } .app-status.busy .as-ic { animation-duration: 2s; } }
/* uploads: a real button; files being sent show a progress bar */
.tb-drop.up-zone { cursor: default; }

/* Active Loads: Financial Summary and Active Loads by Status are exactly the same width; they meet at the center */
html:not(#zA):not(#zB):not(#zC) body .dsx { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 12px; }
html:not(#zA):not(#zB):not(#zC) body .dsx > .dsx-card { width: auto; min-width: 0; margin: 0; }
html:not(#zA):not(#zB):not(#zC) body .dsx > .dsx-card { container-type: inline-size; }
/* a narrow panel (tablets) stacks its own contents, so nothing is cut off — the same compact layout phones already use */
@container (max-width: 459px) {
    .dsx-fin { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .dsx-rest { border-left: 0; padding-left: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
    .dsx-head { flex-wrap: wrap; }
    .dsx-notes { margin-left: 0; }
    .dsx-rows { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
    .dsx-r { grid-template-columns: minmax(96px, 132px) minmax(0, 1fr) 32px; }
}
@container (max-width: 329px) { .dsx-rest { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { html:not(#zA):not(#zB):not(#zC) body .dsx { grid-template-columns: minmax(0, 1fr); } }

/* Activity Log: avatar to the left of the name */
.lg-who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lg-who .ua { --ua-size: 22px; color: #fff; font-weight: 600; }
.lg-who .ua-system { color: var(--text-muted); }
.lg-who .lg-by { min-width: 0; }
.lg-h time { padding-left: 29px; }
@media (max-width: 640px) { .lg-h { align-items: center; } .lg-h time { padding-left: 0; } }

/* Sticky table headers everywhere: the headings stay visible while the rows scroll */
html:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th { position: sticky; top: var(--th-top, 0px); z-index: 3; }

/* the boxes around these tables no longer catch the sticky header (their page area already scrolls) */
html:not(#zA):not(#zB):not(#zC) body #dbTableContainer .table-responsive,
html:not(#zA):not(#zB):not(#zC) body #teamsTableContainer .table-responsive { overflow: visible; }

/* heading text is black in Light and Dark */
html:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th, html:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th *, html:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th::after { color: #000 !important; }
/* Dark theme: a light heading band so the black text stays readable */
html[data-theme="dark"]:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th { background: #DCDDE0 !important; border-bottom-color: #B9BBC0 !important; }
html[data-theme="dark"]:not(#zA):not(#zB):not(#zC) body .data-table > thead > tr > th + th { box-shadow: inset 1px 0 0 #B9BBC0, 0 1px 0 #B9BBC0; }
