/*
The look of the whole site.

Django's admin pages get their colours from a list of "variables" (the --name
lines below). We simply give those variables our own values, so every built-in
screen picks up the new look without any of the admin pages being rewritten.
The second half of the file styles our own reconciliation report.
*/

/* ------------------------------------------------------------------ */
/* 1. Colours                                                          */
/* ------------------------------------------------------------------ */

html[data-theme="light"], :root {
    --primary: var(--swl-strong);          /* logo navy — main brand             */
    --secondary: var(--swl-strong);
    --accent: var(--swl-accent);           /* logo red — highlights / active     */
    --primary-fg: var(--swl-surface);

    --body-fg: var(--swl-ink);
    --body-bg: var(--swl-page);          /* soft grey page background          */
    --body-quiet-color: var(--swl-muted);
    --body-medium-color: var(--swl-muted);
    --body-loud-color: var(--swl-ink);

    --header-color: var(--swl-head-muted);
    --header-branding-color: var(--swl-surface);
    --header-bg: var(--swl-strong);
    --header-link-color: var(--swl-surface);

    --breadcrumbs-fg: var(--swl-line);
    --breadcrumbs-link-fg: var(--swl-surface);
    --breadcrumbs-bg: var(--swl-strong);

    --link-fg: var(--swl-primary);
    --link-hover-color: var(--swl-strong-hover);
    --link-selected-fg: var(--swl-strong);

    --hairline-color: var(--swl-line);
    --border-color: var(--swl-line);

    --darkened-bg: var(--swl-line);
    --selected-bg: var(--swl-selected);
    --selected-row: var(--swl-accent-soft);

    --button-bg: var(--swl-primary);
    --button-hover-bg: var(--swl-strong);
    --default-button-bg: var(--swl-go);      /* the main "save" button: green */
    --default-button-hover-bg: var(--swl-go);
    --object-tools-bg: var(--swl-strong);
    --object-tools-hover-bg: var(--swl-strong-hover);
}

/* ------------------------------------------------------------------ */
/* 2. General tidying of the built-in screens                          */
/* ------------------------------------------------------------------ */

body { font-size: 14px; }

/* The site name at the top left. */
#branding h1, #site-name a { font-weight: 600; letter-spacing: .2px; }

/* Give the boxes on every page a soft edge and a light shadow, so the
   page reads as a set of cards rather than one flat sheet. */
.module, .dashboard .module, #content-main .module {
    border: 1px solid var(--hairline-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 25, 31, .06);
    background: var(--swl-surface);
}
.module h2, .module caption {
    background: var(--swl-strong);
    font-size: 13px;
    letter-spacing: .3px;
    text-transform: none;
}

/* Table rows: a little more breathing room and a clear hover line. */
#changelist table tbody td, #changelist table tbody th { padding: 9px 10px; }
#changelist table tbody tr:hover { background: var(--swl-soft); }

/* Buttons with rounded corners. */
.button, input[type=submit], input[type=button], .submit-row input, a.button {
    border-radius: 6px;
    padding: 8px 14px;
}

/* The left-hand navigation panel. */
#nav-sidebar { background: var(--swl-surface); }

/* ------------------------------------------------------------------ */
/* 3. The top menu bar we add ourselves                                */
/* ------------------------------------------------------------------ */

/* The branch (Lahore / Islamabad / Multan) switcher - the top-most bar, so it
   is always clear which set-up you are working in. */
.branchtabs {
    background: var(--swl-head-deep);
    padding: 6px 32px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.branchtabs-label {
    color: var(--swl-head-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-right: 4px;
}
.branchtabs a {
    color: var(--swl-head-muted);
    text-decoration: none;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
}
.branchtabs a:hover { background: rgba(255, 255, 255, .08); color: var(--swl-on); }
.branchtabs a.on {
    background: var(--swl-accent);
    color: var(--swl-ink);
}
.branchtabs-fixed {
    background: var(--swl-accent);
    color: var(--swl-ink);
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 6px 6px 0 0;
}

.topnav {
    background: var(--swl-strong);
    padding: 0 32px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.topnav a {
    color: var(--swl-head-muted);
    text-decoration: none;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
}
.topnav a:hover { color: var(--swl-on); background: rgba(255, 255, 255, .06); }
.topnav a.current { color: var(--swl-on); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------ */
/* 4. The reconciliation report                                        */
/* ------------------------------------------------------------------ */

.report-intro {
    color: var(--body-quiet-color);
    max-width: 780px;
    line-height: 1.55;
    margin: 0 0 18px;
}

/* The row of filter boxes at the top. */
.filter-bar {
    background: var(--swl-surface);
    border: 1px solid var(--hairline-color);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    box-shadow: 0 1px 2px rgba(16, 25, 31, .06);
}
.filter-bar label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--body-quiet-color);
    margin-bottom: 5px;
    font-weight: 600;
}
.filter-bar select {
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--swl-surface);
    min-width: 150px;
}
.filter-bar .actions { margin-left: auto; display: flex; gap: 10px; }

/* The two-way toggle: count the month by order date or by delivery date. */
.toggle { display: inline-flex; border: 1px solid var(--border-color); border-radius: 6px; overflow: hidden; }
.toggle a {
    padding: 7px 14px;
    font-size: 13px;
    text-decoration: none;
    color: var(--body-medium-color);
    background: var(--swl-surface);
}
.toggle a + a { border-left: 1px solid var(--border-color); }
.toggle a.on { background: var(--swl-strong); color: var(--swl-on); font-weight: 600; }

/* The headline number cards. */
.cards { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.card {
    background: var(--swl-surface);
    border: 1px solid var(--hairline-color);
    border-left: 4px solid var(--swl-strong);
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 160px;
    flex: 1 1 160px;
    box-shadow: 0 1px 2px rgba(16, 25, 31, .06);
}
.card .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--body-quiet-color);
    font-weight: 600;
}
.card .value { font-size: 26px; font-weight: 600; color: var(--body-loud-color); margin-top: 4px; }
.card .note { font-size: 12px; color: var(--body-quiet-color); margin-top: 3px; }
.card.money { border-left-color: var(--swl-go); }
.card.warn  { border-left-color: var(--swl-warn); }

/* The side-by-side comparison of the two ways of counting the month. */
.compare {
    background: var(--swl-accent-soft);
    border: 1px solid var(--swl-accent-line);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 24px;
}
.compare h3 { margin: 0 0 8px; font-size: 14px; color: var(--swl-warn-ink); }
.compare table { border-collapse: collapse; }
.compare td { padding: 4px 22px 4px 0; font-size: 14px; }
.compare .gap { font-weight: 700; }

/* Report tables. */
table.report {
    width: 100%;
    border-collapse: collapse;
    background: var(--swl-surface);
    border: 1px solid var(--hairline-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 25, 31, .06);
    margin-bottom: 28px;
}
table.report th {
    background: var(--swl-strong);
    color: var(--swl-on);
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    letter-spacing: .3px;
    font-weight: 600;
}
table.report td { padding: 9px 12px; border-top: 1px solid var(--hairline-color); }
table.report tbody tr:hover { background: var(--swl-soft); }
table.report tfoot td {
    background: var(--swl-soft);
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}
table.report .num { text-align: right; white-space: nowrap; }
table.report .neg { color: var(--swl-danger-ink); font-weight: 600; }
table.report .pos { color: var(--swl-ok-ink); font-weight: 600; }

/* Small coloured labels used in the variance list. */
.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    white-space: nowrap;
}
.tag.month  { background: var(--swl-accent-soft); color: var(--swl-warn-ink); }
.tag.carton { background: var(--swl-danger-soft); color: var(--swl-danger-ink); }

.section-title { font-size: 16px; margin: 6px 0 10px; color: var(--body-loud-color); }
.empty-note {
    background: var(--swl-ok-soft);
    border: 1px solid var(--swl-ok-line);
    color: var(--swl-ok-ink);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

/* The header is a single row by default; let our menu bar drop onto its own
   full-width line underneath the site name and the user links. */
#header { flex-wrap: wrap; padding-bottom: 0; }
#header #branding, #header #user-tools { padding-bottom: 10px; }
.topnav {
    width: 100%;
    margin: 0 -40px;
    padding: 0 40px;
    box-sizing: content-box;
}

/* ------------------------------------------------------------------ */
/* 5. The four-step workflow bar and the quieter second row           */
/* ------------------------------------------------------------------ */

/* The step number badge on each main tab. */
.topnav .step {
    display: inline-block;
    width: 18px; height: 18px; line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 11px;
    margin-right: 6px;
}
.topnav a.current .step { background: var(--accent); color: var(--swl-ink); }

/* The second row (data tables + report) is smaller and dimmer. */
.topnav.subnav { background: var(--swl-strong); }
.topnav.subnav a { font-size: 12px; padding: 7px 12px; color: var(--swl-head-muted); }
.topnav.subnav a:hover { color: var(--swl-on); }

/* ------------------------------------------------------------------ */
/* 6. Loading page: one collapsible line per truck                     */
/* ------------------------------------------------------------------ */

.truck-list { display: flex; flex-direction: column; gap: 8px; }
.truck {
    border: 1px solid var(--hairline-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--swl-surface);
    box-shadow: 0 1px 2px rgba(16, 25, 31, .06);
}
.truck-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: var(--swl-surface);
    border: 0;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    font-family: inherit;
    color: var(--body-fg);
}
.truck-head:hover { background: var(--swl-soft); }
.truck-head.open { background: var(--swl-soft); border-bottom: 1px solid var(--hairline-color); }
.truck-head .chev { color: var(--primary); font-size: 11px; width: 12px; }
.truck-head .reg { font-weight: 600; letter-spacing: .2px; }
.truck-head .muted { color: var(--body-quiet-color); font-size: 13px; }
.truck-head .spacer { flex: 1; }
.truck-body { padding: 0; }
.truck-body .report th { border-radius: 0; }

/* ------------------------------------------------------------------ */
/* 7. Rate sheet: frozen left columns + scrolling rate columns         */
/* ------------------------------------------------------------------ */

