/* MudBlazor + Radzen restyle: makes EXISTING pages pick up the new language with no page edits.
   Loaded after app.css and the MudBlazor/Radzen stylesheets. app.css has many !important rules, so the ones that
   collide are repeated here with `body` + !important. Colors come from uw-tokens.css (and the MudTheme in Helper/UwTheme.cs).
   Shared file, edit in InternalPortal then run scripts/sync-ui-kit.sh. */

html, body { font-family: var(--uw-font); color: var(--uw-text); background: var(--uw-bg); letter-spacing: -0.006em; -webkit-text-size-adjust: 100%; }
body .mud-typography { font-family: var(--uw-font); }
body a { color: var(--uw-primary); }
body a:hover { color: var(--uw-primary-hover); }
::selection { background: #c7d2fe; }
body .mud-typography-h4 { font-weight: 800; letter-spacing: -0.02em; }
body .mud-typography-h5 { font-weight: 700 !important; letter-spacing: -0.015em; color: var(--uw-text); }
body .mud-typography-h6 { font-weight: 700; letter-spacing: -0.01em; }
body .mud-typography-subtitle1 { font-weight: 600; }
body .mud-typography-caption { color: var(--uw-muted); }
body .mud-main-content { background: var(--uw-bg) !important; }

/* ---------- buttons ---------- */
body .mud-button-root { font-family: var(--uw-font); text-transform: none !important; letter-spacing: 0; font-weight: 600; border-radius: var(--uw-r-md); transition: background var(--uw-dur) var(--uw-ease), border-color var(--uw-dur) var(--uw-ease), color var(--uw-dur) var(--uw-ease); }
body .mud-button-root.mud-button { min-height: var(--uw-control); padding: 0 16px; font-size: 14px; line-height: 1.1; }
body .mud-button-root.mud-button-size-small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--uw-r-sm); }
body .mud-button-root.mud-button-size-large { min-height: 48px; padding: 0 22px; font-size: 15px; }
body .mud-button-filled, body .mud-button-filled:hover { box-shadow: none; }
body .mud-button-filled.mud-button-filled-primary { background: var(--uw-primary); color: #fff; }
body .mud-button-filled.mud-button-filled-primary:hover { background: var(--uw-primary-hover); }
body .mud-button-filled.mud-button-filled-error { background: var(--uw-danger); }
body .mud-button-filled.mud-button-filled-success { background: var(--uw-success); }
body .mud-button-filled.mud-button-filled-warning { background: var(--uw-warning); color: #fff; }
body .mud-button-filled.mud-button-filled-info { background: var(--uw-sky); }
body .mud-button-filled.mud-button-filled-default { background: var(--uw-surface-2); color: var(--uw-text); }
/* Outlined = secondary button. Replaces the old orange outlined rule in app.css. */
body button.mud-button-root.mud-button.mud-button-outlined, body .mud-button-outlined.mud-button-outlined-warning, body a.mud-button-root.mud-button-outlined { background: var(--uw-surface); color: var(--uw-text); border: 1px solid var(--uw-border-strong); text-transform: none; }
body button.mud-button-root.mud-button.mud-button-outlined:hover, body .mud-button-outlined.mud-button-outlined-warning:hover, body a.mud-button-root.mud-button-outlined:hover { background: var(--uw-bg); color: var(--uw-text); border-color: var(--uw-faint); }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-primary { color: var(--uw-primary); border-color: #a5b4fc; background: var(--uw-surface); }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-primary:hover { background: var(--uw-primary-tint); color: var(--uw-primary-hover); border-color: var(--uw-primary); }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-error { color: var(--uw-danger-ink); border-color: #fecaca; }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-error:hover { background: var(--uw-danger-bg); color: var(--uw-danger-ink); border-color: var(--uw-danger); }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-success { color: var(--uw-success-ink); border-color: #a7f3d0; }
body button.mud-button-root.mud-button.mud-button-outlined.mud-button-outlined-success:hover { background: var(--uw-success-bg); border-color: var(--uw-success); }
body .mud-button-text.mud-button-text-primary { text-transform: none; }
body .mud-button-text:hover { background: var(--uw-surface-2); }
body .mud-button-text.mud-button-text-primary:hover { background: var(--uw-primary-tint); }
body .mud-icon-button { border-radius: var(--uw-r-sm); }
body .mud-icon-button:hover { background: var(--uw-surface-2); }
body .mud-button-root:disabled, body .mud-button-root.mud-disabled { opacity: 0.45; }
@media (pointer: coarse), (max-width: 700px) {
    body .mud-button-root.mud-button { min-height: var(--uw-touch); }
    body .mud-button-root.mud-button-size-small { min-height: 40px; }
    body .mud-icon-button { min-width: var(--uw-touch); min-height: var(--uw-touch); }
    body .mud-icon-button.mud-icon-button-size-small { min-width: 40px; min-height: 40px; }
}

/* ---------- inputs ---------- */
body .mud-input-control { font-family: var(--uw-font); }
body .mud-input.mud-input-outlined .mud-input-outlined-border { border: 1px solid var(--uw-border-strong); border-radius: var(--uw-r-md); transition: border-color var(--uw-dur) var(--uw-ease), box-shadow var(--uw-dur) var(--uw-ease); }
body .mud-input.mud-input-outlined:hover:not(.mud-disabled):not(.mud-input-error) .mud-input-outlined-border { border-color: var(--uw-faint); }
body .mud-input.mud-input-outlined.mud-input-focused .mud-input-outlined-border, body .mud-input-outlined.mud-focused .mud-input-outlined-border { border: 2px solid var(--uw-primary); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12); }
body .mud-input.mud-input-outlined.mud-input-error .mud-input-outlined-border { border-color: var(--uw-danger); }
body .mud-input.mud-input-outlined.mud-input-adorned-start { background: var(--uw-surface); }
body .mud-input-slot, body .mud-input > input.mud-input-root, body .mud-input > textarea.mud-input-root { font-size: 14px; color: var(--uw-text); }
body .mud-input-outlined .mud-input-slot.mud-input-root-outlined { padding: 11px 14px; }
body .mud-input-label { color: var(--uw-text-2); font-weight: 500; }
body .mud-input-label.mud-input-label-outlined.mud-input-label-inputcontrol { color: var(--uw-muted); }
body .mud-input-control > .mud-input-control-input-container > .mud-input-label-outlined.mud-input-label-inputcontrol.mud-input-label-margin-dense { color: var(--uw-muted); }
body .mud-input-helper-text { color: var(--uw-muted); }
body .mud-input-helper-text.mud-input-error { color: var(--uw-danger-ink); }
body .mud-input-outlined.mud-disabled { background: var(--uw-surface-2); }
body .mud-checkbox .mud-button-root, body .mud-switch .mud-button-root { min-height: 0; }
body .mud-select .mud-input-adornment-end .mud-icon-root { color: var(--uw-muted); }
body .mud-picker-container, body .mud-picker-paper { border-radius: var(--uw-r-lg); }
body .mud-picker .mud-button-root { min-height: 0; }
body .mud-picker-calendar-container .mud-button-root { min-height: 0; padding: 0; }
@media (pointer: coarse), (max-width: 700px) { body .mud-input-outlined .mud-input-slot.mud-input-root-outlined { padding-top: 13px; padding-bottom: 13px; } body .mud-input { font-size: 16px; } body .mud-input-slot, body .mud-input > input.mud-input-root { font-size: 16px; } }

/* ---------- surfaces ---------- */
body .mud-paper { border-radius: var(--uw-r-lg); }
body .mud-paper-outlined { border: 1px solid var(--uw-border); }
body .mud-paper.mud-elevation-1, body .mud-paper.mud-elevation-2 { box-shadow: var(--uw-shadow-sm); }
body .mud-paper.mud-elevation-3, body .mud-paper.mud-elevation-4, body .mud-paper.mud-elevation-5, body .mud-paper.mud-elevation-6 { box-shadow: var(--uw-shadow-md); }
body .mud-card { border-radius: var(--uw-r-lg); border: 1px solid var(--uw-border); box-shadow: var(--uw-shadow-sm); background: var(--uw-surface); }
body .mud-card.mud-elevation-0 { box-shadow: none; }
body .mud-card-header { padding: 16px 20px; }
body .mud-card-content { padding: 16px 20px; }
body .mud-card-actions { padding: 12px 20px; }
body .mud-divider { border-color: var(--uw-border); }
body .mud-alert { border-radius: var(--uw-r-md); font-size: 14px; }
body .mud-alert-text-info { background: var(--uw-sky-bg); color: var(--uw-sky-ink); }
body .mud-alert-text-success { background: var(--uw-success-bg); color: var(--uw-success-ink); }
body .mud-alert-text-warning { background: var(--uw-warning-bg); color: var(--uw-warning-ink); }
body .mud-alert-text-error { background: var(--uw-danger-bg); color: var(--uw-danger-ink); }
body .mud-alert-outlined { background: var(--uw-surface); }
/* Filled alerts (not snackbars) use the kit tints, never the saturated Mud colours. */
body .mud-alert.mud-alert-filled-info:not(.mud-snackbar) { background: var(--uw-sky-bg); color: var(--uw-sky-ink); }
body .mud-alert.mud-alert-filled-success:not(.mud-snackbar) { background: var(--uw-success-bg); color: var(--uw-success-ink); }
body .mud-alert.mud-alert-filled-warning:not(.mud-snackbar) { background: var(--uw-warning-bg); color: var(--uw-warning-ink); }
body .mud-alert.mud-alert-filled-error:not(.mud-snackbar) { background: var(--uw-danger-bg); color: var(--uw-danger-ink); }
body .mud-alert-filled:not(.mud-snackbar) .mud-alert-icon, body .mud-alert-filled:not(.mud-snackbar) .mud-alert-close .mud-icon-button { color: inherit; }

/* ---------- tables + data grid ---------- */
body .mud-table { background: transparent; }
body .mud-table-container { background: var(--uw-surface); border: 1px solid var(--uw-border); border-radius: var(--uw-r-lg); margin-top: 12px; overflow: auto; -webkit-overflow-scrolling: touch; }
body .mud-table-container table.mud-table-root { border: 0; }
body .mud-table-head .mud-table-cell, body .mud-table-head th, body .mud-data-grid th.mud-table-cell { text-transform: none !important; letter-spacing: 0 !important; font-size: 12px !important; line-height: 1.4; font-weight: 700 !important; color: var(--uw-text-2) !important; background-color: var(--uw-surface-2) !important; border-bottom: 1px solid var(--uw-border); }
/* Sortable and plain headers share one size and weight (the plain ones used to inherit 14.9px). */
body .mud-data-grid th.mud-table-cell .column-header, body .mud-data-grid th.mud-table-cell .column-header p.mud-typography, body .mud-table-head th .mud-table-sort-label { font-size: 12px !important; font-weight: 700 !important; line-height: 1.4; letter-spacing: 0; }
body .mud-table-container table.mud-table-root thead.mud-table-head { background: var(--uw-surface-2); }
body .mud-data-grid .mud-table-cell, body .mud-table .mud-table-cell { padding: 12px 16px !important; border-bottom: 1px solid var(--uw-surface-2); color: var(--uw-text); font-size: 14px; }
body .mud-table-dense .mud-table-cell, body .mud-table-dense.mud-data-grid .mud-table-cell { padding: 8px 12px !important; font-size: 13px; }
body .mud-table-body .mud-table-row:last-child .mud-table-cell { border-bottom: 0; }
body .mud-table-hover .mud-table-body .mud-table-row:hover, body .mud-table-body .mud-table-row:hover { background-color: var(--uw-bg); }
body .mud-table-body .mud-table-row.mud-table-row-selected, body .mud-table-body .mud-table-row.selected { background-color: var(--uw-primary-tint); }
body .mud-table-sticky-header .mud-table-root .mud-table-head .mud-table-cell { position: sticky; top: 0; z-index: 2; }
body .mud-table-pagination-toolbar, body .mud-table-pager { background: var(--uw-surface); border: 1px solid var(--uw-border); border-radius: var(--uw-r-lg); margin-top: 8px; color: var(--uw-text-2); }
body .mud-table-toolbar { padding: 0 !important; }
body .mud-simple-table { border-radius: var(--uw-r-lg); border: 1px solid var(--uw-border); background: var(--uw-surface); overflow: hidden; }
body .mud-sort-icon, body .mud-table-sort-label { color: var(--uw-muted); }

/* ---------- chips ---------- */
body .mud-chip { font-family: var(--uw-font); border-radius: var(--uw-r-pill); height: 26px; font-size: 12px; }
body .mud-chip > .mud-chip-content { font-weight: 600; letter-spacing: 0; }
body .mud-chip.mud-chip-filled.mud-chip-color-default { background: var(--uw-surface-2); color: var(--uw-text-2); }
body .mud-chip.mud-chip-filled.mud-chip-color-primary { background: var(--uw-primary-tint); color: var(--uw-primary); }
body .mud-chip.mud-chip-filled.mud-chip-color-success { background: var(--uw-success-bg); color: var(--uw-success-ink); }
body .mud-chip.mud-chip-filled.mud-chip-color-error { background: var(--uw-danger-bg); color: var(--uw-danger-ink); }
body .mud-chip.mud-chip-filled.mud-chip-color-warning { background: var(--uw-warning-bg); color: var(--uw-warning-ink); }
body .mud-chip.mud-chip-filled.mud-chip-color-info { background: var(--uw-sky-bg); color: var(--uw-sky-ink); }
body .mud-chip.mud-chip-filled.mud-chip-color-secondary { background: var(--uw-surface-2); color: var(--uw-text); }
body .mud-chip.mud-chip-filled.mud-chip-color-tertiary { background: var(--uw-indigo-bg); color: var(--uw-indigo-ink); }
body .mud-chip.mud-chip-outlined { background: transparent; border-color: var(--uw-border-strong); color: var(--uw-text-2); }
body .mud-chip.mud-chip-size-small { height: 22px; font-size: 11px; }
/* legacy status classes from app.css, moved to the new tones */
body .status-chip { border-radius: var(--uw-r-pill) !important; height: 24px !important; font-weight: 700 !important; font-size: 12px !important; padding: 0 10px !important; }
body .status-active { background-color: var(--uw-success-bg) !important; color: var(--uw-success-ink) !important; }
body .status-warning { background-color: var(--uw-orange-bg) !important; color: var(--uw-orange-ink) !important; }
body .status-error { background-color: var(--uw-danger-bg) !important; color: var(--uw-danger-ink) !important; }
body .status-info { background-color: var(--uw-sky-bg) !important; color: var(--uw-sky-ink) !important; }
body .status-violet { background-color: var(--uw-indigo-bg) !important; color: var(--uw-indigo-ink) !important; }
body .status-default { background-color: var(--uw-surface-2) !important; color: var(--uw-text-2) !important; }

/* ---------- tabs ---------- */
body .mud-tabs-tabbar { background: transparent; }
body .mud-tabs-tabbar-content { border-bottom: 1px solid var(--uw-border); }
body .mud-tab { font-family: var(--uw-font); text-transform: none !important; font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--uw-muted); padding: 10px 18px; min-height: 44px; border-radius: 0; opacity: 1; }
body .mud-tab:hover { color: var(--uw-text); background: transparent; }
body .mud-tab:not(.mud-tab-active):hover { color: var(--uw-text) !important; }
body .mud-tab.mud-tab-active { color: var(--uw-primary); }
body .mud-tab-slider { background-color: var(--uw-primary); height: 3px; border-radius: 3px 3px 0 0; }
body .mud-tabs-scroll-button { color: var(--uw-muted); }

/* ---------- dialogs, popovers, menus, snackbars ---------- */
body .mud-overlay-dialog .mud-overlay-scrim, body .mud-overlay-scrim { background-color: var(--uw-scrim); }
body .mud-dialog { border-radius: var(--uw-r-xl); box-shadow: var(--uw-shadow-modal); border: 0; }
body .mud-dialog-fullscreen { border-radius: 0; }
body .mud-dialog .mud-dialog-title { padding: 20px 24px 12px; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
body .mud-dialog .mud-dialog-title .mud-typography-h6 { font-size: 18px; font-weight: 700; }
body .mud-dialog .mud-dialog-content { padding: 4px 24px 16px; font-size: 14px; color: var(--uw-text-2); }
body .mud-dialog .mud-dialog-actions { padding: 12px 24px 20px; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) { body .mud-dialog:not(.mud-dialog-fullscreen) { width: calc(100vw - 24px); max-width: none; margin: 12px; max-height: calc(100dvh - 24px); } body .mud-dialog .mud-dialog-actions .mud-button-root { flex: 1 1 auto; } }
body .mud-popover { border-radius: var(--uw-r-md); box-shadow: var(--uw-shadow-pop); border: 1px solid var(--uw-border); }
body .mud-popover .mud-list-item { font-size: 14px; min-height: 40px; }
body .mud-list-item:hover { background: var(--uw-surface-2); }
body .mud-list-item.mud-selected-item { background: var(--uw-primary-tint); color: var(--uw-primary); }
body .mud-menu-list { padding: 6px; }
body .mud-menu-list .mud-menu-item { border-radius: var(--uw-r-sm); }
body .mud-tooltip { background: var(--uw-text); color: #fff; font-size: 12px; font-weight: 500; border-radius: var(--uw-r-sm); padding: 6px 10px; }
body .mud-snackbar { border-radius: var(--uw-r-md); box-shadow: var(--uw-shadow-pop); font-family: var(--uw-font); font-size: 14px; }
body .mud-snackbar.mud-alert-filled-success { background: var(--uw-success); }
body .mud-snackbar.mud-alert-filled-error { background: var(--uw-danger); }
body .mud-snackbar.mud-alert-filled-info { background: var(--uw-text); }
body .mud-snackbar.mud-alert-filled-warning { background: var(--uw-warning-ink); }
body .mud-progress-linear { border-radius: 4px; }
body .mud-skeleton { background: var(--uw-surface-2); }
body .mud-expand-panel { border-radius: var(--uw-r-lg); }
body .mud-checkbox .mud-icon-root, body .mud-radio .mud-icon-root { color: var(--uw-faint); }
body .mud-checkbox .mud-checked .mud-icon-root, body .mud-radio .mud-checked .mud-icon-root, body .mud-checkbox .mud-primary-text .mud-icon-root { color: var(--uw-primary); }

/* ---------- Radzen (Html editor, dialog, notification, context menu, tooltip) ---------- */
:root {
    --rz-primary: var(--uw-primary);
    --rz-primary-light: #4f6fe0;
    --rz-primary-lighter: var(--uw-primary-tint);
    --rz-primary-dark: var(--uw-primary-hover);
    --rz-secondary: var(--uw-text-2);
    --rz-success: var(--uw-success);
    --rz-danger: var(--uw-danger);
    --rz-warning: var(--uw-warning);
    --rz-info: var(--uw-sky);
    --rz-text-font-family: var(--uw-font);
    --rz-base-background-color: var(--uw-bg);
    --rz-border-radius: 10px;
    --rz-input-border: 1px solid var(--uw-border-strong);
    --rz-input-focus-border: 1px solid var(--uw-primary);
    --rz-dialog-border-radius: 18px;
}
.rz-dialog { border-radius: var(--uw-r-xl) !important; box-shadow: var(--uw-shadow-modal) !important; border: 0 !important; font-family: var(--uw-font); }
.rz-dialog-titlebar { padding: 18px 24px !important; border-bottom: 1px solid var(--uw-border); }
.rz-dialog-title { font-size: 18px !important; font-weight: 700 !important; color: var(--uw-text); }
.rz-dialog-content { padding: 20px 24px !important; }
.rz-dialog-mask { background-color: var(--uw-scrim) !important; }
.rz-dialog-wrapper { font-family: var(--uw-font); }
.rz-notification-item, .rz-growl-item-container .rz-growl-item { border-radius: var(--uw-r-md) !important; box-shadow: var(--uw-shadow-pop) !important; font-family: var(--uw-font); }
.rz-menu, .rz-contextmenu, .rz-context-menu { border-radius: var(--uw-r-md) !important; box-shadow: var(--uw-shadow-pop) !important; border: 1px solid var(--uw-border) !important; }
.rz-tooltip-content { background: var(--uw-text) !important; color: #fff !important; border-radius: var(--uw-r-sm) !important; font-size: 12px !important; font-family: var(--uw-font); }
.rz-html-editor { border: 1px solid var(--uw-border-strong) !important; border-radius: var(--uw-r-md) !important; overflow: hidden; font-family: var(--uw-font); }
.rz-html-editor-content { font-family: var(--uw-font); font-size: 14px; color: var(--uw-text); }
.rz-html-editor .rz-html-editor-toolbar, .rz-html-editor-toolbar { background: var(--uw-bg) !important; border-bottom: 1px solid var(--uw-border) !important; }
.rz-button { border-radius: var(--uw-r-md) !important; font-family: var(--uw-font); font-weight: 600; text-transform: none !important; letter-spacing: 0; box-shadow: none; }
.rz-button.rz-primary { background: var(--uw-primary) !important; color: #fff !important; }
.rz-button.rz-primary:hover { background: var(--uw-primary-hover) !important; }
.rz-textbox, .rz-dropdown, .rz-numeric, .rz-datepicker input { border-radius: var(--uw-r-md) !important; border-color: var(--uw-border-strong) !important; font-family: var(--uw-font); }
.rz-textbox:focus, .rz-dropdown:focus-within { border-color: var(--uw-primary) !important; box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12) !important; }
.rz-chkbox-box { border-radius: 5px !important; }
.rz-chkbox-box.rz-state-active, .rz-chkbox-box.rz-state-checked { background: var(--uw-primary) !important; border-color: var(--uw-primary) !important; }
.rz-tabview-nav li.rz-tabview-selected a, .rz-tabview-selected .rz-tabview-title { color: var(--uw-primary) !important; }

/* Tabs (legacy tab-panel-style-02): the kit's segmented look everywhere. Sentence case, weight 600, dark active pill on a soft track.
   app.css styles these with !important, so these rules repeat its selectors with an extra html prefix. */
html body .tab-panel-style-02 .mud-tabs-toolbar,
html body .tab-panel-style-02 .mud-tabs-tabbar { display: inline-flex; padding: 3px !important; gap: 2px; background: var(--uw-surface-2) !important; border: 0 !important; border-radius: var(--uw-r-md) !important; box-shadow: none; }
html body .mud-tabs.mud-tabs-rounded.tab-panel-style-02 .mud-tabs-tabbar .mud-tab,
html body .mud-tabs.tab-panel-style-02 .mud-tabs-tabbar .mud-tab,
html body .mud-tabs.tab-panel-style-02 .mud-tabs-toolbar .mud-tab,
html body .tab-panel-style-02 .mud-tabs-tabbar .mud-tab,
html body .tab-panel-style-02 .mud-tabs-toolbar .mud-tab { min-height: 34px !important; padding: 0 16px !important; border-radius: 8px !important; font-size: 13px !important; line-height: 1.3 !important; font-weight: 600 !important; letter-spacing: 0 !important; text-transform: none !important; color: var(--uw-text-2) !important; opacity: 1 !important; }
html body .tab-panel-style-02 .mud-tabs-tabbar .mud-tab:hover,
html body .tab-panel-style-02 .mud-tabs-toolbar .mud-tab:hover { color: var(--uw-text) !important; }
html body .mud-tabs.mud-tabs-rounded.tab-panel-style-02 .mud-tabs-tabbar .mud-tab.mud-tab-active,
html body .mud-tabs.tab-panel-style-02 .mud-tabs-tabbar .mud-tab.mud-tab-active,
html body .mud-tabs.tab-panel-style-02 .mud-tabs-toolbar .mud-tab.mud-tab-active,
html body .tab-panel-style-02 .mud-tabs-tabbar .mud-tab.mud-tab-active,
html body .tab-panel-style-02 .mud-tabs-toolbar .mud-tab.mud-tab-active { background: var(--uw-text) !important; color: #fff !important; box-shadow: var(--uw-shadow-sm); }
html body .tab-panel-style-02 .mud-tab-slider { display: none !important; }
@media (pointer: coarse), (max-width: 700px) { html body .tab-panel-style-02 .mud-tabs-tabbar .mud-tab { min-height: 40px !important; } }

/* ---------- phones (mobile pack 1) ----------
   Side drawers: several set a fixed Width (560-700px) that pushed their left half off a phone screen. MudBlazor puts the
   width in an inline custom property, so !important is needed to win. */
@media (max-width: 767px) {
    body .mud-drawer.mud-drawer-temporary.custom-modal-style-01 { --mud-drawer-width: 100vw !important; width: 100vw !important; max-width: 100vw !important; }
}
/* iOS Safari zooms the page when a focused field's text is under 16px, and doesn't zoom back out. */
@media (pointer: coarse), (max-width: 700px) {
    body input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), body select, body textarea { font-size: 16px !important; }
}
/* Stand-alone links (back links, breadcrumbs, tile links) get a finger-sized target on phones. Not links inside sentences. */
@media (max-width: 700px) {
    body .mud-breadcrumbs a, body .today-tile__link, body .order-back, body .uw-top__back, body .intake-back-link { display: inline-flex; align-items: center; min-height: 40px; }
}

/* ---------- phone: compact list cards for MudBlazor grids that are not inside UwListGrid (settings lists) ----------
   MudBlazor turns every row into a stacked label/value card under 600px. Make it a small two-column card: label above value,
   first cell full width, a row-actions menu floating top right, low-value columns hidden, one-line pager without rows-per-page.
   UwListGrid (Components/Shared/ListComponents) does the same for its own grids up to 700px. "uw-hide-xs" on a column's
   CellClass hides that column on phones. */
@media (max-width: 600px) {
    body .mud-xs-table .mud-table-body .mud-table-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: row dense; column-gap: 4px; margin: 4px 8px; padding: 3px 6px; position: relative; background: var(--uw-surface); border: 1px solid var(--uw-border); border-radius: var(--uw-r-lg); box-shadow: var(--uw-shadow-sm); }
    body .mud-xs-table .mud-table-body .mud-table-cell { display: block; grid-column: span 3; padding: 2px 4px !important; border: 0 !important; text-align: left !important; font-size: 13px; line-height: 1.3; min-width: 0; }
    body .mud-xs-table .mud-table-body .mud-table-cell > * { text-align: left !important; overflow-wrap: break-word; }
    body .mud-xs-table .mud-table-body .mud-table-cell::before { display: block; max-width: none; margin: 0 0 1px; padding: 0; font-size: 11px; font-weight: 600; line-height: 1.3; color: var(--uw-muted); text-align: left; }
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Date" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Qty" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Quantity" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Total" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Days" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Days in status" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Days in Status" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Stage" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Status" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Role" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Sizes" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Waiting" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Method" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Deposit" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Submitted" i],
    body .mud-xs-table .mud-table-body .mud-table-cell[data-label="Phone" i] { grid-column: span 2; }
    body .mud-xs-table .mud-table-body .mud-table-cell:first-child { grid-column: 1 / -1; }
    body .mud-xs-table .mud-table-body .mud-table-cell:first-child::before { display: none; }
    /* Action cells: a row-actions menu floats top right; any other button cell gets a line of its own. */
    body .mud-xs-table .mud-table-body .mud-table-cell:is([data-label="Actions" i], [data-label="Action" i], :has(.uw-rowactions), :last-child:has(.mud-button-root)) { grid-column: 1 / -1; display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px !important; }
    body .mud-xs-table .mud-table-body .mud-table-cell:is([data-label="Actions" i], [data-label="Action" i], :has(.uw-rowactions), :last-child:has(.mud-button-root))::before { display: none; }
    body .mud-xs-table .mud-table-body .mud-table-cell:last-child:has(.uw-rowactions) { position: absolute; top: 4px; right: 4px; padding: 0 !important; width: auto; }
    body .mud-xs-table .mud-table-body .mud-table-row:has(.mud-table-cell:last-child .uw-rowactions) .mud-table-cell:first-child { padding-right: 112px !important; }
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Created" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Created at" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Updated" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Updated at" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Last updated" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="Default" i],
    body .settings-shell .mud-xs-table .mud-table-body .mud-table-cell[data-label="WhatsApp" i],
    body .mud-xs-table .mud-table-body .mud-table-cell.uw-hide-xs { display: none; }
    body .mud-xs-table .mud-table-container { border: 0; background: transparent; }
    body .mud-xs-table .mud-table-pagination-toolbar { flex-wrap: nowrap !important; height: 44px !important; min-height: 0 !important; padding: 0 4px !important; justify-content: space-between; }
    body .mud-xs-table .mud-table-pagination-spacer,
    body .mud-xs-table .mud-table-pagination-toolbar .mud-select,
    body .mud-xs-table .mud-table-pagination-select,
    body .mud-xs-table .mud-table-pagination-caption:first-of-type { display: none !important; }
    body .mud-xs-table .mud-table-pagination-information { margin: 0 auto 0 8px; font-size: 13px; }
    body .mud-xs-table .mud-table-pagination-actions { margin-left: 0; margin-right: 0; }
    body .mud-xs-table .mud-table-pagination .mud-table-pagination-actions .mud-button-root:first-child,
    body .mud-xs-table .mud-table-pagination .mud-table-pagination-actions .mud-button-root:last-child { display: inline-flex; }
}

/* ---------- phone: grid toolbars (search + Update Order + Add) wrap; search gets its own full-width row ---------- */
@media (max-width: 700px) {
    body .mud-data-grid .mud-toolbar, body .mud-table .mud-toolbar, body .mud-table-toolbar { flex-wrap: wrap; height: auto; min-height: 0; row-gap: 8px; padding-top: 8px; padding-bottom: 8px; }
    body .mud-data-grid .mud-toolbar .tbl-search, body .mud-table .mud-toolbar .tbl-search { flex: 1 1 100%; width: 100%; max-width: none; margin-right: 0 !important; }
    body .mud-data-grid .mud-toolbar > div:not(.mud-input-control):not(.mud-toolbar-spacer),
    body .mud-table .mud-toolbar > div:not(.mud-input-control):not(.mud-toolbar-spacer) { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; }
    body .mud-data-grid .mud-toolbar .mud-button-root, body .mud-table .mud-toolbar .mud-button-root { margin-right: 0 !important; }
}

/* ---------- phone: filter/search inputs with a fixed inline max-width fill the row ---------- */
@media (max-width: 700px) {
    body .tbl-search { max-width: none; }
    body .uw-content .mud-input-control[style*="max-width"] { max-width: none !important; width: 100%; }
}
