:root {
    --app-font-sans: "Open Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

:root {
    --app-bg: #f4f7fb;
    --app-surface-bg: #ffffff;
    --app-surface-border: #dbe4f0;
    --app-text: #172033;
    --app-muted: #66758f;
    --app-success: #2e7d32;
    --app-warning: #ed8f03;
    --app-danger: #d32f2f;
    --app-spacing-1: 8px;
    --app-spacing-2: 16px;
    --app-spacing-3: 24px;
    --app-spacing-4: 32px;
    --app-space-1: 4px;
    --app-space-2: 8px;
    --app-space-3: 12px;
    --app-space-4: 16px;
    --app-radius-sm: 8px;
    --app-radius-md: 10px;
    --app-radius-lg: 12px;
    --app-primary-soft: rgba(25, 118, 210, 0.1);
    --app-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --app-shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --app-list-head-bg: linear-gradient(180deg, #f8fbff, #eef4fb);
    --app-list-head-border: #d7e2ef;
    --app-list-row-hover: rgba(25, 118, 210, 0.06);
    --app-list-row-alt: rgba(15, 23, 42, 0.015);
    --app-control-height: 34px;
    --app-control-height-sm: 30px;
    --app-card-header-bg: linear-gradient(180deg, #fcfdff, #f4f8ff);
    --app-card-border-strong: #d2deee;
}

/* Remove MudBlazor's default top/bottom padding on the main content area */
.mud-main-content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Login card: override MudBlazor's internal mud-card-content-padding */
.login-card .mud-card-content-padding {
    padding: 2.75rem 2.5rem !important;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: var(--app-font-sans);
    font-size: 11px;
    line-height: 1.43;
    background: radial-gradient(circle at top, #fbfdff 0%, var(--app-bg) 30%, #eef3f9 100%);
    color: var(--app-text);
}

/* Keep login page at full visual scale; app-wide compact font-size should not shrink it */
html:has(.login-shell),
body:has(.login-shell) {
    font-size: 16px;
}

body {
    min-height: 100vh;
}

    body .mud-layout {
        min-height: 100vh;
    }

a {
    color: inherit;
}

.content {
    padding-top: var(--app-spacing-3);
    padding-inline: 4px;
}

body ::selection {
    background: rgba(25, 118, 210, 0.18);
}

h1:focus {
    outline: none;
}

body .mud-typography.mud-typography-h4,
body .mud-typography.mud-typography-h5,
body .mud-typography.mud-typography-h6 {
    line-height: 1.4;
}

body .mud-typography.mud-typography-h4 {
    font-size: 14px;
    font-weight: 600;
}

body .mud-typography.mud-typography-h5,
body .mud-typography.mud-typography-h6 {
    font-size: 13px;
    font-weight: 600;
}

body .mud-typography.mud-typography-subtitle1,
body .mud-typography.mud-typography-subtitle2,
body .mud-typography.mud-typography-body1 {
    font-size: 10px;
    line-height: 1.43;
}

body .mud-input-label,
body .mud-input > input,
body .mud-select-input,
body .mud-input-slot,
body .mud-list-item-text,
body .mud-button-label {
    font-family: var(--app-font-sans);
}

.page-enter {
    animation: fade-slide-in 200ms ease-out forwards;
}

.app-surface {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 251, 255, 0.98));
    border: 1px solid var(--app-surface-border);
    border-radius: 18px;
    box-shadow: var(--app-shadow-sm), var(--app-shadow-md);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.app-filter-table-divider {
    height: 1px;
    margin: 0;
    background: #dbe4f0;
}

    .app-surface:hover {
        border-color: #c9d7ea;
        box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04), 0 14px 36px rgba(15, 23, 42, 0.08);
    }

.app-page-title {
    margin-bottom: 2px;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0;
}

.app-page-subtitle {
    color: var(--app-muted);
    margin-bottom: var(--app-spacing-3);
    font-size: 10px;
    line-height: 1.4;
}

.app-page-header {
    gap: 1rem;
    flex-wrap: wrap;
}

.app-page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: flex-end;
}

.app-page-loader {
    width: 100%;
}

.material-appbar {
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border-bottom: 1px solid #e2e8f0;
    backdrop-filter: blur(14px);
}

/* Compact nav sidebar items */
body .mud-nav-link {
    font-size: 10.5px !important;
    min-height: 26px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body .mud-nav-group .mud-nav-link {
    font-size: 10px !important;
    min-height: 24px !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

body .mud-nav-group-title {
    font-size: 10.5px !important;
    min-height: 26px !important;
    white-space: nowrap !important;
}

body .mud-nav-link .mud-nav-link-text {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
}

.nav-brand .mud-typography {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.nav-brand__title {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: #2563eb !important;
}

.material-appbar-search {
    max-width: 280px;
}

.material-appbar-search .mud-input-slot {
        background: #f8fafc;
        border-radius: 999px;
    }

.material-avatar {
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

body .mud-button-root {
    border-radius: 5px;
    min-height: var(--app-control-height-sm);
    padding-inline: 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

    body .mud-button-root:hover {
        transform: none;
    }

body .mud-button-filled {
    box-shadow: 0 8px 18px rgba(25, 118, 210, 0.18);
}

body .app-btn-primary,
body .mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 8px 18px rgba(25, 118, 210, 0.18);
}

body .app-btn-primary,
body .mud-button-filled.mud-button-filled-primary {
    box-shadow: 0 8px 18px rgba(25, 118, 210, 0.18);
}

body .app-btn {
    border-radius: 5px !important;
}

body .app-btn-sm {
    min-height: var(--app-control-height-sm);
    padding-inline: 10px !important;
}

body .app-btn-primary {
    border-radius: 5px !important;
}

body .app-btn-icon .mud-button-label {
    gap: 6px;
}

.app-section-card {
    overflow: hidden;
}

.app-section-card__header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--app-card-border-strong);
    background: var(--app-card-header-bg);
}

.app-section-card__title {
    margin: 0;
}

.app-section-card__actions {
    display: flex;
    align-items: center;
    gap: var(--app-space-2);
    flex-wrap: wrap;
}

.app-section-card__body {
    padding: 2px;
}

.app-section-card__body--no-padding {
    padding: 0;
}

.app-section-card__body--fill {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

body .app-btn-secondary,
body .mud-button-outlined {
    box-shadow: none;
}

body .app-btn-danger,
body .mud-button-filled.mud-button-filled-error {
    box-shadow: 0 8px 18px rgba(211, 47, 47, 0.22);
}

body .mud-input-control > .mud-input-control-input-container > .mud-input-slot {
    border-radius: 8px;
    min-height: 27px;
    transition: box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

body .mud-input-label,
body .mud-input-control .mud-input-label,
body .mud-picker-input-control .mud-input-label {
    font-size: 10px;
    font-weight: 500;
}

body .mud-input-helper-text {
    font-size: 10px;
    line-height: 1.4;
}

body .mud-input-error,
body .mud-input-helper-text.mud-input-error {
    color: var(--app-danger) !important;
}

body .mud-input-control .mud-input-slot:focus-within,
body .mud-picker-input-control .mud-input-slot:focus-within {
    box-shadow: 0 0 0 4px var(--app-primary-soft);
}

/* Remove focus halo for searchable boxes (autocomplete/select search UI). */
body .mud-autocomplete .mud-input-slot:focus-within,
body .mud-select .mud-input-slot:focus-within,
body .mud-select-input .mud-input-slot:focus-within {
    box-shadow: none !important;
}

body .mud-paper {
    border-radius: var(--app-radius-lg);
}

body .mud-table-root .mud-table-container table thead th,
body .mud-table-root .mud-table-container table tbody td {
    border-color: #e2e8f0;
}

body .mud-table-root .mud-table-container,
body .mud-datagrid .mud-table-container {
    border-radius: 14px;
}

/* Professional modern list header + sticky header while list scrolls */
body .mud-table-root .mud-table-container table thead th,
body .mud-table-root .mud-table-head .mud-table-cell,
body .mud-datagrid .mud-table-container table thead th,
body .mud-datagrid .mud-table-head .mud-table-cell {
    position: sticky;
    top: 0;
    z-index: 4;
    background: var(--app-list-head-bg);
    color: #1f2a3d;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: inset 0 -1px 0 var(--app-list-head-border);
    font-size: 10.5px;
    line-height: 1.4;
}

/* Rich list rows */
body .mud-table-root .mud-table-container table tbody td,
body .mud-datagrid .mud-table-container table tbody td {
    padding-top: 0.15rem;
    padding-bottom: 0.15rem;
    background: #fff;
    font-size: 11px;
    line-height: 1.35;
}

.list-table-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.app-viewport-page {
    height: calc(100dvh - 46px);
    min-height: 0;
    overflow: hidden;
}

.app-viewport-page > .list-table-shell,
.app-viewport-page > .users-table-shell,
.app-viewport-page > .userlogs-table-shell {
    flex: 1 1 auto;
    min-height: 0;
}

.list-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    border-radius: inherit;
}

    .list-table-scroll .mud-table-container,
    .list-table-scroll .mud-datagrid .mud-table-container {
        max-height: calc(100vh - 220px);
        overflow: auto;
    }

/* Compact pager row ("Rows per page") across table/list pages */
body .mud-table-pagination,
body .mud-data-grid-pager {
    padding: 2px 6px !important;
    min-height: 28px;
    overflow: visible;
    position: relative;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 11px;
}

body .mud-table-pagination .mud-toolbar,
body .mud-data-grid-pager .mud-toolbar {
    min-height: 26px !important;
    height: 28px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    align-items: center !important;
    font-size: 11px !important;
}

/* MudBlazor sets this toolbar to 52px in component CSS; force compact height */
body .mud-table-pagination .mud-table-pagination-toolbar,
body .mud-table-pagination-toolbar {
    min-height: 28px !important;
    height: 28px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

body .mud-table-pagination .mud-select,
body .mud-table-pagination .mud-input-slot {
    font-size: 11px !important;
    min-height: 22px !important;
}

body .mud-table-pagination-select .mud-input .mud-input-root {
    line-height: 3.43 !important;
}

body .mud-table-pagination p,
body .mud-table-pagination span {
    font-size: 11px !important;
}

/* Dense list-view tables for key modules */
.repair-jobs-table .mud-table-cell,
.workorders-list-table .mud-table-cell,
.inventory-list-table .mud-table-cell,
.invoice-list-table .mud-table-cell,
.ssr-list-table .mud-table-cell,
.customers-grid .mud-table-cell,
.subcustomers-grid .mud-table-cell {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    font-size: 11px;
    line-height: 1.3;
}

.repair-jobs-table .mud-table-head .mud-table-cell,
.workorders-list-table .mud-table-head .mud-table-cell,
.inventory-list-table .mud-table-head .mud-table-cell,
.invoice-list-table .mud-table-head .mud-table-cell,
.customers-grid .mud-table-head .mud-table-cell,
.subcustomers-grid .mud-table-head .mud-table-cell {
    padding-top: 3px !important;
    padding-bottom: 3px !important;
    font-size: 10.5px;
}

body .mud-table-root .mud-table-container table tbody tr:nth-child(even) td,
body .mud-datagrid .mud-table-container table tbody tr:nth-child(even) td {
    background: var(--app-list-row-alt);
}

body .mud-chip {
    border-radius: 999px;
    height: 20px !important;
    font-size: 10px !important;
    padding: 0 7px !important;
}

body .mud-chip .mud-chip-content {
    font-size: 10px !important;
    padding: 0 !important;
}

body .mud-chip .mud-chip-label {
    font-size: 10px !important;
    line-height: 1 !important;
}

.app-filter-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: stretch;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: thin;
}

.app-filter-row-compact {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: end;
    overflow-x: auto;
    padding-bottom: 0;
    scrollbar-width: thin;
}

.app-filter-cell {
    min-width: 0;
    flex: 1 1 140px;
    display: flex;
    align-items: stretch;
}

.app-filter-cell-compact {
    min-width: 0;
    flex: 1 1 120px;
    display: flex;
    align-items: end;
}

.app-filter-cell > * {
    width: 100%;
}

.app-filter-cell-compact > * {
    width: 100%;
}

.app-filter-search {
    flex: 2.2 1 200px;
}

.app-filter-action {
    flex: 0 0 130px;
    display: flex;
    align-items: stretch;
}

.app-filter-action-compact {
    flex: 0 0 110px;
    display: flex;
    align-items: end;
}

.app-filter-action .mud-button-root {
    width: 100%;
    min-height: 30px;
    height: 30px;
}

.app-filter-action-compact .mud-button-root {
    width: 100%;
    min-height: 27px;
    height: 27px;
}

.workorder-filter-break {
    flex-basis: 100%;
    height: 0;
}

.workorder-filter-date {
    flex: 1 1 220px;
}

.workorder-filter-action {
    align-self: flex-end;
}

    .workorder-filter-action .mud-button-root {
        min-height: 56px;
        height: 56px;
    }

/* Work Orders filter row — also used by Dashboard Engineer field */
.wo-filter-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.wo-filter-search { flex: 2 1 0;   min-width: 0; }
.wo-filter-cell   { flex: 1.5 1 0; min-width: 0; }
.wo-filter-date   { flex: 0.9 1 0; min-width: 0; }
.wo-filter-action { flex: 0 0 130px; }

body .mud-grid .mud-input-control,
body .mud-grid .mud-picker,
body .mud-grid .mud-select,
body .mud-grid .mud-autocomplete {
    width: 100%;
}

.app-form-actions {
    gap: var(--app-spacing-1);
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding-top: 0.75rem;
}

    .app-form-actions .mud-button-root {
        min-width: 132px;
    }

.workorder-form-footer {
    margin-bottom: 1rem;
}

.app-section-header {
    gap: var(--app-spacing-2);
    flex-wrap: wrap;
}

body .mud-card-content > .mud-grid,
body .mud-card-content > .mud-stack > .mud-grid {
    align-items: stretch;
}

body .mud-alert {
    border-radius: 14px;
}

body .mud-dialog .mud-dialog-content {
    padding-top: 12px;
    padding-bottom: 12px;
}

body .mud-dialog-actions {
    padding: 12px 20px 16px;
    gap: 8px;
}

body .mud-table-root .mud-table-container table tbody tr,
body .mud-datagrid .mud-table-container table tbody tr {
    transition: background-color 150ms ease, transform 150ms ease;
}

body .mud-table-root .mud-table-container table tbody tr:hover,
body .mud-datagrid .mud-table-container table tbody tr:hover {
        background-color: var(--app-list-row-hover);
        transition: background-color 120ms ease;
    }

body .mud-table-root .mud-table-container table tbody td.text-end,
body .mud-datagrid .mud-table-container table tbody td.text-end {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Keep numeric amount columns visually strong in list views */
.invoice-list-table .invoice-col-amount,
.repair-jobs-table td.text-end,
.workorders-list-table td.text-end,
.customers-grid td.text-end,
.subcustomers-grid td.text-end {
    font-weight: 700 !important;
}

body .mud-table-root .mud-table-container table tbody td.text-start,
body .mud-datagrid .mud-table-container table tbody td.text-start {
    text-align: left;
}

body .mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(180deg, #2d86db 0%, #1f73c7 100%);
}

body .mud-button-filled.mud-button-filled-error {
    background: linear-gradient(180deg, #e24b4b 0%, #cf2f2f 100%);
}

body .mud-button-outlined {
    border-width: 1.5px;
}

body .mud-chip.mud-chip-color-success {
    background-color: var(--app-success) !important;
}

body .mud-chip.mud-chip-color-warning {
    background-color: var(--app-warning);
    color: #1f2937;
}

body .mud-chip.mud-chip-color-error {
    background-color: var(--app-danger) !important;
}

@media (max-width: 1279px) {
    .app-filter-row {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .app-filter-row-compact {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .app-filter-action {
        flex: 1 1 220px;
    }

    .app-filter-action-compact {
        flex: 1 1 180px;
    }
}

@media (max-width: 960px) {
    .app-filter-action {
        flex-basis: 100%;
    }

    .app-filter-action-compact {
        flex-basis: 100%;
    }

    .app-page-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .list-table-scroll .mud-table-container,
    .list-table-scroll .mud-datagrid .mud-table-container {
        max-height: calc(100vh - 330px);
    }

    .app-viewport-page {
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 600px) {
    .content {
        padding-inline: 0;
    }

    .app-filter-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .app-filter-row-compact {
        flex-direction: column;
        gap: 0.5rem;
    }

    .app-filter-cell,
    .app-filter-search,
    .app-filter-action,
    .app-filter-cell-compact,
    .app-filter-action-compact,
    .workorder-filter-date {
        flex: 1 1 auto;
        width: 100%;
    }

    .app-form-actions {
        justify-content: stretch;
    }

        .app-form-actions .mud-button-root,
        .app-page-actions .mud-button-root {
            width: 100%;
        }
}

@keyframes fade-slide-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.mono {
    font-family: 'JetBrains Mono', Consolas, monospace;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* ── Full-width page layout ─────────────────────────────────────── */

.app-full-width-page {
    margin: -0.5rem -0.5rem;
}

@media (min-width: 960px) {
    .app-full-width-page {
        margin: -0.75rem -0.75rem;
    }
}

.app-full-width-content {
    padding: 0.4rem;
    background: var(--mud-palette-background);
}

@media (min-width: 960px) {
    .app-full-width-content {
        padding: 0.5rem;
    }
}

/* ── Invoice list table ─────────────────────────────────────────── */

.invoice-filter-scroll {
    overflow-x: auto;
    scrollbar-width: thin;
}

.invoice-filter-minwidth {
    min-width: 720px;
}

/* ── End invoice list table ─────────────────────────────────────── */

/* ── Customers / SubCustomers grid ──────────────────────────────── */

body .customers-actions-header,
body .subcustomers-actions-header,
body .customers-grid .mud-table-head .mud-table-cell:last-child,
body .subcustomers-grid .mud-table-head .mud-table-cell:last-child {
    text-align: center !important;
}

/* MudDataGrid header cells use an inner flex div — target it directly */
body .customers-actions-header > span,
body .customers-actions-header > div,
body .subcustomers-actions-header > span,
body .subcustomers-actions-header > div,
body .customers-grid .mud-table-head .mud-table-cell:last-child > span,
body .customers-grid .mud-table-head .mud-table-cell:last-child > div,
body .subcustomers-grid .mud-table-head .mud-table-cell:last-child > span,
body .subcustomers-grid .mud-table-head .mud-table-cell:last-child > div {
    justify-content: center !important;
    text-align: center !important;
    width: 100%;
}

body .customers-grid .mud-table-body .mud-table-cell:last-child,
body .subcustomers-grid .mud-table-body .mud-table-cell:last-child {
    text-align: center !important;
}

/* ── End Customers grid ─────────────────────────────────────────── */

/* ── Repair Jobs list table ─────────────────────────────────────── */

.repair-jobs-table {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.repairjobs-table-scroll .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    max-height: none;
    overflow: auto !important;
    scrollbar-width: thin;
}

.repair-jobs-table .mud-table-table {
    min-width: 1000px;
    width: max(100%, 1000px);
}

.repair-jobs-table .mud-table-container thead th,
.repair-jobs-table .mud-table-head .mud-table-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 6;
    background: linear-gradient(180deg, #f8fbff, #eef4fb) !important;
    box-shadow: inset 0 -1px #dbe4f0;
}

/* ── End Repair Jobs list table ─────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════
   LIST PAGE LAYOUT — viewport-fill flex chain for all list pages.
   These rules live here (app.css = static file, no rebuild needed).
   Page <style> blocks keep only cosmetic/filter-specific styles.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Page shell: full viewport height, flex column ───────────── */
.repairjobs-page-shell,
.workorders-page-shell,
.inventory-page-shell,
.customers-page-shell,
.subcustomers-page-shell,
.ssr-page-shell,
.userlogs-page-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 112px);
    min-height: 0;
    overflow: hidden;
}

.reports-page-shell {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 46px);
    min-height: 0;
    overflow: hidden;
    width: 100%;
}

@media (min-width: 961px) {
    .repairjobs-page-shell,
    .workorders-page-shell,
    .inventory-page-shell,
    .customers-page-shell,
    .subcustomers-page-shell,
    .ssr-page-shell,
    .userlogs-page-shell {
        height: calc(100vh - 112px);
    }

    .reports-page-shell {
        height: calc(100dvh - 46px);
    }
}

/* ── 2. Invoice page: uses full-width wrapper instead of page-shell */
.invoice-full-width-page {
    margin: -1rem -0.75rem;
    height: calc(100vh - 112px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 961px) {
    .invoice-full-width-page {
        height: calc(100vh - 112px);
    }
}

.invoice-full-width-content {
    padding: 0.35rem;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.invoice-page-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}


/* ── 3. Top section: sticky filter bar ─────────────────────────── */
.repairjobs-top-section,
.workorders-top-section,
.inventory-top-section,
.customers-top-section,
.subcustomers-top-section,
.invoice-top-section,
.ssr-top-section,
.userlogs-top-section,
.reports-top-section {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--mud-palette-background);
}

/* ── 4. Table shell: flex-grow to fill remaining height ─────────── */
.repairjobs-table-shell,
.workorders-table-shell,
.inventory-table-shell,
.customers-table-shell,
.subcustomers-table-shell,
.ssr-table-shell,
.userlogs-table-shell {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

.reports-table-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    border-radius: inherit;
    width: 100%;
}
/* invoice-table-shell shrinks to content height instead of filling the page */
.invoice-table-shell {
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ── 5. Table scroll wrapper: flex column, overflow hidden ──────── */
.repairjobs-table-scroll,
.workorders-table-scroll,
.inventory-table-scroll,
.customers-table-scroll,
.subcustomers-table-scroll,
.ssr-table-scroll,
.userlogs-table-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

/* invoice-table-scroll: shrinks to content, scrolls when content overflows */
.invoice-table-scroll {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}

/* ── 6. MudTable component root: flex column ────────────────────── */
.repair-jobs-table,
.workorders-list-table,
.inventory-list-table,
.customers-grid,
.subcustomers-grid,
.ssr-list-table,
.userlogs-list-table {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.invoice-list-table {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
}

.app-data-table {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ── 7. mud-table-container: scrollable, fills remaining height ─── */
.repairjobs-table-scroll .mud-table-container,
.workorders-table-scroll .mud-table-container,
.inventory-table-scroll .mud-table-container,
.customers-table-scroll .mud-table-container,
.subcustomers-table-scroll .mud-table-container,
.ssr-table-scroll .mud-table-container,
.userlogs-table-scroll .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-height: none;
    overflow: auto !important;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

/* invoice mud-table-container: shrinks to content, scrolls when overflowing */
.invoice-table-scroll .mud-table-container {
    flex: 0 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-height: 100%;
    overflow: auto !important;
    scrollbar-width: thin;
    overscroll-behavior: contain;
}

.repairjobs-table-scroll {
    min-height: 0;
    overflow: hidden !important;
}

.repairjobs-table-scroll .mud-table-root,
.repairjobs-table-scroll .repair-jobs-table {
    min-height: 0;
    height: 100%;
}

/* invoice table root: auto height so it shrinks to content */
.invoice-table-scroll .mud-table-root,
.invoice-table-scroll .invoice-list-table {
    min-height: 0;
    height: auto;
}

.repair-jobs-table .mud-table-row,
.invoice-list-table .mud-table-row {
    transition: none !important;
}

/* ── 8. Table element: fill container width ─────────────────────── */
.repair-jobs-table .mud-table-table {
    min-width: 1000px;
    width: max(100%, 1000px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.workorders-list-table .mud-table-table {
    min-width: 1000px;
    width: max(100%, 1000px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.inventory-list-table .mud-table-table {
    min-width: 900px;
    width: max(100%, 900px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.invoice-list-table .mud-table-table {
    min-width: 1120px;
    width: max(100%, 1120px);
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
}

.ssr-list-table .mud-table-table {
    min-width: 1080px;
    width: max(100%, 1080px);
    border-collapse: separate;
    border-spacing: 0;
}

/* ── 9. Sticky table header ─────────────────────────────────────── */
.repair-jobs-table .mud-table-container thead th,
.repair-jobs-table .mud-table-head .mud-table-cell,
.workorders-list-table .mud-table-container thead th,
.workorders-list-table .mud-table-head .mud-table-cell,
.inventory-list-table .mud-table-container thead th,
.inventory-list-table .mud-table-head .mud-table-cell,
.invoice-list-table .mud-table-container thead th,
.invoice-list-table .mud-table-head .mud-table-cell,
.ssr-list-table .mud-table-container thead th,
.ssr-list-table .mud-table-head .mud-table-cell,
.userlogs-list-table .mud-table-container thead th,
.userlogs-list-table .mud-table-head .mud-table-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 6;
    background: linear-gradient(180deg, #f8fbff, #eef4fb) !important;
    box-shadow: inset 0 -1px #dbe4f0;
}

/* Extra-specific global sticky rule for invoices list (service + repair) */
.invoice-table-scroll .invoice-list-table .mud-table-container thead th,
.invoice-table-scroll .invoice-list-table .mud-table-head .mud-table-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 8 !important;
}

/* customers uses MudDataGrid */
.customers-grid .mud-table-container thead th,
.customers-grid .mud-table-head .mud-table-cell,
.subcustomers-grid .mud-table-container thead th,
.subcustomers-grid .mud-table-head .mud-table-cell {
    position: sticky !important;
    top: 0 !important;
    z-index: 6;
    background: linear-gradient(180deg, #f8fbff, #eef4fb) !important;
    box-shadow: inset 0 -1px #dbe4f0;
}

/* ── 10. Mobile: revert to natural height ───────────────────────── */
@media (max-width: 960px) {
    .repairjobs-page-shell,
    .workorders-page-shell,
    .inventory-page-shell,
    .customers-page-shell,
    .subcustomers-page-shell,
    .ssr-page-shell,
    .userlogs-page-shell,
    .reports-page-shell {
        height: auto;
        overflow: visible;
    }

    .invoice-full-width-page {
        height: auto;
        overflow: visible;
    }

    .invoice-page-shell {
        height: auto;
        overflow: visible;
    }

    .repairjobs-top-section,
    .workorders-top-section,
    .inventory-top-section,
    .customers-top-section,
    .subcustomers-top-section,
    .invoice-top-section,
    .ssr-top-section,
    .userlogs-top-section {
        position: static;
    }

    .repairjobs-table-scroll .mud-table-container,
    .workorders-table-scroll .mud-table-container,
    .inventory-table-scroll .mud-table-container,
    .customers-table-scroll .mud-table-container,
    .subcustomers-table-scroll .mud-table-container,
    .invoice-table-scroll .mud-table-container,
    .ssr-table-scroll .mud-table-container,
    .userlogs-table-scroll .mud-table-container {
        max-height: none;
        min-width: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   END LIST PAGE LAYOUT
   ═══════════════════════════════════════════════════════════════════ */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -1px 2px rgb(0 0 0 / 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }


/* ===== REPORTS TABLE LAYOUT ===== */

/* Shell is a flex column — table root fills it, pager stays at bottom */
.reports-table-shell .mud-table-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    width: 100%;
}

/* Scrollable rows area fills remaining space */
.reports-table-shell .mud-table-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto !important;
    scrollbar-width: thin;
    width: 100%;
}

/* Inner table stretches full width */
.reports-table-shell .mud-table-container table {
    width: 100%;
    min-width: 100%;
    table-layout: auto;
}

/* Pager always visible at the bottom */
.reports-table-shell .mud-table-pagination {
    flex: 0 0 auto;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    width: 100%;
}

/* Reports pages use repairjobs table classes; mirror Repair Jobs page override
   so single-row results stay top-aligned instead of vertically centered. */
.reports-page-shell .repairjobs-table-scroll .mud-table-root,
.reports-page-shell .repairjobs-table-scroll .repair-jobs-table {
    height: auto !important;
    min-height: 0 !important;
}

.reports-page-shell .repair-jobs-table .mud-table-table {
    height: auto !important;
}

/* ===== END REPORTS TABLE LAYOUT ===== */


/* ===== DASHBOARD FILTER ENHANCEMENTS ===== */

.dashboard-page-shell {
    overflow: visible;
}

.dashboard-top-section {
    overflow: visible;
    background: var(--mud-palette-background);
}

.dashboard-filter-shell {
    background: var(--app-surface-bg);
    border: 1px solid var(--app-surface-border);
    border-radius: var(--app-border-radius-lg);
    box-shadow: var(--app-shadow-xs);
}

.dashboard-filter-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
}

.dashboard-filter-date {
    flex: 0 0 180px;
    min-width: 0;
}

.dashboard-filter-date > * {
    width: 100%;
}

.dashboard-filter-action {
    flex: 0 0 130px;
}

/* ===== KPI BREAKDOWN TWO ROWS ===== */

.kpi-breakdown-list--two-rows {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--app-spacing-xs);
    margin-top: var(--app-spacing-xs);
}

/* ===== DASHBOARD DROPDOWN POSITIONING ===== */

/* Anchor wrapper for autocomplete dropdowns outside page-shell overflow:hidden context. */
.detail-autocomplete-anchor {
    position: relative;
}

/* MudBlazor popover provider — ensure the container doesn't block events */
/* Fix: dropdowns scroll with the page when html{zoom} is applied (Chromium bug).
 * Setting position:fixed on the cascading-value wrapper anchors each popover
 * to the viewport so it stays put regardless of page scroll.
 * Source: https://stackoverflow.com/a/79195740
 */
/* Packing type select popover — must be above page content */
/* Override MudBlazor dialog z-index so popovers (dropdowns) appear above dialogs */
/* Dialog overlay must NOT block popovers that are above it */
body .mud-list.mud-list-padding {
    padding: var(--app-spacing-xs) 0 !important;
}

body .mud-select .mud-select-input,
body .mud-autocomplete .mud-input-slot input,
body .mud-text-field .mud-input-slot input,
body .mud-picker .mud-input-slot input {
    font-size: 10px !important;
}

/* Dialog standardization for confirm/captcha actions */
body .app-confirm-dialog .mud-dialog-title {
    padding: 14px 18px 8px;
}

body .app-confirm-dialog .mud-dialog-content {
    padding: 8px 18px 14px !important;
}

body .app-confirm-dialog .mud-dialog-actions {
    padding: 10px 18px 16px !important;
    gap: 8px;
}

body .app-confirm-dialog .mud-dialog-title .mud-typography {
    font-size: 18px;
    font-weight: 700;
}

body .app-confirm-dialog .mud-dialog-content .mud-typography {
    font-size: 14px;
    line-height: 1.45;
}

body .app-confirm-dialog .mud-button-root {
    min-height: 36px;
    border-radius: var(--app-radius-md);
}

body .app-confirm-dialog .mud-dialog {
    border-radius: var(--app-radius-lg);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

/* ===== LATEST INVOICE CHIP ENHANCEMENTS ===== */

.latest-invoice-chip {
    font-size: 1.05rem !important;
    min-height: 46px !important;
    height: auto !important;
    padding: 0 var(--app-spacing-sm) !important;
    white-space: nowrap;
    background: transparent !important;
    border: none !important;
    color: var(--app-text-secondary) !important;
    font-weight: 600 !important;
}

.latest-invoice-chip-green {
    color: var(--app-success) !important;
    border: none !important;
}

.latest-invoice-chip-green .mud-icon-root {
    color: var(--app-success) !important;
}

.latest-invoice-chip .mud-icon-root {
    color: var(--app-text-muted) !important;
    font-size: 1.2rem !important;
}

.flex-wrap {
    flex-wrap: wrap !important;
}

.dashboard-panel {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* ===== INVOICE KPI GRID ENHANCEMENTS ===== */

.invoice-kpi-grid {
    width: 100%;
}

.invoice-kpi-grid > .mud-grid-item {
    display: flex;
}

.invoice-kpi-grid .dashboard-card-link {
    width: 100%;
    height: 100%;
}

.invoice-kpi-grid .dashboard-card-link .app-surface,
.invoice-kpi-grid .dashboard-card-link .mud-card {
    height: 100%;
    width: 100%;
}

/* ===== RESPONSIVE DASHBOARD ADJUSTMENTS ===== */

@media (max-width: 1200px) {
    .dashboard-filter-row {
        gap: var(--app-spacing-sm);
    }
    
    .dashboard-filter-action {
        margin-left: 0;
        flex: 1 1 auto;
    }
}

@media (max-width: 960px) {
    .dashboard-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .app-filter-cell {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .dashboard-filter-action {
        width: 100%;
    }
    
    .dashboard-filter-action .mud-button-root {
        width: 100%;
    }
}

/* ===== DASHBOARD TITLE ROW ===== */

.dashboard-title-row {
    margin-bottom: 0 !important;
}

.dashboard-title-row .app-page-title {
    margin: 0 !important;
}

@media (max-width: 960px) {
    .dashboard-title-row {
        flex-direction: column;
        align-items: flex-start !important;
        gap: var(--app-spacing-md);
    }
    
    .dashboard-title-row .flex-wrap {
        width: 100%;
        justify-content: flex-start !important;
    }
}

/* Ensure grouped filled primary actions keep readable white text/icons (scoped pages only) */
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary,
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary .mud-button-label,
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary .mud-icon-root {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
}

body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary:not(.mud-disabled) {
    background: linear-gradient(180deg, #2d86db 0%, #1f73c7 100%) !important;
}

body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary:not(.mud-disabled) .mud-button-label,
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary:not(.mud-disabled) .mud-icon-root {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
}

body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary.mud-disabled,
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary.mud-disabled .mud-button-label,
body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary.mud-disabled .mud-icon-root {
    color: #1f73c7 !important;
    -webkit-text-fill-color: #1f73c7 !important;
    opacity: 1 !important;
}

body .app-scope-group-filled-primary .mud-button-group .mud-button-filled.mud-button-filled-primary.mud-disabled {
    background: transparent !important;
    box-shadow: none !important;
}

/* Keep Save All text/icon white in Repair Job edit mode */
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn,
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn .mud-button-label,
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn .mud-icon-root,
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn.mud-disabled,
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn.mud-disabled .mud-button-label,
body .mud-button-group .mud-button-filled.mud-button-filled-primary.save-all-btn.mud-disabled .mud-icon-root {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    opacity: 1 !important;
}

/* Work Order Save All: grey style in edit mode */
body .mud-button-group .mud-button-root.workorder-save-all-btn,
body .mud-button-group .mud-button-root.workorder-save-all-btn:not(.mud-disabled),
body .mud-button-group .mud-button-root.workorder-save-all-btn.mud-disabled {
    background: #e5e7eb !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
    opacity: 1 !important;
}

body .mud-button-group .mud-button-root.workorder-save-all-btn .mud-button-label,
body .mud-button-group .mud-button-root.workorder-save-all-btn .mud-icon-root {
    color: #475569 !important;
    -webkit-text-fill-color: #475569 !important;
    opacity: 1 !important;
}


/* ── Responsive / compact layout for small screens (≤1366px) ──────────────
   The base font-size on html/body is already compact (13px).
   These rules tighten fixed-px values further on smaller viewports.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 1366px) {
    :root {
        --app-spacing-3: 16px;
        --app-spacing-4: 24px;
        --app-radius-lg: 10px;
    }

    /* Page-level padding */
    .page-enter,
    .mud-main-content > .mud-container,
    .mud-main-content > div {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }

    /* App surface cards */
    body .app-surface.pa-4 {
        padding: 12px !important;
    }
    body .app-surface.pa-6 {
        padding: 16px !important;
    }

    /* Headings */
    body .mud-typography.mud-typography-h4 { font-size: 16px !important; }
    body .mud-typography.mud-typography-h5,
    body .mud-typography.mud-typography-h6 { font-size: 15px !important; }

    /* Buttons — tighter height */
    body .mud-button-root { min-height: 25px !important; }

    /* Input fields — tighter */
    body .mud-input-control > .mud-input-control-input-container > .mud-input-slot {
        min-height: 30px !important;
    }

    /* Table rows — tighter */
    body .mud-table-root .mud-table-container table tbody td {
        padding-top: 0.3rem !important;
        padding-bottom: 0.3rem !important;
    }

    /* Nav drawer — slightly narrower */
    .mud-drawer--left.mud-drawer-open .mud-drawer-content {
        width: 200px !important;
    }
}

/* ── Extra compact for very small viewports (≤1024px, e.g. 720p laptops) ── */
@media (max-width: 1024px) {
    body .mud-typography.mud-typography-h4 { font-size: 15px !important; }
    body .mud-typography.mud-typography-h5,
    body .mud-typography.mud-typography-h6 { font-size: 14px !important; }

    body .mud-button-root { min-height: 28px !important; }

    body .mud-input-control > .mud-input-control-input-container > .mud-input-slot {
        min-height: 28px !important;
    }

    body .mud-table-root .mud-table-container table thead th,
    body .mud-table-root .mud-table-head .mud-table-cell {
        font-size: 11px !important;
        padding-top: 5px !important;
        padding-bottom: 5px !important;
    }

    body .mud-table-root .mud-table-container table tbody td {
        font-size: 11px !important;
        padding-top: 0.25rem !important;
        padding-bottom: 0.25rem !important;
    }
}


/* ── Compact DatePicker popup ─────────────────────────────────────────────
   zoom shrinks the picker AND its layout footprint, so positioning stays
   correct relative to the input field.
   ───────────────────────────────────────────────────────────────────────── */

body .mud-picker-inline-paper,
body .mud-picker-paper {
    zoom: 0.85;
}

/* ===== List/Sidebar/Pager redesign (shared across all list screens) ===== */

body .app-surface.list-table-shell,
body .repairjobs-table-shell,
body .workorders-table-shell,
body .inventory-table-shell,
body .invoice-table-shell,
body .customers-table-shell,
body .subcustomers-table-shell,
body .ssr-table-shell,
body .reports-table-shell,
body .users-table-shell,
body .userlogs-table-shell {
    border-radius: 10px !important;
    border: 1px solid #d7e2f1 !important;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06) !important;
    background: #fff !important;
}

body .list-table-shell .mud-table-root,
body .repair-jobs-table,
body .workorders-list-table,
body .inventory-list-table,
body .invoice-list-table,
body .ssr-list-table,
body .userlogs-list-table,
body .app-data-table {
    border-radius: 10px;
}

body .mud-table-root .mud-table-container table thead th,
body .mud-table-root .mud-table-head .mud-table-cell,
body .mud-datagrid .mud-table-container table thead th,
body .mud-datagrid .mud-table-head .mud-table-cell {
    background: linear-gradient(180deg, #f8fbff, #eef4fc) !important;
    border-bottom: 1px solid #d8e3f3 !important;
    color: #25324a !important;
}

body .mud-table-root .mud-table-container table tbody td,
body .mud-datagrid .mud-table-container table tbody td {
    border-bottom: 1px solid #ebf1fa !important;
}

body .mud-table-root .mud-table-container table tbody tr:hover td,
body .mud-datagrid .mud-table-container table tbody tr:hover td {
    background: #f5f9ff !important;
}

body .mud-table-pagination,
body .mud-data-grid-pager {
    border-top: 1px solid #dce6f4 !important;
    background: #fbfdff !important;
    min-height: 40px !important;
    padding: 6px 10px !important;
}

body .mud-table-pagination .mud-table-pagination-actions,
body .mud-data-grid-pager .mud-table-pagination-actions {
    gap: 4px;
}

body .mud-table-pagination .mud-icon-button,
body .mud-data-grid-pager .mud-icon-button {
    width: 28px;
    height: 28px;
    border-radius: 7px !important;
    border: 1px solid #d6e2f4;
    background: #fff;
}

body .mud-table-pagination .mud-icon-button:hover,
body .mud-data-grid-pager .mud-icon-button:hover {
    border-color: #b9cef0;
    background: #f2f7ff;
}

body .mud-table-pagination .mud-table-pagination-select .mud-input-slot {
    border: 1px solid #d6e2f4 !important;
    background: #fff !important;
    border-radius: 8px !important;
}

body .mud-paper:has(.app-filter-row),
body .mud-paper:has(.app-filter-row-compact),
body .mud-paper:has(.rj-filter-row),
body .mud-paper:has(.wo-filter-row),
body .mud-paper:has(.inventory-filter-row),
body .mud-paper:has(.ssr-filter-row),
body .mud-paper:has(.invoice-filter-row) {
    border: 1px solid #dbe6f4 !important;
    border-radius: 10px !important;
    background: #fbfdff !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}


/* ── Filter row input compactness ─────────────────────────────────────────
   Force all inputs inside filter rows to be dense and consistent height.
   ───────────────────────────────────────────────────────────────────────── */
.app-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.app-filter-row-compact .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.wo-filter-date .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.rj-filter-date .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.rj-filter-cell .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.app-filter-cell .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
.app-filter-cell-compact .mud-input-control > .mud-input-control-input-container > .mud-input-slot {
    min-height: 27px !important;
    height: 27px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.app-filter-row .mud-input-control-input-container,
.app-filter-row-compact .mud-input-control-input-container {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Remove extra top margin MudBlazor adds for the floating label in filter rows */
.app-filter-row .mud-input-control,
.app-filter-row-compact .mud-input-control,
.app-filter-cell .mud-input-control,
.app-filter-cell-compact .mud-input-control {
    margin-bottom: 0 !important;
}

/* Tabs on list pages — tighter */
body .mud-tabs .mud-tab {
    font-size: 10px !important;
    min-height: 32px !important;
    padding: 4px 10px !important;
    font-weight: 700 !important;
    color: #111827 !important;
}

body .mud-tabs .mud-tabs-toolbar {
    min-height: 32px !important;
}

body .mud-tabs .mud-tab.mud-tab-active {
    color: #1f6fff !important;
    border-color: #1f6fff !important;
}


/* ── Universal filter surface & row compactness ───────────────────────────
   Applies the Repair Jobs filter style to ALL list page filter areas.
   Targets every known filter surface/row class across all list pages.
   ───────────────────────────────────────────────────────────────────────── */

/* Filter surface cards — compact padding, subtle style */
body .repairjobs-filter-surface,
body .workorders-filter-surface,
body .inventory-filter-surface,
body .ssr-filter-surface,
body .customers-filter-surface,
body .subcustomers-filter-surface,
body .users-filter-surface,
body .rjpi-filter-surface,
body .rjinvoice-filter-surface {
    padding: 0.3rem 0.5rem !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06) !important;
}

/* Also target generic app-surface used as filter containers */
body .app-surface.pa-4:has(.app-filter-row),
body .app-surface.pa-4:has(.app-filter-row-compact),
body .app-surface.pa-3:has(.app-filter-row),
body .app-surface.pa-3:has(.app-filter-row-compact) {
    padding: 0.3rem 0.5rem !important;
}

/* All filter row inputs — force Dense height regardless of Margin prop */
body .app-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .app-filter-row-compact .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .rj-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .wo-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .inventory-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .ssr-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot,
body .invoice-filter-row .mud-input-control > .mud-input-control-input-container > .mud-input-slot {
    min-height: 27px !important;
    height: 27px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* All filter row inputs — font size */
body .app-filter-row .mud-input-slot input,
body .app-filter-row-compact .mud-input-slot input,
body .rj-filter-row .mud-input-slot input,
body .wo-filter-row .mud-input-slot input,
body .inventory-filter-row .mud-input-slot input,
body .ssr-filter-row .mud-input-slot input,
body .invoice-filter-row .mud-input-slot input,
body .app-filter-row .mud-select-input,
body .app-filter-row-compact .mud-select-input,
body .rj-filter-row .mud-select-input,
body .wo-filter-row .mud-select-input,
body .inventory-filter-row .mud-select-input,
body .ssr-filter-row .mud-select-input,
body .invoice-filter-row .mud-select-input {
    font-size: 11px !important;
    line-height: 1.2 !important;
}

/* All filter row labels */
body .app-filter-row .mud-input-label,
body .app-filter-row-compact .mud-input-label,
body .rj-filter-row .mud-input-label,
body .wo-filter-row .mud-input-label,
body .inventory-filter-row .mud-input-label,
body .ssr-filter-row .mud-input-label,
body .invoice-filter-row .mud-input-label {
    font-size: 10px !important;
}

/* All filter action buttons */
body .app-filter-row .mud-button-root,
body .app-filter-row-compact .mud-button-root,
body .rj-filter-row .mud-button-root,
body .wo-filter-row .mud-button-root,
body .inventory-filter-row .mud-button-root,
body .ssr-filter-row .mud-button-root,
body .invoice-filter-row .mud-button-root {
    min-height: 23px !important;
    height: 25px !important;
    font-size: 10px !important;
    padding-inline: 5px !important;
}

/* FilterBar component wrapper — remove extra padding */
body .mud-paper:has(.app-filter-row),
body .mud-paper:has(.app-filter-row-compact),
body .mud-paper:has(.rj-filter-row),
body .mud-paper:has(.wo-filter-row),
body .mud-paper:has(.inventory-filter-row),
body .mud-paper:has(.ssr-filter-row) {
    padding: 0.3rem 0.5rem !important;
}

/* Universal empty-list alignment inside MudTable/AppDataTable */
body .mud-table-empty-row > td {
    text-align: center !important;
    vertical-align: middle !important;
}

body .mud-table-empty-row .app-empty-state,
body .mud-table-empty-row .mud-container,
body .mud-table-empty-row .mud-typography {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