.rate-wrap { overflow: auto; max-height: 78vh; border: 1px solid var(--hairline-color); border-radius: 8px; background: var(--swl-surface); }
table.rate-sheet { border-collapse: separate; border-spacing: 0; font-size: 12px; }
table.rate-sheet th, table.rate-sheet td { padding: 5px 9px; border-bottom: 1px solid var(--hairline-color); border-right: 1px solid var(--hairline-color); white-space: nowrap; }
table.rate-sheet thead th { position: sticky; top: 0; z-index: 3; background: var(--swl-strong); color: var(--swl-on); text-align: center; }
table.rate-sheet .diesel { font-weight: 400; font-size: 10px; color: var(--swl-head-muted); }
/* frozen left columns */
.frz { position: sticky; background: var(--swl-surface); z-index: 2; }
table.rate-sheet thead .frz { z-index: 4; background: var(--swl-strong); }
.frz-1 { left: 0; min-width: 110px; }
.frz-2 { left: 110px; min-width: 100px; }
.frz-3 { left: 210px; min-width: 150px; font-weight: 600; }
table.rate-sheet tbody tr:nth-child(even) td { background: var(--swl-soft); }
table.rate-sheet tbody tr:nth-child(even) .frz { background: var(--swl-soft); }
.rateval { text-align: right; }
.ratecol { min-width: 74px; }
/* phone: only Town stays locked (the 3 locked columns were wider than the screen) */
@media (max-width: 700px) {
    table.rate-sheet .frz-1, table.rate-sheet .frz-2 { left: auto; }
    table.rate-sheet tbody .frz-1, table.rate-sheet tbody .frz-2 { position: static; }
    table.rate-sheet .frz-3 { left: 0; min-width: 0; width: 120px; max-width: 120px; white-space: normal; box-shadow: 2px 0 0 var(--hairline-color); }
}

/* editable rate boxes on the rate sheet */
.rate-sheet .rate-input {
    width: 66px; text-align: right; padding: 3px 4px;
    border: 1px solid var(--border-color); border-radius: 4px; font-size: 12px;
    background: var(--swl-accent-soft);
}
.rate-sheet .rate-input:focus { outline: 2px solid var(--accent); background: var(--swl-surface); }

/* ------------------------------------------------------------------ */
/* 8. Use the full screen width for the admin content (Products, etc.) */
/* ------------------------------------------------------------------ */

/* Django caps the content width; on a laptop that leaves the tables narrow.
   Let the content stretch to the full window instead. */
#container, .main, #content, #content-main { max-width: none !important; width: auto; }
#content { padding-left: 24px; padding-right: 24px; }
/* Wide tables scroll inside their own box rather than squashing. */
#changelist .results { overflow-x: auto; }
#result_list { width: 100%; }
/* The change form fieldsets can use more width too. */
.module, fieldset.module { max-width: none; }

/* Make the changelist table fill the wide content and space columns out. */
#result_list { width: 100% !important; table-layout: auto; }
#result_list .field-name, #result_list th.column-name { min-width: 320px; }
#result_list td, #result_list th { vertical-align: middle; }
/* keep the size number boxes tidy */
#result_list input[type="number"] { width: 74px; }

/* ------------------------------------------------------------------ */
/* 9. Home dashboard (KPIs + panels) — style only; RBAC stays in HTML  */
/* ------------------------------------------------------------------ */

.hm { margin: 0 0 28px; }

.hm-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px solid var(--swl-line);
    background:
        radial-gradient(ellipse 55% 90% at 100% 0%, rgba(236, 75, 79, .10), transparent 55%),
        linear-gradient(135deg, #F7F8FC 0%, #EEF0F8 55%, #FFFFFF 100%);
    color: #2E3278;
    box-shadow: 0 8px 22px rgba(91, 97, 181, .08);
    animation: hm-rise .45s ease-out both;
}
/* Beat admin #content h1 rules — always readable on this banner */
#content .hm-hero .hm-hero__eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #D64545;
}
#content .hm-hero .hm-hero__title,
#content .hm-hero h1.hm-hero__title {
    margin: 0;
    font-size: clamp(1.45rem, 2.4vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: #2E3278 !important;
    line-height: 1.15;
}
#content .hm-hero .hm-hero__date {
    margin: 6px 0 0;
    font-size: 14px;
    color: #5A5E73;
}
html[data-theme="dark"] .hm-hero {
    background:
        radial-gradient(ellipse 55% 90% at 100% 0%, rgba(242, 92, 96, .22), transparent 55%),
        linear-gradient(135deg, #2A3050 0%, #3C4097 100%);
    border-color: transparent;
    color: #FFFFFF;
}
html[data-theme="dark"] #content .hm-hero .hm-hero__eyebrow { color: #FFB3B5; }
html[data-theme="dark"] #content .hm-hero .hm-hero__title,
html[data-theme="dark"] #content .hm-hero h1.hm-hero__title { color: #FFFFFF !important; }
html[data-theme="dark"] #content .hm-hero .hm-hero__date { color: #D8DCF0; }
.hm-hero__hint {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6B7088;
    max-width: 11rem;
    text-align: right;
}
html[data-theme="dark"] .hm-hero__hint { color: #D8DCF0; }

.hm-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
.hm-kpi {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 148px;
    padding: 16px 18px 14px;
    border-radius: 14px;
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
    color: var(--swl-ink) !important;
    text-decoration: none !important;
    overflow: hidden;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
    animation: hm-rise .5s ease-out both;
}
.hm-kpi::before {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--swl-primary);
}
.hm-kpi--go::before { background: var(--swl-go); }
.hm-kpi--warn::before { background: var(--swl-danger); }
.hm-kpi:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--swl-primary) 35%, var(--swl-line));
    box-shadow: 0 12px 28px rgba(15, 36, 32, .12);
}
.hm-kpi__label {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
}
.hm-kpi__num {
    font-size: clamp(2rem, 3.2vw, 2.55rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.03em;
    color: var(--swl-ink);
}
.hm-kpi__num.is-warn { color: var(--swl-danger-ink); }
.hm-kpi__sub {
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--swl-muted);
    flex: 1;
}
.hm-kpi__days {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid var(--swl-line);
}
.hm-kpi__day {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: var(--swl-ink);
}
.hm-kpi__day.is-past { color: var(--swl-danger-ink); font-weight: 700; }
.hm-kpi__day.is-more { color: var(--swl-muted); }
.hm-kpi__go {
    margin-top: auto;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--swl-link);
}
.hm-kpi__go::after { content: " →"; }

.hm-kpis > :nth-child(2) { animation-delay: .05s; }
.hm-kpis > :nth-child(3) { animation-delay: .1s; }
.hm-kpis > :nth-child(4) { animation-delay: .15s; }

.hm-panels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.hm-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 18px 16px;
    border-radius: 14px;
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
    animation: hm-rise .55s ease-out both;
}
.hm-panels > :nth-child(1) { animation-delay: .18s; }
.hm-panels > :nth-child(2) { animation-delay: .22s; }
.hm-panels > :nth-child(3) { animation-delay: .26s; }

.hm-panel__title {
    margin: 0;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--swl-line);
    background: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--swl-ink);
}
.hm-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hm-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: var(--swl-soft);
    color: var(--swl-ink) !important;
    text-decoration: none !important;
    font-size: 14.5px;
    transition: background .12s ease, border-color .12s ease;
}
.hm-list__row strong { color: var(--swl-link); font-weight: 700; }
.hm-list__row strong::after { content: " →"; font-weight: 700; }
.hm-list__row:hover {
    background: var(--swl-selected);
    border-color: color-mix(in srgb, var(--swl-primary) 25%, transparent);
}

.hm-diesel { display: flex; flex-direction: column; gap: 10px; }
.hm-diesel__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 14.5px;
}
.hm-diesel__price {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--swl-ink);
}
.hm-diesel__move { font-weight: 700; font-size: 13.5px; }
.hm-diesel__move.is-ok { color: var(--swl-ok-ink); }
.hm-diesel__move.is-revise { color: var(--swl-danger-ink); }
.hm-diesel__note {
    margin: 0;
    font-size: 13px;
    color: var(--swl-muted);
    line-height: 1.35;
}
.hm-panel__link {
    margin-top: auto;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--swl-link) !important;
    text-decoration: none !important;
}
.hm-panel__link::after { content: " →"; }

