/* Clean workspace: white surfaces, clear blue actions and generous spacing. */
:root {
    color-scheme: light;
    --ink: #182334;
    --muted: #5c6678;
    --primary: #2859dc;
    --bg: #f7f8fa;
    --line: #e1e5ec;
    --glass: #ffffff;
    --glass-edge: #e1e5ec;
    --surface: #ffffff;
    --card: #ffffff;
    --field: #ffffff;
    --tint: #f5f7fa;
    --blue-soft: #edf3ff;
    --blue-ink: #2454c6;
    --royal-soft: #edf1f7;
    --royal-ink: #3e5774;
    --mint-soft: #e2ede9;
    --mint-ink: #365f53;
    --rose-soft: #f3e6e9;
    --rose-ink: #903a51;
    --amber-soft: #fff0cc;
    --amber-ink: #754b00;
    --shadow: 0 2px 8px rgba(25, 43, 72, .045);
    --shine: 0 0 0 transparent;
    --yangon-blue: #2859dc;
    --yangon-polo: #668da5;
    --changi-plum: #3e5774;
    --changi-teal: #365f53;
}
html[data-theme="dark"] {
    color-scheme: dark;
    --ink: #f7f8fa;
    --muted: #c7d3de;
    --primary: #afcee0;
    --bg: #253444;
    --line: rgba(179, 203, 223, .2);
    --glass: #273648;
    --glass-edge: rgba(209, 225, 238, .24);
    --surface: #304154;
    --card: #34495c;
    --field: #223143;
    --tint: rgba(181, 207, 227, .08);
    --blue-soft: #304865;
    --blue-ink: #d1e7f4;
    --royal-soft: #354459;
    --royal-ink: #dae4f1;
    --mint-soft: #334f4c;
    --mint-ink: #c0e0d3;
    --rose-soft: #4b1636;
    --rose-ink: #ffb7cb;
    --amber-soft: #3c300b;
    --amber-ink: #ffe09a;
    --shadow: 0 14px 40px rgba(14, 27, 38, .18), 0 0 28px rgba(113, 155, 185, .03);
    --shine: 0 0 0 transparent;
}
body {
    background: var(--bg);
    color: var(--ink);
    isolation: isolate;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
body::before, body::after { display: none; }
html[data-theme="dark"] :is(.sidebar, .login-story) .brand-logo { background: #ffffff; border-radius: 12px; padding: 5px; }
a { color: var(--primary); }
a:hover { color: var(--blue-ink); }
h1, h2, h3 { color: var(--ink); font-weight: 700; }
h1 { font-size: clamp(28px, 2.5vw, 38px); letter-spacing: -1px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
.subtle, label, .help, .metric-label, .metric-foot, td small, .timeline small,
.summary-list dt, .breadcrumbs, .user small, .text-button { color: var(--muted); }
.subtle, label, .metric-label { font-size: 15px; }
.help, .metric-foot, td small, .timeline small { font-size: 14px; }
.eyebrow { color: var(--primary); font-size: 12px; letter-spacing: 1.8px; font-weight: 700; }

/* Solid surfaces keep each section clear and easy to scan. */
.sidebar, header, .card, .metric, .intro-banner, .login-shell, .photo-viewer {
    background: var(--card);
    border: 1px solid var(--glass-edge);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: var(--shadow);
}
.sidebar {
    inset: 0 auto 0 0;
    width: 240px;
    padding: 23px 16px;
    border-radius: 0;
    border: 0;
    border-right: 1px solid var(--line);
    box-shadow: none;
    color: var(--ink);
    overflow-y: auto;
    scrollbar-width: thin;
}
.sidebar .brand {
    flex-direction: row;
    align-items: center;
    gap: 11px;
    padding: 10px 8px 24px;
    margin: 0 0 12px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
}
.sidebar .brand-logo { width: 53px; height: 53px; aspect-ratio: auto; max-width: none; }
.sidebar .brand-copy { font-size: 23px; }
.sidebar .brand small { color: var(--muted); font-size: 7px; letter-spacing: 1.2px; line-height: 1.8; }
.sidebar .nav-caption { color: var(--muted); font-size: 12px; font-weight: 600; margin: 16px 14px 14px; }
.sidebar nav a {
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    gap: 12px;
    transition: background .18s, box-shadow .18s, color .18s;
}
.sidebar nav a span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--primary);
    font-size: 17px;
    flex-shrink: 0;
}
.sidebar nav a:hover { background: var(--tint); color: var(--ink); }
.sidebar nav a.active {
    color: var(--blue-ink);
    border-color: var(--glass-edge);
    background: var(--blue-soft);
    box-shadow: none;
}
.sidebar nav a.active span { background: transparent; border-color: transparent; color: var(--blue-ink); }
.nav-more { padding: 0; margin-top: 18px; border: 0; }
.nav-more > summary { padding: 12px 14px; font-size: 14px; color: var(--muted); }
.sidebar-bottom { color: var(--muted); border-color: var(--line); font-size: 13px; line-height: 1.8; padding: 20px 8px 0; }
.sidebar-bottom small { color: var(--ink); font-weight: 700; font-size: 14px; }
.live-dot { background: #6b9e9c; box-shadow: none; }
.workspace { margin-left: 240px; min-width: 0; }
header { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: 80px; margin: 0; padding: 18px 36px; border: 0; border-radius: 0; gap: 18px; background: #2d5cff; box-shadow: none; color: #fff; }
header :is(.breadcrumbs, .breadcrumbs strong, .breadcrumbs span, .user, .user small, .text-button) { color: #fff; }
header :is(.theme-switch, .language-switch) { background: #2450df; border-color: #ffffff40; }
header :is(.theme-switch, .language-switch) button { color: #fff; }
header :is(.theme-switch, .language-switch) button[aria-pressed="true"] { background: #fff; color: #234fc8; }
header .avatar { background: #ffffff; color: #2859dc; border-color: #fff; }
.breadcrumbs { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.breadcrumbs strong { color: var(--ink); font-weight: 650; }
.breadcrumbs span { color: var(--muted); margin: 0 10px; }
.user { grid-column: 2; grid-row: 1; min-width: 0; max-width: 100%; flex-wrap: wrap; justify-content: flex-end; font-size: 14px; gap: 12px; }
.user > .avatar, .user > form { flex-shrink: 0; }
.user small { font-size: 13px; }
.avatar { background: var(--blue-soft); color: var(--blue-ink); border: 1px solid var(--glass-edge); width: 38px; height: 38px; box-shadow: none; }
.text-button { font-size: 14px; }
.text-button:hover { color: var(--primary); }
main { max-width: 1520px; padding: 40px 36px 48px; min-width: 0; }
.page-heading { margin-bottom: 26px; gap: 20px; }
.page-heading > div { min-width: 0; max-width: 100%; }
.page-heading h1 { overflow-wrap: anywhere; }
.page-heading > div:first-child { flex: 1; }
.page-heading > .actions { flex-shrink: 0; }
.page-heading .subtle { margin-top: 8px; line-height: 1.8; }
footer { color: var(--muted); border-color: var(--line); font-size: 13px; margin: 0 28px; padding: 18px 0 24px; }

/* Consistent controls with one primary action color. */
.button {
    min-height: 42px;
    padding: 10px 18px;
    border-radius: 6px;
    border: 1px solid #2859dc;
    background: #2859dc;
    color: #ffffff;
    font-size: 14px;
    font-weight: 650;
    box-shadow: none;
    transition: box-shadow .18s, background .18s, transform .18s;
}
.button:hover { color: #ffffff; filter: none; box-shadow: none; transform: none; background: #1f4bc7; }
.button.secondary { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: none; }
.button.secondary:hover { background: var(--tint); color: var(--blue-ink); }
.button.danger { background: var(--rose-soft); color: var(--rose-ink); border-color: var(--line); box-shadow: none; }
.button.danger:hover { color: var(--rose-ink); background: var(--rose-soft); }
.button.small { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 10px; }
.button:disabled, button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
:where(a, button, summary):focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; }
input, select, textarea {
    min-height: 46px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--field);
    color: var(--ink);
    font-size: 16px;
    padding: 12px 14px;
    box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .9; }
input:focus, select:focus, textarea:focus { outline: 3px solid #668da533; border-color: #668da5; background: var(--surface); }
input[type="checkbox"], input[type="radio"] { accent-color: #547a96; }
input[type="file"]::file-selector-button { padding: 6px 10px; margin-right: 10px; border: 0; border-radius: 7px; background: var(--blue-soft); color: var(--blue-ink); font: inherit; cursor: pointer; }
select option { background: var(--card); color: var(--ink); }
.filters { padding: 17px 20px; gap: 14px; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--glass); box-shadow: none; }
.filters label { flex: 1 1 160px; min-width: min(160px, 100%); max-width: 100%; }
.filters .search { flex: 2 1 260px; min-width: min(260px, 100%); }
.filters > .button, .record-search > .button { flex: 0 0 auto; min-height: 52px; height: 52px; white-space: nowrap; }
html[lang="my"] :is(.filters, .record-search, .workspace-search) > .button { white-space: nowrap; }
.filters input, .filters select { min-width: 0; max-width: 100%; height: 52px; padding-block: 8px; }
.field-grid { gap: 20px; }
.form-actions { border-color: var(--line); flex-wrap: wrap; }
.language-switch, .theme-switch { display: inline-flex; flex-shrink: 0; gap: 3px; padding: 4px; background: var(--tint); border: 1px solid var(--line); border-radius: 12px; }
.language-switch button, .theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: auto; margin: 0; padding: 5px 9px; min-height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; line-height: 1.6; }
.language-switch button[aria-pressed="true"], .theme-switch button[aria-pressed="true"] { color: var(--blue-ink); background: var(--surface); box-shadow: none; }

/* Responsive operational summary cards. */
.metrics { gap: 18px; margin: 24px 0; }
.metric { position: relative; border-radius: 12px; padding: 23px; overflow: hidden; min-width: 0; }
.metric::before, .metric::after { display: none; }
.metric-label { padding-right: 0; font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.metric-value { color: var(--ink); font-size: clamp(27px, 2.5vw, 38px); font-weight: 700; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value small { display: inline-block; white-space: nowrap; color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.metric.accent { background: var(--card); border-color: var(--glass-edge); }
.metric.accent .metric-value { color: var(--primary); }
a.metric { transition: transform .2s, box-shadow .2s; }
a.metric:hover { transform: none; border-color: #8ca9ef; box-shadow: none; }
.branch-operational-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border-radius: 12px; margin-bottom: 24px; min-width: 0; }
.card-head { padding: 21px 24px; border-color: var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head a { font-size: 15px; font-weight: 600; }
.card-body { padding: 24px; }
.intro-banner { border-radius: 12px; padding: 25px; background: var(--blue-soft); border-color: var(--glass-edge); }
.intro-banner p { color: var(--muted); font-size: 15px; }
.split, .two-columns { gap: 24px; min-width: 0; }
.split > *, .two-columns > * { min-width: 0; }
.home-branch-picker { display: inline-flex; gap: 5px; flex-wrap: wrap; padding: 5px; margin: 0 0 22px; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--glass); box-shadow: none; }
.home-branch-picker a { margin: 0; padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; color: var(--muted); gap: 9px; background: transparent; }
.home-branch-picker strong { font-size: 14px; letter-spacing: .5px; }
.home-branch-picker a span { width: auto; white-space: normal; font-size: 14px; color: inherit; }
.home-branch-picker a:hover { background: var(--tint); color: var(--ink); }
.home-branch-picker a[aria-current="page"] { color: var(--blue-ink); background: var(--blue-soft); border-color: var(--glass-edge); box-shadow: none; }


/* Roomy outlined rows, inspired by the supplied flight-status interface. */
table { border-collapse: separate; border-spacing: 0 8px; }
.table-wrap { padding: 0 16px 8px; }
tbody td { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 1px solid var(--line); }
tbody td:first-child { border-left: 1px solid var(--line); border-radius: 8px 0 0 8px; }
tbody td:last-child { border-right: 1px solid var(--line); border-radius: 0 8px 8px 0; }
tbody tr:hover td { background: var(--tint); }

.table-wrap { scrollbar-width: thin; scrollbar-color: #8f9dc066 transparent; }
th { padding: 14px 22px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .3px; border-color: var(--line); }
td { padding: 22px; font-size: 16px; color: var(--ink); border-color: var(--line); }
td strong { font-weight: 650; }
td .mono, .mono { font-size: 15px; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--tint); }
.badge { background: var(--blue-soft); color: var(--blue-ink); padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); font-size: 13px; font-weight: 650; }
.badge[data-status="Processing"], .badge[data-status="Dispatched"], .badge[data-status="In Transit"], .badge[data-status="Arrived at Branch"] { color: var(--royal-ink); background: var(--royal-soft); }
.badge[data-status="Ready for Dispatch"], .badge[data-status="Ready for Collection"], .badge[data-status="Collected"], .badge[data-status="Delivered"] { color: var(--mint-ink); background: var(--mint-soft); }
.badge[data-status="Exception"], .badge[data-status="Cancelled"] { color: var(--rose-ink); background: var(--rose-soft); }
.branch-route-tag { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.branch-route-tag > span:first-child, .branch-route-tag > span:last-child { padding: 4px 8px; border-radius: 7px; color: var(--blue-ink); background: var(--blue-soft); }
.branch-route-tag > span:last-child { background: var(--royal-soft); color: var(--royal-ink); }
.branch-route-tag > span:nth-child(2) { color: var(--muted); }
.pagination { padding: 18px 24px; font-size: 14px; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagination a { background: var(--surface); border-color: var(--line); border-radius: 10px; }
.empty { font-size: 15px; color: var(--muted); }

/* Details, workflows and form feedback share the same material vocabulary. */
details { border-color: var(--line); }
summary { color: var(--ink); font-size: 15px; }
.workflow-details { border: 0; padding: 0; margin: 24px 0; }
.workflow-details > summary { padding: 12px 3px 18px; font-size: 15px; }
.workflow-details > .card { margin-top: 0; }
.queue-section { padding: 0; }
.queue-section > summary { padding: 22px 24px; font-size: 15px; }
.branch-flow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; color: var(--muted); font-size: 14px; }
.branch-flow span, .simple-flow span { padding: 8px 13px; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--glass); box-shadow: none; }
.simple-flow .current { background: var(--blue-soft); border-color: var(--line); color: var(--blue-ink); }
.notice { border-radius: 12px; font-size: 15px; }
.notice.success { background: var(--mint-soft); color: var(--mint-ink); border-color: var(--line); }
.notice.error { background: var(--rose-soft); color: var(--rose-ink); border-color: var(--line); }
.summary-list > div { border-color: var(--line); font-size: 15px; }
.summary-list .total { color: var(--primary); }
.timeline li { border-color: var(--line); }
.timeline li::before { background: #668da5; border-color: var(--card); box-shadow: none; }
.timeline strong { font-size: 15px; }
.timeline p { color: var(--muted); font-size: 14px; }
.quote { border-radius: 12px; border-color: var(--glass-edge); background: var(--blue-soft); box-shadow: none; }
.quote strong { color: var(--blue-ink); }
pre { background: var(--tint); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; }
.danger-text { color: var(--rose-ink); }
.checklist label { border-color: var(--line); }
.parcel-photo-grid img { background: var(--tint); border: 1px solid var(--glass-edge); border-radius: 12px; }
.photo-viewer { border-radius: 12px; padding: 20px; color: var(--ink); }
.photo-viewer::backdrop { background: #18233480; -webkit-backdrop-filter: none; backdrop-filter: none; }
.parcel-progress { margin: 16px 0 26px; }
.parcel-progress-label { font-size: 14px; padding: 0 5px; overflow-wrap: anywhere; color: var(--muted); }
.parcel-progress-dot { border-color: #8ba6b9; }
.parcel-progress li:not(:first-child)::before { background: var(--line); }
.parcel-progress li.is-complete::before, .parcel-progress li.is-current::before { background: #668da5; }
.parcel-progress .is-complete .parcel-progress-dot, .parcel-progress .is-current .parcel-progress-dot { background: #547a96; color: #fff; border-color: #547a96; box-shadow: none; }
.parcel-progress .is-current .parcel-progress-dot { box-shadow: none; }

/* Simple two-panel sign-in. */
.login-body { padding: 36px 20px; min-height: 100svh; background: var(--bg); }
.login-shell { width: min(1040px, 96vw); padding: 10px; gap: 0; border-radius: 12px; overflow: hidden; }
.login-story { position: relative; isolation: isolate; overflow: hidden; border: 1px solid var(--glass-edge); border-radius: 12px; min-height: 620px; padding: 38px; color: var(--ink); background: var(--blue-soft); box-shadow: none; }
.login-story::after { display: none; }
.login-story .brand { align-items: center; gap: 14px; padding: 0; margin: 0 0 85px; color: var(--ink); }
.login-story .brand-logo { width: 68px; height: 68px; background: #fff; border-radius: 12px; padding: 5px; }
.login-story .brand-copy { font-size: 28px; }
.login-story .brand small { color: var(--muted); font-size: 8px; }
.login-story .eyebrow { color: var(--blue-ink); font-size: 12px; letter-spacing: 1.4px; }
.login-story h1 { color: var(--ink); font-size: 42px; line-height: 1.2; letter-spacing: -1.6px; }
.login-story p { color: var(--muted); font-size: 14px; max-width: 300px; line-height: 1.8; }
.login-story > small { color: var(--muted); font-size: 13px; margin-top: 40px; }
.login-form { padding: 35px 38px; align-self: center; color: var(--ink); }
.login-form h1 { font-size: 26px; }
.login-form label { font-size: 15px; margin: 22px 0; }
.login-form .subtle { line-height: 1.8; }
.login-form > .theme-switch, .login-form > .language-switch { display: flex; width: max-content; margin: 0 0 12px auto; }
.login-form > .language-switch { margin-bottom: 28px; }

/* Keep document surfaces suitable for receipts and manifests. */
.print-page { color-scheme: light; --ink: #24334e; --muted: #52617b; --line: #d9dfeb; --primary: #2859dc; --tint: #f1f3fa; --surface: #fff; --blue-soft: #e3ebff; --blue-ink: #344d9b; --royal-soft: #e1ebff; --royal-ink: #103fa5; color: var(--ink); border: 1px solid #fff; border-radius: 12px; background: #ffffffed; box-shadow: none; }
.print-page h1, .print-page h2, .print-page h3, .print-page td { color: var(--ink); }
.print-page .print-head { border-color: #2859dc; }
.print-page th { color: var(--muted); background: #f1f3fa; }
.print-toolbar { flex-wrap: wrap; }

@media (min-width: 1600px) {
    .sidebar { width: 240px; inset: 0 auto 0 0; padding: 26px 20px; }
    .workspace { margin-left: 240px; }
    header { margin-top: 0; }
    main { padding-top: 38px; }
    .metric { padding: 27px; }
}
@media (max-width: 1150px) and (min-width: 781px) {
    .sidebar { width: 208px; inset: 0 auto 0 0; padding: 20px 12px; }
    .sidebar .brand { gap: 8px; padding-left: 4px; padding-right: 4px; }
    .sidebar .brand-logo { width: 43px; height: 43px; }
    .sidebar .brand-copy { font-size: 21px; }
    .sidebar .brand small { font-size: 6px; }
    .sidebar nav a { padding: 10px 8px; gap: 9px; }
    .workspace { margin-left: 208px; }
    header { margin: 0; padding: 14px 18px; flex-wrap: wrap; }
    .user { flex-wrap: wrap; }
    main { padding: 28px 20px 40px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .branch-operational-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .metric { padding: 20px 18px; }
    .metric-label { font-size: 13px; }
    .split { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .sidebar { position: relative; inset: auto; width: auto; margin: 0; padding: 18px; border-radius: 0; border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
    .sidebar .brand { width: max-content; max-width: 100%; padding: 0; border: 0; margin: 0 0 14px; gap: 12px; }
    .sidebar .brand-logo { width: 44px; height: 44px; }
    .sidebar .brand-copy { font-size: 22px; }
    .sidebar .brand small { display: block; font-size: 7px; }
    .sidebar nav { display: flex; gap: 6px; }
    .sidebar nav a { min-height: 40px; margin: 0; padding: 7px 9px; font-size: 14px; gap: 7px; border-radius: 12px; }
    .sidebar nav a span { width: 24px; height: 24px; font-size: 15px; border-radius: 7px; }
    .nav-more { margin: 0; flex-basis: 100%; }
    .nav-more > summary { padding: 10px 4px 4px; }
    .nav-more[open] { display: block; }
    .nav-more a { display: inline-flex; margin: 4px 0 0 !important; }
    .workspace { margin-left: 0; }
    header { margin: 0; padding: 14px 16px; min-height: 68px; flex-wrap: wrap; border-radius: 0; gap: 12px; }
    .user { flex-wrap: wrap; gap: 8px; width: 100%; justify-content: flex-start; }
    .user > div:not(.theme-switch):not(.language-switch) { margin-left: auto; }
    main { padding: 25px 14px 36px; }
    .page-heading { flex-wrap: wrap; gap: 14px; }
    h1 { font-size: 27px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .branch-operational-metrics { grid-template-columns: 1fr; }
    .metric { padding: 20px; border-radius: 12px; }
    .metric-value { font-size: 29px; }
    .branch-operational-metrics .metric { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
    .branch-operational-metrics .metric-label { margin: 0; padding-right: 0; }
    .branch-operational-metrics .metric-value { padding-right: 22px; }
    .branch-operational-metrics .metric::before { top: 30px; right: 18px; }
    .two-columns, .field-grid, .split { grid-template-columns: 1fr; }
    .card { border-radius: 12px; }
    .card-body { padding: 20px; }
    .card-head { padding: 18px 20px; }
    .filters { padding: 16px; gap: 12px; }
    .filters label { flex: 1; min-width: 120px; }
    .filters input, .filters select { min-width: 0; }
    .filters .search { min-width: 100%; }
    .intro-banner { flex-wrap: wrap; padding: 22px; }
    .home-branch-picker { display: flex; }
    .home-branch-picker a { flex: 1; justify-content: center; padding: 10px; gap: 6px; }
    .home-branch-picker a span { font-size: 13px; }
    td { padding: 16px 18px; }
    th { padding: 13px 18px; }
    footer { margin: 0 16px; }
    .login-body { padding: 16px 10px; }
    .login-shell { width: min(480px, 100%); grid-template-columns: 1fr; padding: 8px; border-radius: 12px; }
    .login-story { min-height: auto; padding: 26px; border-radius: 12px; }
    .login-story .brand { margin-bottom: 28px; }
    .login-story .brand-logo { width: 52px; height: 52px; }
    .login-story .brand-copy { font-size: 24px; }
    .login-story h1 { font-size: 30px; }
    .login-form { padding: 28px 22px; }
    .login-form > .theme-switch, .login-form > .language-switch { display: inline-flex; margin: 0 8px 22px 0; }
    .print-page { margin: 12px; padding: 20px; }
    .photo-viewer-toolbar { gap: 7px; }
}
@media (max-width: 400px) {
    .user .theme-switch button, .user .language-switch button { font-size: 12px; padding: 5px 7px; }
    .user > div:not(.theme-switch):not(.language-switch) { margin-left: 0; }
    .metrics { grid-template-columns: 1fr; }
    .home-branch-picker a span { display: none; }
    .page-heading .actions { width: 100%; }
    .page-heading .actions .button { white-space: normal; }
}
@media screen {
    html[lang="my"] h1 { font-size: 30px; line-height: 1.65; }
    html[lang="my"] .sidebar nav a { font-size: 15px; align-items: center; }
    html[lang="my"] .sidebar .brand small { font-size: 9px; }
    html[lang="my"] :is(label, td, .subtle, .metric-label) { font-size: 15px; }
    html[lang="my"] :is(.help, th, .metric-foot) { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
    .button:hover, a.metric:hover { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
    .sidebar, header, .card, .metric, .intro-banner, .login-shell, .photo-viewer, .filters { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sidebar, header, .card, .metric, .intro-banner, .login-shell, .photo-viewer { background: var(--card); }
}
/* Searches stay outside business forms and preserve the current filters. */
.workspace-search { grid-column: 1 / -1; grid-row: 2; display: flex; align-items: stretch; gap: 8px; min-width: 0; width: 100%; margin: 0; }
.workspace-search input { flex: 1 1 0; width: 0; min-width: 0; min-height: 52px; height: 52px; padding-block: 8px; margin: 0; font-size: 16px; color: var(--ink); background: var(--field); }
.workspace-search .button { flex: 0 0 auto; min-width: 76px; min-height: 52px; padding: 8px 16px; white-space: nowrap; }
.record-search { display:flex; flex-wrap:wrap; align-items:end; gap:12px; padding:18px 24px; border-bottom:1px solid var(--line); }
.record-search label { flex: 1 1 220px; min-width: min(180px, 100%); max-width: 100%; }
.record-search input { min-width: 0; height: 52px; padding-block: 8px; }
.record-search output { flex-basis:100%; color:var(--muted); font-size:14px; }
.record-search output:empty { display:none; }
[data-table-search] tr[hidden] { display:none; }
@media (min-width: 1600px) {
    header { grid-template-columns: minmax(140px, 1fr) minmax(240px, 330px) auto; }
    .workspace-search { grid-column: 2; grid-row: 1; }
    header .user { grid-column: 3; }
}
@media (max-width: 1000px) {
    header { grid-template-columns: minmax(0, 1fr); }
    header .user { grid-column: 1; grid-row: 2; justify-content: flex-start; }
    .workspace-search { grid-row: 3; }
}
@media (max-width: 780px) {
    .record-search { padding: 16px; }
}
/* Install controls use the same clear surfaces as the workspace. */
.pwa-actions { margin:0 0 16px; }
.pwa-actions [hidden], [data-pwa-offline][hidden] { display:none !important; }
.pwa-help { width:min(500px,calc(100vw - 32px)); max-height:85vh; overflow:auto; padding:28px; border:1px solid var(--line); border-radius:12px; background:var(--card); color:var(--ink); }
.pwa-help::backdrop { background:#18233480; }
.pwa-help p { font-size:16px; }
.pwa-offline { position:fixed; bottom:16px; left:50%; transform:translateX(-50%); width:min(600px,calc(100vw - 32px)); z-index:20; margin:0; box-shadow:0 4px 18px #18233420; }
@media(max-width:780px) { .sidebar-bottom:has(.pwa-actions) { display:block; margin-top:16px; border-top:0; padding:0; } .sidebar-bottom:has(.pwa-actions) > .live-dot, .sidebar-bottom:has(.pwa-actions) > small { display:none; } .sidebar-bottom:has(.pwa-actions) { font-size:0; } .sidebar-bottom .pwa-actions { margin:0; } .login-form .pwa-actions button { width:auto; } }
@media print { .pwa-actions, .pwa-offline, .pwa-help { display:none !important; } }
@media print { header, .workspace-search, .record-search { display:none !important; } }
@media print {
    :root, html[data-theme="dark"] { color-scheme: light; --ink: #000; --muted: #444; --line: #ccc; }
    body { background: #fff !important; color: #000 !important; }
    body::before, body::after { display: none; }
    .workspace { margin: 0; }
    main { padding: 0; }
    .print-page { margin: 0; max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
    .card, .metric { background: #fff; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid #ccc; }
    .print-page h1, .print-page h2, .print-page h3, .print-page td { color: #000; }
    .print-page table { border-collapse: collapse; border-spacing: 0; }
    .print-page td, .print-page th { font-size: 11px; }
    .print-page .table-wrap { padding: 0; }
    .print-page th { background: #f3f3f3; color: #333; }
}