.hm-actions { display: flex; flex-direction: column; gap: 8px; }
.hm-action {
    display: block;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1.5px solid var(--swl-primary);
    background: var(--swl-surface);
    color: var(--swl-link) !important;
    font-size: 14.5px;
    font-weight: 700;
    text-align: center;
    text-decoration: none !important;
    transition: background .12s ease, transform .12s ease, border-color .12s ease;
}
.hm-action:hover {
    background: var(--swl-selected);
    transform: translateY(-1px);
}
.hm-action--main {
    background: linear-gradient(180deg, #6B71C4, var(--swl-strong));
    border-color: var(--swl-strong);
    color: var(--swl-on) !important;
    box-shadow: 0 8px 18px rgba(91, 97, 181, .22);
}
.hm-action--main:hover {
    filter: brightness(1.04);
    background: linear-gradient(180deg, #6B71C4, var(--swl-strong));
}

@keyframes hm-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1100px) {
    .hm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-panels { grid-template-columns: 1fr 1fr; }
    .hm-panel--actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .hm-hero { padding: 18px 16px; }
    .hm-hero__hint { text-align: left; max-width: none; }
    .hm-kpis, .hm-panels { grid-template-columns: 1fr; }
    .hm-panel--actions { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
    .hm-hero, .hm-kpi, .hm-panel { animation: none !important; }
    .hm-kpi:hover, .hm-action:hover { transform: none; }
}

/* ------------------------------------------------------------------ */
/* 9. TOP MENU IN GROUPS (owner chose "Option A", 28-Sep-2026)         */
/*    Home + drop-down groups. Point at or click a group to open it.   */
/*    On a phone it becomes a "Menu" button with the groups listed.    */
/* ------------------------------------------------------------------ */
/* Its own full-width row under the site name / branch / user links, starting at the left. */
#topmenu {
    background: var(--swl-strong); position: relative; z-index: 40;
    flex: 0 0 100%; order: 99; margin: 0 -40px; padding: 0 40px; box-sizing: content-box;
}
#tm-toggle { display: none; }
#tm-bar { list-style: none; margin: 0; padding: 0; display: flex; align-items: stretch; gap: 2px; }
#tm-bar > li { position: relative; margin: 0; padding: 0; list-style: none; }
.tm-top {
    display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px;
    color: var(--swl-head-ink) !important; font-size: 14px; font-weight: 600; background: transparent;
    border: 0; border-bottom: 3px solid transparent; cursor: pointer; text-decoration: none;
    font-family: inherit; box-sizing: border-box;
}
.tm-top:hover, .tm-group.open > .tm-top { background: var(--swl-strong); color: var(--swl-on) !important; }
.tm-top.current, .tm-group.has-current > .tm-top { color: var(--swl-on) !important; border-bottom-color: var(--accent); }
.tm-caret { font-size: 11px; opacity: .8; transition: transform .18s ease; }
.tm-group.open .tm-caret { transform: rotate(180deg); }
.tm-panel {
    display: none; position: absolute; top: calc(100% - 1px); left: 0; min-width: 248px;
    background: var(--swl-surface); border: 1px solid var(--swl-line-strong); border-top: 2px solid var(--swl-accent);
    border-radius: 0 0 12px 12px; box-shadow: 0 14px 32px rgba(10, 20, 18, .22); padding: 8px;
    z-index: 120;
}
.tm-group.open .tm-panel { display: block; animation: swl-drop .12s ease-out both; }
@media (hover: hover) and (min-width: 901px) {
    .tm-group:hover .tm-panel { display: block; animation: swl-drop .12s ease-out both; }
    .tm-group:hover > .tm-top { background: var(--swl-strong); color: var(--swl-on) !important; }
    .tm-group:hover .tm-caret { transform: rotate(180deg); }
}
.tm-panel a {
    display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px;
    color: var(--body-fg) !important; font-size: 14px; text-decoration: none; white-space: nowrap;
    transition: background .1s ease;
}
.tm-panel a:hover { background: var(--swl-selected); }
.tm-panel a.current { background: var(--swl-accent-soft); font-weight: 700; }
.tm-panel .step {
    display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
    border-radius: 50%; font-size: 11px; font-weight: 700; background: var(--swl-primary); color: var(--swl-on); flex-shrink: 0;
}
.tm-sep { height: 1px; background: var(--hairline-color); margin: 5px 6px; }

/* Phones / narrow windows: one "Menu" button; groups listed open underneath. */
@media (max-width: 900px) {
    #topmenu { padding-top: 8px; padding-bottom: 8px; }
    #tm-toggle { display: inline-block; background: var(--swl-surface); color: var(--swl-head-ink); border: 1px solid var(--swl-line);
                 border-radius: 7px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
    #tm-bar { display: none; flex-direction: column; gap: 0; padding-top: 8px; }
    #topmenu.mobile-open #tm-bar { display: flex; animation: swl-drop .2s ease-out both; }
    .tm-top { height: 40px; width: 100%; }
    .tm-panel { position: static; box-shadow: none; border: 0; border-radius: 8px; margin: 0 0 6px; }
    .tm-caret { display: none; }
    .tm-group .tm-panel { display: block; }
}

/* Tablets / phones: the admin stacks the header in a column (padding 30px, then
   15px) - keep the menu a full-width band under it. */
@media (max-width: 1024px) {
    #topmenu { flex: none; align-self: stretch; margin: 12px -30px 0; padding-left: 30px; padding-right: 30px; }
}
@media (max-width: 767px) {
    #topmenu { margin: 12px -15px 0; padding-left: 15px; padding-right: 15px; }
}

@media print { #topmenu { display: none !important; } }

/* ------------------------------------------------------------------ */
/* 10. Gentle animations (owner, 28-Sep-2026). Short (0.15-0.35 s) so  */
/*     they never slow work down; switched off for people who ask      */
/*     their computer for less motion.                                 */
/* ------------------------------------------------------------------ */
@keyframes swl-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes swl-slide-in { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes swl-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes swl-pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }

/* Keep page open snappy — no entrance animation on every navigation. */
#content { animation: none; }

/* Menu items: no staggered slide-in (felt slow on every page). */
#tm-bar > li { animation: none; }
.tm-top { transition: background .12s ease, color .12s ease, border-color .12s ease; }
.tm-caret { transition: transform .12s ease; }

/* Buttons lift a little on hover and press down on click. */
.button, a.button, input[type=submit], input[type=button], button.button {
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.button:hover, a.button:hover, input[type=submit]:hover, input[type=button]:hover {
    transform: translateY(-1px); box-shadow: 0 4px 10px rgba(60, 64, 151, .18);
}
.button:active, a.button:active, input[type=submit]:active, input[type=button]:active { transform: translateY(0); box-shadow: none; }

/* Table rows light up smoothly under the mouse. */
table.report tbody tr, #changelist table tbody tr { transition: background .15s ease; }
table.report tbody tr:hover { background: var(--swl-soft); }

/* Cards and boxes: soft lift on hover. */
.card, .module, #fill-box { transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16, 25, 31, .10); }

/* Messages ("Saved", "Removed") pop in. */
ul.messagelist li { animation: swl-pop .3s ease-out both; }

/* Branch tabs: smooth colour change. */
.branchtabs a { transition: background .18s ease, color .18s ease; }

/* The truck fill gauge already slides; make it smoother. */
#fill-bar { transition: width .35s cubic-bezier(.2, .8, .2, 1), background .3s ease !important; }

/* Inputs: a soft glow when you click into them. */
input[type=text], input[type=date], input[type=number], select, textarea {
    transition: border-color .15s ease, box-shadow .15s ease;
}
input[type=text]:focus, input[type=date]:focus, input[type=number]:focus, select:focus, textarea:focus {
    border-color: var(--swl-primary) !important; box-shadow: 0 0 0 3px rgba(60, 64, 151, .2); outline: none;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
    #content, ul.messagelist li { animation: none !important; }
}

/* ------------------------------------------------------------------ */
/* 11. Our own list screens (Products, Orders, Distributors, Users)    */
/*     - replace the admin panel; approved from pictures 28-Sep-2026.  */
/* ------------------------------------------------------------------ */
.sx-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.sx-head h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--body-loud-color); }
.sx-head .sx-sub { font-size: 14px; color: var(--body-quiet-color); }
.sx-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sx-btn { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 600;
          font-size: 14px; border: 1.5px solid var(--swl-primary); background: var(--swl-surface); color: var(--swl-link) !important; cursor: pointer;
          text-decoration: none !important; font-family: inherit; transition: background .15s ease, transform .12s ease; }
.sx-btn:hover { background: var(--swl-selected); transform: translateY(-1px); }
.sx-btn.main { background: var(--swl-primary); border-color: var(--swl-primary); color: var(--swl-on) !important; }
.sx-btn.main:hover { background: var(--swl-strong); }
.sx-btn.go { background: var(--swl-go); border-color: var(--swl-go); color: var(--swl-on) !important; }
.sx-btn.danger { border-color: var(--swl-danger); color: var(--swl-danger-ink) !important; }
.sx-btn.danger:hover { background: var(--swl-danger-soft); }
.sx-btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.sx-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sx-search { display: flex; align-items: center; gap: 8px; background: var(--swl-surface); border: 1px solid var(--border-color);
             border-radius: 8px; padding: 0 12px; height: 40px; width: 320px; max-width: 100%; box-sizing: border-box; }
.sx-search input { border: 0 !important; outline: none; box-shadow: none !important; font-size: 14px; flex-grow: 1; background: transparent; padding: 0; }
.sx-chip { padding: 7px 14px; border-radius: 999px; background: var(--swl-surface); border: 1px solid var(--border-color);
           color: var(--body-fg) !important; font-size: 13px; text-decoration: none !important; white-space: nowrap; }
.sx-chip:hover { background: var(--swl-selected); }
.sx-chip.on { background: var(--swl-strong); border-color: var(--swl-strong); color: var(--swl-on) !important; font-weight: 600; }
.sx-chip.bad { background: var(--swl-danger-soft); border-color: var(--swl-danger-line); color: var(--swl-danger-ink) !important; font-weight: 600; }
.sx-chip.bad.on { background: var(--swl-danger); border-color: var(--swl-danger); color: var(--swl-on) !important; }
.sx-sep { width: 1px; height: 24px; background: var(--border-color); }
.sx-card { background: var(--swl-surface); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; }
table.sx { width: 100%; border-collapse: collapse; font-size: 14px; }
table.sx thead th { background: var(--swl-soft); text-align: left; color: var(--swl-muted); font-size: 13px; padding: 10px; font-weight: 600; white-space: nowrap; }
table.sx thead th:first-child, table.sx tbody td:first-child { padding-left: 14px; }
table.sx tbody td { padding: 7px 10px; border-top: 1px solid var(--swl-line); vertical-align: middle; }
table.sx .num { text-align: right; }
table.sx .quiet { color: var(--body-quiet-color); }
table.sx tr.sx-missing { background: var(--swl-danger-soft); }
table.sx tr.sx-changed { background: var(--swl-accent-soft) !important; }
table.sx tr.sx-open { background: var(--swl-selected); }
table.sx tr.sx-detail > td { background: var(--swl-soft); border-left: 4px solid var(--swl-primary); padding: 12px 14px 16px; }
table.sx input[type=text], table.sx select, .sx-form input[type=text], .sx-form input[type=password], .sx-form select, .sx-form textarea {
    border: 1px solid var(--border-color); border-radius: 6px; padding: 5px 8px; font-size: 14px; background: var(--swl-surface); font-family: inherit; }
table.sx input.sx-size { width: 70px; text-align: right; }
table.sx .sx-need { border: 1.5px solid var(--swl-danger-line) !important; }
table.sx .sx-edited { border: 1.5px solid var(--swl-accent) !important; background: var(--swl-accent-soft); }
.sx-pill { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.sx-pill.ok { background: var(--swl-ok-soft); color: var(--swl-ok-ink); }
.sx-pill.bad { background: var(--swl-danger-soft); color: var(--swl-danger-ink); }
.sx-pill.wait { background: var(--swl-accent-soft); color: var(--swl-warn-ink); }
.sx-pill.plan { background: var(--swl-selected); color: var(--swl-link); }
.sx-pill.sent { background: var(--swl-ok-soft); color: var(--swl-ok-ink); }
.sx-pill.owner { background: var(--swl-warn); color: var(--swl-on); }
.sx-more { border: 0; background: transparent; color: var(--body-quiet-color); font-size: 18px; cursor: pointer; padding: 0 6px; }
.sx-savebar { position: sticky; bottom: 12px; z-index: 30; display: none; align-items: center; justify-content: space-between; gap: 12px;
              background: var(--swl-strong); color: var(--swl-on); border-radius: 10px; padding: 10px 16px; margin-top: 12px; box-shadow: 0 8px 20px rgba(15,76,92,.25); }
.sx-savebar.show { display: flex; animation: swl-fade-up .2s ease-out both; }
.sx-savebar .sx-btn { border-color: var(--swl-line-strong); background: transparent; color: var(--swl-on) !important; }
.sx-savebar .sx-btn.go { background: var(--swl-go); border-color: var(--swl-go); }
.sx-pager { display: flex; gap: 6px; align-items: center; padding: 10px 14px; font-size: 13px; color: var(--body-quiet-color); border-top: 1px solid var(--swl-line); flex-wrap: wrap; }
.sx-pager a, .sx-pager span.cur { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border-color); text-decoration: none; }
.sx-pager span.cur { background: var(--swl-strong); color: var(--swl-on); border-color: var(--swl-strong); }
.sx-note { font-size: 13px; color: var(--body-quiet-color); }
.sx-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; background: var(--swl-surface); border: 1px dashed var(--swl-primary);
           border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.sx-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--body-quiet-color); font-weight: 600; }
.sx-hidden { display: none !important; }
.sx-saved { color: var(--swl-ok-ink); font-weight: 700; margin-left: 6px; transition: opacity .6s ease; }

/* "View as" bar: the owner is looking at the system as a staff member. */
#viewas-bar {
    flex: 0 0 100%; order: -1; margin: -10px -40px 10px; padding: 8px 40px; box-sizing: content-box;
    background: var(--swl-accent); color: var(--swl-ink); display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; font-size: 14px;
}
#viewas-bar .viewas-stop { background: var(--swl-ink); color: var(--swl-on) !important; border-radius: 7px; padding: 6px 14px;
    font-weight: 700; text-decoration: none !important; white-space: nowrap; }
@media (max-width: 1024px) { #viewas-bar { margin: -15px -30px 10px; padding: 8px 30px; } }
@media (max-width: 767px) { #viewas-bar { margin: -15px -15px 10px; padding: 8px 15px; } }

/* ================================================================== */
/* 12. READABLE LOOK - Day (paper & ink) and Night (owner, 28-Sep-2026) */
/*     Every colour on our pages is a --swl-... name defined here, so   */
/*     the ☀/🌙 switch in the header changes the whole system.          */
/*     Font: Atkinson Hyperlegible (letters/numbers hard to confuse).   */
/* ================================================================== */
/* Brand from SWL logo — lighter tints of navy #3C4097 + red #E43237 */
:root, html[data-theme="light"] {
    --swl-page: #F7F8FC; --swl-surface: #FFFFFF; --swl-soft: #F1F3FA; --swl-selected: #E9ECF8;
    --swl-ink: #2A2D42; --swl-muted: #6B7088; --swl-faint: #969BB0; --swl-on: #FFFFFF; --swl-link: #4A50A8;
    --swl-line: #E4E7F1; --swl-line-strong: #D0D5E5;
    /* Light toolbar: soft lavender bar, navy type (not a heavy navy slab) */
    --swl-head: #EEF0F8; --swl-head-soft: #E4E7F4; --swl-head-deep: #E6E8F4; --swl-head-ink: #2E3278; --swl-head-muted: #6B7194;
    --swl-strong: #5B61B5; --swl-strong-hover: #4A50A8; --swl-primary: #5B61B5; --swl-go: #2F8A4A;
    --swl-danger: #D64545; --swl-danger-ink: #C62828; --swl-danger-soft: #FFF1F1; --swl-danger-line: #F7CACA;
    --swl-accent: #EC4B4F; --swl-accent-soft: #FFF1F1; --swl-accent-line: #F7CACA;
    --swl-ok: #2F8A4A; --swl-ok-ink: #1F6B3A; --swl-ok-soft: #EAF7EE; --swl-ok-line: #B7DFC4;
    --swl-warn: #C26A12; --swl-warn-ink: #9A5410;
    color-scheme: light;
}
html[data-theme="dark"] {
    --swl-page: #181B28; --swl-surface: #222636; --swl-soft: #2A2F42; --swl-selected: #343A55;
    --swl-ink: #EEF0F7; --swl-muted: #B0B5C9; --swl-faint: #8A90A8; --swl-on: #FFFFFF; --swl-link: #B4BAF0;
    --swl-line: #3A4058; --swl-line-strong: #505772;
    --swl-head: #1E2233; --swl-head-soft: #2A3050; --swl-head-deep: #161925; --swl-head-ink: #EEF0F7; --swl-head-muted: #A8AED0;
    --swl-strong: #6B71C4; --swl-strong-hover: #7E84D4; --swl-primary: #6B71C4; --swl-go: #3B9A5C;
    --swl-danger: #F07070; --swl-danger-ink: #FFA0A0; --swl-danger-soft: #3F262A; --swl-danger-line: #6E3C42;
    --swl-accent: #F25C60; --swl-accent-soft: #3F262A; --swl-accent-line: #6E3C42;
    --swl-ok: #3B9A5C; --swl-ok-ink: #8FDBAB; --swl-ok-soft: #24382C; --swl-ok-line: #3A6548;
    --swl-warn: #E09A3A; --swl-warn-ink: #F5C878;
    color-scheme: dark;
}
/* The admin's own colour settings follow ours in both modes. */
:root, html[data-theme="light"], html[data-theme="dark"] {
    --primary: var(--swl-strong); --secondary: var(--swl-strong); --accent: var(--swl-accent); --primary-fg: var(--swl-on);
    --body-fg: var(--swl-ink); --body-bg: var(--swl-page); --body-quiet-color: var(--swl-muted);
    --body-medium-color: var(--swl-muted); --body-loud-color: var(--swl-ink);
    --header-color: var(--swl-head-muted); --header-branding-color: var(--swl-accent); --header-bg: var(--swl-head);
    --header-link-color: var(--swl-head-ink);
    --breadcrumbs-fg: var(--swl-muted); --breadcrumbs-link-fg: var(--swl-link); --breadcrumbs-bg: var(--swl-soft);
    --link-fg: var(--swl-link); --link-hover-color: var(--swl-strong-hover); --link-selected-fg: var(--swl-link);
    --hairline-color: var(--swl-line); --border-color: var(--swl-line-strong);
    --error-fg: var(--swl-danger-ink); --message-success-bg: var(--swl-ok-soft); --message-warning-bg: var(--swl-accent-soft);
    --message-error-bg: var(--swl-danger-soft); --darkened-bg: var(--swl-soft); --selected-bg: var(--swl-selected);
    --selected-row: var(--swl-accent-soft);
    --button-fg: var(--swl-on); --button-bg: var(--swl-primary); --button-hover-bg: var(--swl-strong-hover);
    --default-button-bg: var(--swl-go); --default-button-hover-bg: var(--swl-strong-hover);
    --close-button-bg: var(--swl-muted); --close-button-hover-bg: var(--swl-ink);
    --delete-button-bg: var(--swl-danger); --delete-button-hover-bg: var(--swl-danger);
    --object-tools-fg: var(--swl-on); --object-tools-bg: var(--swl-strong); --object-tools-hover-bg: var(--swl-strong-hover);
}

/* Readable type: one font everywhere, a little larger, numbers in straight columns. */
body, input, select, textarea, button, .button, table {
    font-family: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}
body { font-size: 15px; background: var(--swl-page); color: var(--swl-ink); }
table, .num, td, th { font-variant-numeric: tabular-nums; }
#content h1 { color: var(--swl-ink); }
table.report td, table.report th, table.sx td, table.sx th, #changelist table td, #changelist table th { font-size: 15px; }
table.report thead th, table.sx thead th, #changelist table thead th {
    background: var(--swl-soft); color: var(--swl-muted); font-size: 13px; letter-spacing: .03em;
}
table.report tbody tr:nth-child(even), table.sx tbody tr:nth-child(even):not(.sx-detail):not(.sx-changed):not(.sx-missing):not(.sx-open) {
    background: var(--swl-soft);
}
input[type=text], input[type=date], input[type=number], input[type=password], select, textarea {
    background: var(--swl-surface); color: var(--swl-ink); border-color: var(--swl-line-strong);
}
.module, .sx-card, .card, .cards .card { background: var(--swl-surface); border-color: var(--swl-line); }

/* Header: deep ink-green bar, gold name; branch tabs as a soft pill group. */
#header { background: var(--swl-head); }
#site-name a, #branding h1 a { color: var(--swl-accent) !important; }
#user-tools, #user-tools a, #user-tools button { color: var(--swl-head-muted) !important; }
.branchtabs { background: var(--swl-head-soft); border-radius: 10px; padding: 4px 6px; }
.branchtabs a { color: var(--swl-head-ink) !important; border-radius: 8px; }
.branchtabs a.on { background: var(--swl-head-ink); color: var(--swl-head) !important; font-weight: 700; }
.branchtabs-label { color: var(--swl-head-muted); }

/* Menu bar: calm light bar (dark bar at night), gold underline on the current group. */
#topmenu { background: var(--swl-surface); border-bottom: 1px solid var(--swl-line); }
.tm-top { color: var(--swl-muted) !important; font-size: 15px; }
.tm-top:hover, .tm-group.open > .tm-top { background: var(--swl-soft); color: var(--swl-ink) !important; }
.tm-top.current, .tm-group.has-current > .tm-top { color: var(--swl-ink) !important; border-bottom-color: var(--swl-accent); font-weight: 700; }
@media (hover: hover) and (min-width: 901px) {
    .tm-group:hover > .tm-top { background: var(--swl-soft); color: var(--swl-ink) !important; }
}
.tm-panel { background: var(--swl-surface); border-color: var(--swl-line); }
.tm-panel a { color: var(--swl-ink) !important; }
.tm-panel a:hover { background: var(--swl-selected); }
.tm-panel a.current { background: var(--swl-accent-soft); }
.tm-panel .step { background: var(--swl-primary); color: var(--swl-on); }
.tm-sep { background: var(--swl-line); }
#tm-toggle { background: var(--swl-surface); color: var(--swl-head-ink); border: 1px solid var(--swl-line); }

/* Status: the soft pills get full-strength text so they read clearly. */
.sx-pill.ok, .sx-pill.sent { background: var(--swl-ok-soft); color: var(--swl-ok-ink); }
.sx-pill.bad { background: var(--swl-danger-soft); color: var(--swl-danger-ink); }
.sx-pill.wait { background: var(--swl-accent-soft); color: var(--swl-warn-ink); }
.sx-pill.plan { background: var(--swl-selected); color: var(--swl-link); }
.sx-chip { background: var(--swl-surface); color: var(--swl-ink) !important; border-color: var(--swl-line-strong); }
.sx-chip.on { background: var(--swl-ink); border-color: var(--swl-ink); color: var(--swl-page) !important; }

/* The ☀ Day / 🌙 Night switch (every user; remembered on their device). */
.theme-toggle { display: none !important; }            /* the admin's own 3-way button */
#theme-switch {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
    border: 1.5px solid var(--swl-head-muted); background: transparent; color: var(--swl-head-ink); cursor: pointer;
    font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s ease;
}
#theme-switch:hover { background: var(--swl-head-soft); }

/* Printing is always Day (black on white), whatever the switch says. */
@media print {
    html[data-theme="dark"] {
        --swl-page: #FFFFFF; --swl-surface: #FFFFFF; --swl-soft: #F5F5F5; --swl-ink: #000000; --swl-muted: #333333;
        --swl-line: #CCCCCC; --swl-line-strong: #999999;
    }
    #theme-switch { display: none !important; }
}

/* Buttons inside our filter bars keep white text (the admin's ".actions .button" rule made it dark). */
.filter-bar .actions .button, .filter-bar .actions button.button, .actions button.button { color: var(--button-fg); }
/* Group heading rows in report tables (e.g. a route on Planning) stay a strong band with light text. */
table.report thead th[colspan] { background: var(--swl-strong); color: var(--swl-on); }
table.report thead th[colspan] a { color: var(--swl-on) !important; text-decoration: underline; }

/* ================================================================== */
/* 13. Production top bar — sticky, fast, polished (RBAC unchanged)    */
/*     SW · menu · search · branches · Day/Night · password · logout   */
/* ================================================================== */
:root { --tb-h: 54px; --tb-slim: 44px; }
#topbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; gap: 12px;
    height: var(--tb-h); padding: 0 18px 0 16px; box-sizing: border-box;
    background: var(--swl-head);
    color: var(--swl-head-ink);
    border-bottom: 1px solid var(--swl-line);
    box-shadow: 0 1px 0 rgba(46, 50, 120, .04), 0 6px 18px rgba(46, 50, 120, .06);
    transition: height .16s ease, box-shadow .16s ease;
}
#topbar.slim {
    height: var(--tb-slim);
    box-shadow: 0 1px 0 rgba(46, 50, 120, .06), 0 8px 20px rgba(46, 50, 120, .08);
}
html[data-theme="dark"] #topbar {
    border-bottom-color: var(--swl-line-strong);
    box-shadow: 0 1px 0 rgba(0, 0, 0, .2), 0 8px 22px rgba(0, 0, 0, .22);
}
.tb-logo {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: auto; height: 40px; padding: 0; border-radius: 0;
    background: transparent; box-shadow: none;
    text-decoration: none !important;
    transition: transform .12s ease, opacity .12s ease, height .16s ease;
}
.tb-logo img {
    display: block; height: 100%; width: auto;
    object-fit: contain;
}
.tb-logo:hover { transform: translateY(-1px); opacity: .95; }
.tb-logo:active { transform: scale(.98); }
#topbar.slim .tb-logo { height: 32px; }

/* Menu inside the bar */
#topbar #topmenu {
    flex: 1 1 auto; order: 0; margin: 0; padding: 0; background: transparent; border: 0;
    box-sizing: border-box; height: 100%; display: flex; align-items: stretch; min-width: 0;
}
#topbar #tm-bar { height: 100%; gap: 0; }
#topbar .tm-top {
    height: 100%; padding: 0 11px; font-size: 14.5px; font-weight: 600;
    color: var(--swl-head-muted) !important;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    transition: color .1s ease, background .1s ease, border-color .1s ease;
}
#topbar.slim .tm-top { font-size: 13.5px; padding: 0 9px; }
#topbar .tm-top:hover, #topbar .tm-group.open > .tm-top {
    background: var(--swl-head-soft);
    color: var(--swl-head-ink) !important;
}
#topbar .tm-top.current, #topbar .tm-group.has-current > .tm-top {
    color: var(--swl-strong) !important;
    border-bottom-color: var(--swl-accent);
    font-weight: 700;
}
@media (hover: hover) and (min-width: 901px) {
    #topbar .tm-group:hover > .tm-top {
        background: var(--swl-head-soft);
        color: var(--swl-head-ink) !important;
    }
}
#topbar .tm-panel {
    top: calc(100% - 1px);
    border-radius: 0 0 14px 14px;
    padding: 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}
#topbar .tm-panel a { font-size: 14px; }
#topbar .tm-caret { opacity: .7; font-size: 10px; }

/* Right side: branches + actions */
.tb-right { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
#topbar .branchtabs {
    background: var(--swl-surface);
    border: 1px solid var(--swl-line);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
    display: flex;
}
#topbar .branchtabs a {
    padding: 5px 12px; font-size: 12.5px; font-weight: 600; border-radius: 999px;
    color: var(--swl-head-muted) !important;
    text-decoration: none;
    transition: background .1s ease, color .1s ease;
}
#topbar .branchtabs a:hover { background: var(--swl-selected); color: var(--swl-head-ink) !important; }
#topbar .branchtabs a.on {
    background: var(--swl-accent);
    color: #FFFFFF !important;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(236, 75, 79, .28);
}
#topbar.slim .branchtabs a { padding: 3px 10px; }
#topbar .branchtabs-fixed {
    padding: 5px 12px; font-size: 12.5px; font-weight: 700;
    color: var(--swl-head-ink);
    background: var(--swl-surface);
    border: 1px solid var(--swl-line);
    border-radius: 999px;
}
#logout-form { margin: 0; display: inline; }
.tb-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 999px;
    border: 1px solid var(--swl-line-strong); background: var(--swl-surface);
    color: var(--swl-head-ink) !important;
    font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none !important;
    font-family: inherit;
    transition: background .1s ease, border-color .1s ease, transform .1s ease;
}
.tb-btn:hover { background: var(--swl-selected); border-color: var(--swl-primary); }
.tb-btn:active { transform: scale(.97); }
.tb-btn.tb-out:hover { background: var(--swl-danger); border-color: var(--swl-danger); color: #fff !important; }
.tb-btn svg { flex: 0 0 auto; }
.tb-label { display: inline-block; max-width: 160px; overflow: hidden; transition: max-width .16s ease, opacity .12s ease; }
#topbar.slim .tb-btn { height: 28px; padding: 0 8px; }
#topbar.slim .tb-label { max-width: 0; opacity: 0; }
html[data-theme="dark"] #theme-switch .ic-moon, html:not([data-theme="dark"]) #theme-switch .ic-sun { display: none; }
#theme-switch { border: 1px solid var(--swl-line-strong); color: var(--swl-head-ink); }

/* The "viewing as" strip sits above the bar. */
#viewas-bar { margin: 0 !important; padding: 7px 24px !important; box-sizing: border-box; }

/* Narrow screens: icons only; phones: the ☰ Menu button opens the menu under the bar. */
@media (max-width: 1350px) { #topbar .tb-label { max-width: 0; opacity: 0; } #topbar .tb-btn { padding: 0 8px; } }
@media (max-width: 1100px) { #topbar .tm-top { padding: 0 8px; font-size: 14px; } }
@media (max-width: 900px) {
    #topbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 14px; }
    #topbar.slim { height: auto; }
    #topbar #topmenu { order: 5; flex: 1 1 100%; height: auto; display: block; }
    #topbar #tm-toggle { display: inline-block; margin: 0; }
    #topbar .tm-top { height: 40px; color: var(--swl-head-ink) !important; }
    #topbar .tm-panel { background: var(--swl-surface); }
    #topbar #topmenu:not(.mobile-open) { flex: 0 0 auto; order: 1; }
    .tb-right { margin-left: auto; }
}

/* ---- Tables: rows answer the mouse; headings stay visible while scrolling ---- */
table.report tbody tr, table.sx tbody tr:not(.sx-detail), #changelist table tbody tr {
    transition: background-color .15s ease, box-shadow .15s ease;
}
table.report tbody tr:hover, table.sx tbody tr:not(.sx-detail):hover, #changelist table tbody tr:hover {
    background-color: var(--swl-selected) !important;
    box-shadow: inset 3px 0 0 var(--swl-accent);
}
.sx-card, .module { overflow: clip; }          /* rounded corners without breaking sticky headings */
table.report thead th, table.sx > thead th, #changelist table thead th {
    position: sticky; top: var(--tb-slim); z-index: 5;
}
table.report thead tr:first-child th[colspan] { z-index: 6; }
#plan-sticky { top: var(--tb-slim) !important; }   /* Planning's truck bar sits under the top bar */
@media (max-width: 900px) {
    table.report thead th, table.sx > thead th, #changelist table thead th { position: static; }
}
/* Fixes for the bar: the admin frame is screen-high (breaks sticky) and squeezes flex children. */
#container { height: auto !important; min-height: 100vh; }
#topbar { flex-shrink: 0; }
#topbar a, #topbar a:link, #topbar a:visited, #topbar button { text-decoration: none !important; text-transform: none !important; }
#logout-form button.tb-btn { font-size: 13px; letter-spacing: 0; }

/* Fix (owner, 29-Sep: first truck on Documents had no number/time): a heading row that
   stays on screen is pushed down over the first row when the table sits inside a box
   that hides or scrolls its overflow. "clip" keeps the rounded corners without that. */
table.report, .truck { overflow: clip; }
/* Tables inside a side-scrolling box (wide tables) or the admin lists: the heading
   sticks to the top of that box instead, so it never covers the first row. */
div[style*="overflow-x:auto"] table thead th, div[style*="overflow-x: auto"] table thead th,
#changelist .results table thead th { top: 0 !important; }

/* Row under the mouse: a clearly visible tint (owner: the first one was too light). */
:root, html[data-theme="light"] { --swl-hover: #E4E7F7; }
html[data-theme="dark"] { --swl-hover: #2A3050; }
table.report tbody tr:hover, table.sx tbody tr:not(.sx-detail):hover, #changelist table tbody tr:hover {
    background-color: var(--swl-hover) !important;
}
/* Deeper tint + red brand marker on hover. */
:root, html[data-theme="light"] { --swl-hover: #D8DCF3; }
html[data-theme="dark"] { --swl-hover: #343A5C; }
table.report tbody tr:hover, table.sx tbody tr:not(.sx-detail):hover, #changelist table tbody tr:hover {
    box-shadow: inset 5px 0 0 var(--swl-accent);
}


/* ---- Phones (owner, 2-Oct-2026, screen recording): the opened menu listed EVERY page
   of every group and covered the whole screen. Now: groups start closed (tap one to
   open it; the group of the page you are on opens by itself), and the menu scrolls
   inside itself so the page stays reachable. ---- */
@media (max-width: 900px) {
    #topbar .tm-group .tm-panel { display: none; }
    #topbar .tm-group.open .tm-panel { display: block; }
    #topbar .tm-caret { display: inline; margin-left: 6px; transition: transform .15s ease; }
    #topbar .tm-group.open .tm-caret { transform: rotate(180deg); }
    #topbar #topmenu.mobile-open #tm-bar { max-height: calc(100vh - 150px); overflow-y: auto; -webkit-overflow-scrolling: touch;
                                           padding-bottom: 10px; overscroll-behavior: contain; }
    #topbar .tm-top { justify-content: space-between; text-align: left; }
}

/* ---- Phones (owner, 4-Oct-2026): the page must never swipe sideways ----
   The top bar's right side was ~3 px too wide on a 390 px phone, and some wide tables
   (Planning, Pending, Billing, Diesel tank) pushed the whole page. Now: tighter top bar,
   wide tables scroll inside their own box, and the page itself is clipped as a safety net
   (clip, not hidden, so sticky headers keep working). */
@media (max-width: 600px) {
    html, body { overflow-x: clip; }
    #topbar { padding-left: 10px; padding-right: 10px; }
    .tb-right { gap: 4px; flex: 0 1 auto; min-width: 0; }
    #topbar .tb-btn { padding: 0 6px; }
    table.report { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dt-two { grid-template-columns: minmax(0, 1fr) !important; }
    .dt-box { overflow-x: auto !important; }
    /* table boxes were set to cut off (clip) - on a phone they scroll sideways instead */
    .sx-card, .module, .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ---- Search box on the top bar (owner, 6-Nov-2026) ----
   Wide screens: a box between the menu and the branch tabs; results drop down under it.
   Narrower screens and phones: a search button that opens the box under the top bar. */
#gs { position: relative; display: flex; align-items: center; }
#gs-open { display: none; color: var(--swl-head-ink); border: 1px solid var(--swl-line-strong); }
#gs-form { display: flex; align-items: center; gap: 6px; margin: 0; height: 32px; padding: 0 11px; box-sizing: border-box;
           border-radius: 999px; background: var(--swl-surface); border: 1px solid var(--swl-line); color: var(--swl-head-ink);
           transition: background .1s ease, border-color .1s ease, box-shadow .1s ease; }
#gs-form:focus-within {
    background: var(--swl-surface); border-color: var(--swl-primary); color: var(--swl-ink);
    box-shadow: 0 0 0 3px rgba(91, 97, 181, .18);
}
#gs-q { border: 0 !important; outline: 0; background: transparent !important; color: inherit; font: inherit; font-size: 13.5px;
        width: 170px; padding: 0 !important; box-shadow: none !important; }
#gs-q::placeholder { color: var(--swl-head-muted); }
#gs-form:focus-within #gs-q::placeholder { color: var(--swl-faint); }
#topbar.slim #gs-form { height: 28px; }
#gs-drop { position: absolute; top: calc(100% + 8px); left: 0; width: min(560px, calc(100vw - 16px)); max-height: 72vh; overflow-y: auto;
           background: var(--swl-surface); color: var(--swl-ink); border: 1px solid var(--swl-line-strong); border-radius: 14px;
           box-shadow: 0 18px 44px rgba(0, 0, 0, .28); padding: 6px 0; z-index: 200; text-align: left;
           animation: swl-drop .12s ease-out both; }
.gs-group { padding: 9px 16px 3px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--swl-muted); }
.gs-item { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 1px; padding: 7px 16px;
           color: var(--swl-ink) !important; text-decoration: none !important; font-size: 14.5px; }
.gs-item b { font-weight: 700; }
.gs-sub { flex: 1 1 100%; color: var(--swl-muted); font-size: 13px; overflow-wrap: anywhere; }
.gs-tag { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--swl-line); color: var(--swl-ink);
          border-radius: 5px; padding: 1px 7px; }
.gs-item:hover, .gs-item.on { background: var(--swl-selected); }
.gs-all { display: block; margin-top: 4px; padding: 10px 16px 6px; border-top: 1px solid var(--swl-line); font-weight: 700; font-size: 14px;
          color: var(--swl-link) !important; }
.gs-all.on { background: var(--swl-selected); }
.gs-wait { padding: 10px 16px; color: var(--swl-muted); font-size: 14px; }
/* .gs-icon is set by the page when the box would not fit next to the menu (and on phones) */
#gs.gs-icon #gs-open { display: inline-flex; }
#gs.gs-icon #gs-panel { display: none; }
#gs.gs-icon.open #gs-panel { display: block; position: fixed; left: 8px; right: 8px; top: var(--gs-top, 60px); z-index: 200;
                     background: var(--swl-surface); border: 1px solid var(--swl-line-strong); border-radius: 12px;
                     box-shadow: 0 16px 40px rgba(0, 0, 0, .25); padding: 8px; max-width: 640px; margin-left: auto; }
#gs.gs-icon.open #gs-form { background: var(--swl-surface); border-color: var(--swl-primary); color: var(--swl-ink); height: 44px; }
#gs.gs-icon.open #gs-q { width: 100%; font-size: 17px; }
#gs.gs-icon.open #gs-q::placeholder { color: var(--swl-faint); }
#gs.gs-icon #gs-drop { position: static; width: auto; max-height: calc(100vh - var(--gs-top, 60px) - 90px); border: 0; box-shadow: none; padding: 4px 0 0; }
/* phones: the search button sits next to the Menu button (the branch tabs keep their room) */
@media (max-width: 900px) { #topbar #gs { order: 1; } }
@media print { #gs { display: none !important; } }
#topbar.tb-compact .tb-label { max-width: 0; opacity: 0; transition: none; }
#topbar.tb-compact .tb-btn { padding: 0 8px; }
#topbar.tb-measure .tb-label, #topbar.tb-measure .tb-btn { transition: none !important; }
#gs.gs-small:not(.open) #gs-q { width: 110px; }

/* ------------------------------------------------------------------ */
/* Login — brand-first gate (light CSS only, no images)                */
/* ------------------------------------------------------------------ */

body.swl-login-page #header,
body.swl-login-page .breadcrumbs,
body.swl-login-page #nav-sidebar,
body.swl-login-page .toggle-nav-sidebar,
body.swl-login-page #toggle-nav-sidebar,
body.swl-login-page .main > #nav-sidebar,
body.swl-login-page #content-related { display: none !important; }

body.swl-login-page #container,
body.swl-login-page .main,
body.swl-login-page #main,
body.swl-login-page #content,
body.swl-login-page #content-main {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    float: none !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.swl-login-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--swl-page) !important;
    overflow-x: hidden;
}
html[data-theme="light"] body.swl-login-page {
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(236, 75, 79, .14), transparent 55%),
        radial-gradient(ellipse 50% 40% at 100% 20%, rgba(91, 97, 181, .12), transparent 50%),
        linear-gradient(180deg, #F4F5FC 0%, var(--swl-page) 50%, #FAFBFE 100%) !important;
}
html[data-theme="dark"] body.swl-login-page {
    background:
        radial-gradient(ellipse 70% 55% at 50% -10%, rgba(242, 92, 96, .16), transparent 55%),
        radial-gradient(ellipse 50% 40% at 18% 40%, rgba(107, 113, 196, .18), transparent 55%),
        var(--swl-page) !important;
}

body.swl-login-page #container { min-height: 100vh; min-height: 100dvh; }

.swl-login__theme {
    position: fixed !important;
    top: 16px;
    right: 16px;
    z-index: 50;
    width: 42px;
    height: 42px;
    border-radius: 999px !important;
    border: 1px solid var(--swl-line-strong) !important;
    background: var(--swl-surface) !important;
    color: var(--swl-ink) !important;
    box-shadow: 0 4px 14px rgba(91, 97, 181, .12);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.swl-login__theme:hover { background: var(--swl-selected) !important; }
/* Icon swap — beat the global #theme-switch rules */
body.swl-login-page #theme-switch .ic-moon,
body.swl-login-page #theme-switch .ic-sun { display: none; }
html[data-theme="light"] body.swl-login-page #theme-switch .ic-moon { display: block; }
html[data-theme="dark"] body.swl-login-page #theme-switch .ic-sun { display: block; }
html:not([data-theme="dark"]) body.swl-login-page #theme-switch .ic-moon { display: block; }
html:not([data-theme="dark"]) body.swl-login-page #theme-switch .ic-sun { display: none; }

.swl-login {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 48px 20px 40px;
    isolation: isolate;
}

.swl-login__glow {
    position: absolute;
    inset: -20% -10% auto;
    height: 70%;
    background:
        radial-gradient(ellipse 55% 50% at 50% 0%, rgba(236, 75, 79, .16), transparent 70%),
        radial-gradient(ellipse 40% 45% at 18% 35%, rgba(91, 97, 181, .18), transparent 65%),
        radial-gradient(ellipse 35% 40% at 82% 30%, rgba(107, 113, 196, .12), transparent 60%);
    animation: swl-login-drift 14s ease-in-out infinite alternate;
    z-index: 0;
    pointer-events: none;
}

.swl-login__routes {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .4;
    background-image:
        linear-gradient(115deg, transparent 0 38%, rgba(91, 97, 181, .06) 38% 38.4%, transparent 38.4% 100%),
        linear-gradient(155deg, transparent 0 62%, rgba(236, 75, 79, .08) 62% 62.35%, transparent 62.35% 100%),
        linear-gradient(rgba(91, 97, 181, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(91, 97, 181, .04) 1px, transparent 1px);
    background-size: auto, auto, 48px 48px, 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 75%);
}

@keyframes swl-login-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(0, 18px, 0) scale(1.04); }
}

.swl-login__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 400px);
    padding: 36px 32px 32px;
    border-radius: 20px;
    border: 1px solid rgba(245, 242, 234, .12);
    background: color-mix(in srgb, var(--swl-surface) 92%, transparent);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .06) inset,
        0 24px 48px rgba(0, 0, 0, .28);
    backdrop-filter: blur(12px);
    animation: swl-login-rise .7s cubic-bezier(.22, 1, .36, 1) both;
}

html[data-theme="light"] .swl-login__panel {
    background: rgba(255, 255, 255, .96);
    border-color: rgba(60, 64, 151, .14);
    box-shadow: 0 18px 40px rgba(35, 38, 95, .16);
}

@keyframes swl-login-rise {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.swl-login__brand {
    text-align: center;
    margin-bottom: 26px;
    animation: swl-login-rise .85s cubic-bezier(.22, 1, .36, 1) .08s both;
}

.swl-login__mark {
    width: 88px;
    height: auto;
    margin: 0 auto 16px;
    border-radius: 0;
    display: grid;
    place-items: center;
    background: transparent;
    box-shadow: none;
}
.swl-login__mark img {
    display: block;
    width: 88px;
    height: auto;
    filter: drop-shadow(0 12px 24px rgba(60, 64, 151, .28));
}

.swl-login__name {
    margin: 0 0 10px;
    font-size: clamp(1.55rem, 4.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.15;
    color: var(--swl-ink);
}

.swl-login__title {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--swl-ink);
}

.swl-login__tag {
    margin: 0;
    font-size: 13.5px;
    color: var(--swl-muted);
    line-height: 1.4;
}

.swl-login__error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--swl-danger-soft);
    border: 1px solid var(--swl-danger-line);
    color: var(--swl-danger-ink);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
}

.swl-login__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    animation: swl-login-rise .85s cubic-bezier(.22, 1, .36, 1) .16s both;
}

.swl-login__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--swl-muted);
}

.swl-login__field input {
    width: 100%;
    box-sizing: border-box;
    height: 48px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1.5px solid var(--swl-line-strong);
    background: var(--swl-surface);
    color: var(--swl-ink);
    font-size: 16px;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.swl-login__field input:focus {
    outline: none;
    border-color: var(--swl-primary);
    box-shadow: 0 0 0 3px rgba(60, 64, 151, .2);
}

.swl-login__passwrap {
    position: relative;
    display: block;
}
.swl-login__passwrap input { padding-right: 48px; }
.swl-login__eye {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--swl-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.swl-login__eye:hover { color: var(--swl-ink); background: var(--swl-soft); }
.swl-login__eye .eye-hide { display: none; }
.swl-login__eye.is-on .eye-show { display: none; }
.swl-login__eye.is-on .eye-hide { display: block; }

.swl-login__submit {
    margin-top: 6px;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, #6B71C4, var(--swl-strong));
    color: #fff !important;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: .01em;
    box-shadow: 0 10px 22px rgba(91, 97, 181, .28);
    transition: transform .15s ease, filter .15s ease;
}

.swl-login__submit:hover { filter: brightness(1.06); transform: translateY(-1px); }
.swl-login__submit:active { transform: translateY(0); filter: brightness(.98); }

@media (max-width: 480px) {
    .swl-login { padding: 36px 16px 28px; }
    .swl-login__panel { padding: 28px 20px 24px; border-radius: 16px; }
    .swl-login__mark, .swl-login__mark img { width: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    .swl-login__glow,
    .swl-login__panel,
    .swl-login__brand,
    .swl-login__form { animation: none !important; }
}

/* ------------------------------------------------------------------ */
/* 12. HR attendance                                                   */
/* ------------------------------------------------------------------ */

.ha { margin: 0 0 28px; }
.ha-hero { margin-bottom: 14px; }
.ha-month {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
    border: 1px solid var(--swl-line);
}
.ha-month strong {
    min-width: 7.5rem;
    text-align: center;
    font-size: 14px;
    color: #2E3278;
}
html[data-theme="dark"] .ha-month {
    background: rgba(0, 0, 0, .22);
    border-color: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .ha-month strong { color: #fff; }

.ha-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 14px;
    padding: 4px;
    border-radius: 12px;
    background: var(--swl-soft);
    border: 1px solid var(--swl-line);
}
.ha-tabs__link {
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--swl-muted) !important;
    text-decoration: none !important;
    transition: background .15s ease, color .15s ease;
}
.ha-tabs__link:hover { background: var(--swl-surface); color: var(--swl-ink) !important; }
.ha-tabs__link.is-on {
    background: var(--swl-strong);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(91, 97, 181, .22);
}

.ha-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
.ha-who {
    display: inline-flex;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
}
.ha-who__btn {
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 650;
    color: var(--swl-muted) !important;
    text-decoration: none !important;
}
.ha-who__btn.is-on {
    background: var(--swl-ink);
    color: var(--swl-page) !important;
}
.ha-bulk {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}
.ha-bulk__label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
}
.ha-bulk__label input {
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--swl-line);
    padding: 0 8px;
    background: var(--swl-surface);
    color: var(--swl-ink);
}

.ha-holidays {
    margin: 0 0 12px;
    border: 1px solid var(--swl-line);
    border-radius: 12px;
    background: var(--swl-surface);
    overflow: hidden;
}
.ha-holidays > summary {
    cursor: pointer;
    list-style: none;
    padding: 11px 14px;
    font-weight: 700;
    font-size: 13.5px;
    color: var(--swl-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ha-holidays > summary::-webkit-details-marker { display: none; }
.ha-holidays__count {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--swl-accent-soft);
    color: var(--swl-danger-ink);
    font-size: 12px;
}
.ha-holidays__body {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 0 14px 14px;
    border-top: 1px solid var(--swl-line);
    padding-top: 12px;
}
.ha-holidays__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--swl-soft);
    border: 1px solid var(--swl-line);
    font-size: 13px;
}
.ha-holidays__date { font-weight: 800; color: var(--swl-ink); }
.ha-holidays__name { color: var(--swl-muted); }
.ha-holidays__del {
    border: 0;
    background: transparent;
    color: var(--swl-danger-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.ha-holidays__none { margin: 0; font-size: 13px; color: var(--swl-muted); }
.ha-holidays__add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-end;
    margin: 0;
}
.ha-holidays__add label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--swl-muted);
}
.ha-holidays__add input {
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--swl-line);
    padding: 0 8px;
    background: var(--swl-page);
    color: var(--swl-ink);
    min-width: 140px;
}

.ha-closed {
    margin: 0 0 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid #E2B56A;
    background: linear-gradient(90deg, #FFF6E5, #FFFBF2);
    color: #7A4E0A;
    font-weight: 700;
    font-size: 13.5px;
}
html[data-theme="dark"] .ha-closed {
    background: rgba(199, 127, 18, .18);
    border-color: rgba(199, 127, 18, .45);
    color: #F5D9A6;
}

.ha-wrap {
    overflow: auto;
    max-height: min(75vh, 820px);
    border: 1px solid var(--swl-line);
    border-radius: 14px;
    background: var(--swl-surface);
    box-shadow: 0 8px 24px rgba(46, 50, 120, .06);
}
table.ha-grid {
    border-collapse: separate;
    border-spacing: 0;
    width: max-content;
    min-width: 100%;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
table.ha-grid th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--swl-muted);
    text-align: center;
    white-space: nowrap;
    background: var(--swl-soft);
    border-bottom: 1px solid var(--swl-line);
}
table.ha-grid th.is-off { color: var(--swl-danger-ink); }
table.ha-grid th .ha-d { display: block; font-size: 13px; font-weight: 800; color: var(--swl-ink); }
table.ha-grid th.is-off .ha-d { color: var(--swl-danger-ink); }
table.ha-grid th .ha-w { display: block; font-weight: 500; opacity: .85; }
table.ha-grid th .ha-hol {
    display: inline-block;
    margin-top: 2px;
    padding: 0 4px;
    border-radius: 4px;
    background: #FFF0D6;
    color: #9A5B00;
    font-size: 9px;
    font-weight: 800;
}
table.ha-grid td {
    border-bottom: 1px solid var(--swl-line);
    padding: 4px 2px;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}
table.ha-grid tr:hover td { background: color-mix(in srgb, var(--swl-soft) 70%, transparent); }
table.ha-grid tr:hover td.nm { background: var(--swl-surface); }
table.ha-grid td.nm,
table.ha-grid th.nm {
    position: sticky;
    left: 0;
    z-index: 3;
    text-align: left;
    padding-left: 12px;
    padding-right: 12px;
    min-width: 200px;
    font-weight: 700;
    background: var(--swl-surface);
    box-shadow: 4px 0 10px rgba(15, 20, 40, .04);
}
table.ha-grid th.nm {
    z-index: 4;
    background: var(--swl-soft);
    color: var(--swl-ink);
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
table.ha-grid td.nm span {
    display: block;
    font-weight: 500;
    font-size: 11.5px;
    color: var(--swl-muted);
}
table.ha-grid th.sum { min-width: 52px; }
table.ha-grid td.tot {
    font-weight: 800;
    background: var(--swl-soft);
    color: var(--swl-ink);
}
table.ha-grid td.tot.is-open { color: var(--swl-danger-ink); }
table.ha-grid td.cell { position: relative; min-width: 34px; }
table.ha-grid td.has-trip { background: color-mix(in srgb, var(--swl-ok-soft) 45%, transparent); }

.hc {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12.5px;
    cursor: pointer;
    border: 0;
    padding: 0;
    background: #ECEAF2;
    color: #6A6780;
    transition: transform .12s ease, box-shadow .12s ease;
}
button.hc:hover:not([disabled]) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(46, 50, 120, .12);
}
.hc.P { background: #D8F0E0; color: #1B6B3A; }
.hc.O { background: #ECEAF2; color: #5C5870; }
.hc.L { background: #DCE6FB; color: #2A5FC4; }
.hc.A { background: #F9DED9; color: #B42318; }
.hc.none {
    background: #F9DED9;
    outline: 2px dashed #C53B2E;
    outline-offset: -2px;
    color: transparent;
}
.hc.fut {
    background: transparent;
    outline: 1px dashed var(--swl-line);
    color: transparent;
    cursor: pointer;
}
.hc.out { background: transparent; color: var(--swl-muted); cursor: default; }
.hc.flag { box-shadow: 0 0 0 2px #C53B2E; }
.hc[disabled] { cursor: default; opacity: .88; }
.hc.auto { opacity: .55; }
.hc.handoff { box-shadow: 0 0 0 2px #C77F12; }

.ht {
    display: block;
    font-size: 9px;
    font-style: normal;
    line-height: 1.15;
    color: var(--swl-muted);
    cursor: pointer;
    max-width: 40px;
    margin: 1px auto 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ht.hand { color: #2A5FC4; font-weight: 800; }
.htrip {
    display: block;
    width: 6px;
    height: 6px;
    margin: 2px auto 0;
    border-radius: 50%;
    background: var(--swl-go);
    font-style: normal;
}

.ha-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    color: var(--swl-muted);
}
.ha-legend li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.ha-legend .hc { width: 22px; height: 22px; font-size: 11px; cursor: default; }
.ha-legend .hc:hover { transform: none; box-shadow: none; }
.ha-legend__trip { margin: 0; }
.ha-legend .ht { margin: 0; max-width: none; cursor: default; }

.ha-truck-pop {
    position: fixed;
    display: none;
    z-index: 9999;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
    color: var(--swl-ink);
    padding: 6px 8px;
    box-shadow: 0 10px 28px rgba(15, 20, 40, .18);
}
.ha-empty { padding: 18px 20px; }
.ha-empty p { margin: 0; color: var(--swl-muted); }
.ha-empty-row { padding: 18px 12px !important; color: var(--swl-muted); font-weight: 500 !important; }

html[data-theme="dark"] .ha-wrap { box-shadow: none; }
html[data-theme="dark"] .hc { background: #3A3F58; color: #C8CBDA; }
html[data-theme="dark"] .hc.P { background: #1F4A32; color: #8FE0AE; }
html[data-theme="dark"] .hc.O { background: #3A3F58; color: #C8CBDA; }
html[data-theme="dark"] .hc.L { background: #2A3F6A; color: #9DB8FF; }
html[data-theme="dark"] .hc.A { background: #5A2A28; color: #FFB0A8; }
html[data-theme="dark"] .hc.none { background: #5A2A28; outline-color: #FF8A80; }
html[data-theme="dark"] table.ha-grid th .ha-hol { background: #5A4018; color: #F5D9A6; }

@media (max-width: 720px) {
    .ha-toolbar { align-items: stretch; }
    .ha-bulk { width: 100%; }
}

/* ------------------------------------------------------------------ */
/* 13. HR pay / staff / advances                                       */
/* ------------------------------------------------------------------ */

.hp, .hs, .hv { margin: 0 0 28px; }
.hp-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.hp-inline { margin: 0; display: inline-flex; }
.hp-hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--swl-muted);
    line-height: 1.4;
}
.hp-view { margin-right: 4px; }

.hp-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}
.hp-card {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
    min-width: 0;
}
.hp-card--live {
    background:
        linear-gradient(180deg, rgba(91, 97, 181, .06), transparent 70%),
        var(--swl-surface);
    border-color: color-mix(in srgb, var(--swl-primary) 28%, var(--swl-line));
}
.hp-card__label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
    margin-bottom: 6px;
}
.hp-card__num {
    display: block;
    font-size: clamp(1.35rem, 2vw, 1.7rem);
    font-weight: 750;
    letter-spacing: -.02em;
    color: var(--swl-ink);
    line-height: 1.1;
}
.hp-card--live .hp-card__num { color: #3C4097; }
html[data-theme="dark"] .hp-card--live .hp-card__num { color: #C4C8F0; }

.hp-wrap {
    overflow: auto;
    max-height: max(320px, calc(100vh - 300px));
    border: 1px solid var(--swl-line);
    border-radius: 14px;
    background: var(--swl-surface);
    box-shadow: 0 8px 24px rgba(46, 50, 120, .05);
}
.hp-wrap--narrow { max-width: 780px; max-height: none; margin-top: 8px; }
table.hp-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
table.hp-grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 11px 12px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
    background: var(--swl-soft);
    border-bottom: 1px solid var(--swl-line);
    white-space: nowrap;
}
table.hp-grid thead th.n,
table.hp-grid td.n,
table.hp-grid tfoot td.n { text-align: right; }
table.hp-grid tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--swl-line);
    vertical-align: middle;
    white-space: nowrap;
    background: var(--swl-surface);
    color: var(--swl-ink);
}
table.hp-grid tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--swl-soft) 55%, var(--swl-surface)); }
table.hp-grid tbody tr:hover td { background: var(--swl-hover) !important; }
table.hp-grid td.nm,
table.hp-grid thead th:first-child,
table.hp-grid tfoot td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 180px;
    box-shadow: 4px 0 10px rgba(15, 20, 40, .04);
}
table.hp-grid thead th:first-child { z-index: 4; background: var(--swl-soft); }
table.hp-grid tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 3;
    padding: 11px 12px;
    font-weight: 700;
    background: var(--swl-soft);
    border-top: 1px solid var(--swl-line);
    white-space: nowrap;
}
table.hp-grid tfoot td:first-child { z-index: 4; }
table.hp-grid tr.sub td {
    font-size: 12px;
    color: var(--swl-muted);
    border-top: 0;
    padding-top: 0;
    padding-bottom: 10px;
    background: transparent !important;
}
table.hp-grid tr.sub td:first-child { position: static; box-shadow: none; background: transparent !important; }
table.hp-grid tr.sub td .stick { position: sticky; left: 12px; display: inline-block; }
table.hp-grid .net { font-weight: 800; font-size: 15px; color: var(--swl-ink); }
table.hp-grid .neg { color: var(--swl-danger-ink); }
table.hp-grid .pos { color: var(--swl-ok-ink); font-weight: 700; }
table.hp-grid .quiet { color: var(--swl-muted); }
.hp-meta {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--swl-muted);
    margin-top: 2px;
}
.hp-days {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    white-space: normal;
    max-width: 280px;
}
.hp-day {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--swl-soft);
    border: 1px solid var(--swl-line);
    font-size: 12px;
    color: var(--swl-muted);
}
.hp-day--p { color: #1B6B3A; background: #E8F6EE; border-color: #C6E6D1; }
.hp-day--open { color: var(--swl-danger-ink); background: var(--swl-danger-soft); border-color: var(--swl-danger-line); font-weight: 750; }
.hp-trucks { margin-top: 22px; }
.hp-trucks__title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 750;
    color: var(--swl-ink);
}

.hs-wrap {
    border: 1px solid var(--swl-line);
    border-radius: 14px;
    background: var(--swl-surface);
    box-shadow: 0 8px 24px rgba(46, 50, 120, .05);
}
.hs-add-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 12px;
    padding: 12px 16px;
    border: 1px dashed color-mix(in srgb, var(--swl-primary) 35%, var(--swl-line));
    border-radius: 14px;
    background: var(--swl-surface);
    color: var(--swl-ink);
    font-size: 14px;
    font-weight: 750;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.hs-add-bar:hover {
    background: var(--swl-soft);
    border-color: var(--swl-primary);
    transform: translateY(-1px);
}
.hs-add-bar__plus {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(180deg, #6B71C4, var(--swl-strong));
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
}
.hs-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 16px;
    margin: 0;
}
.hs-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
}
.hs-form input,
.hs-form select {
    height: 36px;
    min-width: 140px;
    border-radius: 9px;
    border: 1px solid var(--swl-line);
    padding: 0 10px;
    background: var(--swl-page);
    color: var(--swl-ink);
    font-size: 14px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.hv-form {
    margin: 0 0 12px;
    border: 1px solid var(--swl-line);
    border-radius: 14px;
    background: var(--swl-surface);
}
.hs-wrap { overflow: auto; }
table.hs-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
table.hs-grid thead th {
    padding: 11px 14px;
    text-align: left;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--swl-muted);
    background: var(--swl-soft);
    border-bottom: 1px solid var(--swl-line);
    white-space: nowrap;
}
table.hs-grid thead th.n,
table.hs-grid td.n,
table.hs-grid tfoot td.n { text-align: right; }
table.hs-grid tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--swl-line);
    vertical-align: middle;
    color: var(--swl-ink);
    background: var(--swl-surface);
}
table.hs-grid tbody tr:nth-child(even):not(.hs-edit-row) td {
    background: color-mix(in srgb, var(--swl-soft) 50%, var(--swl-surface));
}
table.hs-grid tbody tr:not(.hs-edit-row):hover td { background: var(--swl-hover) !important; }
table.hs-grid tbody tr.is-inactive td { opacity: .55; }
table.hs-grid td.nm strong {
    font-weight: 700;
    letter-spacing: .01em;
}
table.hs-grid .hs-mono {
    font-variant-numeric: tabular-nums;
    color: var(--swl-muted);
    font-size: 13.5px;
}
table.hs-grid .hs-act { width: 72px; text-align: right; }
table.hs-grid tfoot td {
    padding: 12px 14px;
    background: var(--swl-soft);
    font-weight: 700;
    border-top: 1px solid var(--swl-line);
}
.hs-edit {
    border: 1px solid var(--swl-line);
    background: var(--swl-surface);
    color: var(--swl-ink);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}
.hs-edit:hover { background: var(--swl-soft); }
.hs-edit.is-danger {
    color: var(--swl-danger-ink);
    border-color: var(--swl-danger-line);
    background: var(--swl-danger-soft);
}
.hs-edit-row td {
    background: var(--swl-soft) !important;
    border-left: 3px solid var(--swl-primary);
    padding: 8px 14px 14px !important;
}

/* Staff edit / add modal — page stays visible behind the dimmed glass */
body.hs-modal-open { overflow: hidden; }
.hs-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}
.hs-modal[hidden] { display: none !important; }
.hs-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    cursor: pointer;
    background: rgba(28, 32, 58, .42);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.hs-modal__panel {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: min(90vh, 760px);
    overflow: auto;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .35);
    background:
        radial-gradient(ellipse 70% 60% at 100% 0%, rgba(236, 75, 79, .08), transparent 55%),
        linear-gradient(180deg, #FFFFFF 0%, #F7F8FC 100%);
    box-shadow: 0 28px 60px rgba(28, 32, 58, .28);
    animation: hs-modal-in .22s ease-out both;
}
html[data-theme="dark"] .hs-modal__panel {
    background:
        radial-gradient(ellipse 70% 60% at 100% 0%, rgba(242, 92, 96, .16), transparent 55%),
        linear-gradient(180deg, #2A3050 0%, #22263C 100%);
    border-color: rgba(255, 255, 255, .08);
}
.hs-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0;
}
.hs-modal__eyebrow {
    margin: 0 0 4px;
    font-size: 11.5px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #D64545;
}
html[data-theme="dark"] .hs-modal__eyebrow { color: #FFB3B5; }
.hs-modal__title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 750;
    letter-spacing: -.02em;
    color: #2E3278;
}
html[data-theme="dark"] .hs-modal__title { color: #fff; }
.hs-modal__x {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--swl-soft);
    color: var(--swl-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.hs-modal__x:hover { color: var(--swl-ink); background: var(--swl-line); }
.hs-modal__form {
    padding: 16px 20px 20px;
}
.hs-modal__form label { min-width: calc(50% - 6px); flex: 1 1 200px; }
.hs-modal__form .hs-note-field { flex: 1 1 100%; }
.hs-modal__form .hs-note-field input { min-width: 100%; }
.hs-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    padding-top: 6px;
}
@keyframes hs-modal-in {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .hs-modal__panel { animation: none; }
}

@media (max-width: 980px) {
    .hp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .hp-cards { grid-template-columns: 1fr; }
}


