/* Dense desktop layout for operational lists and reports. */
@media (min-width: 64rem) {
    .fi-main {
        max-width: 100% !important;
        padding-inline: 1rem !important;
    }

    .fi-page-main {
        gap: 0.75rem !important;
    }

    .fi-page-header-main-ctn {
        row-gap: 0.5rem !important;
        padding-block: 0.65rem !important;
    }

    .fi-header {
        gap: 0.5rem !important;
    }

    .fi-header .fi-breadcrumbs {
        margin-bottom: 0.15rem !important;
    }

    .fi-header-heading {
        font-size: 1.2rem !important;
        line-height: 1.45rem !important;
    }

    .fi-header-subheading {
        margin-top: 0.1rem !important;
        max-width: none !important;
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }

    .fi-header-actions-ctn {
        gap: 0.4rem !important;
    }

    .fi-ta-header,
    .fi-ta-header-toolbar {
        gap: 0.5rem !important;
        padding: 0.45rem 0.65rem !important;
    }

    .fi-ta-filters-above-content-ctn {
        padding: 0.35rem 0.65rem !important;
    }

    .fi-ta-filters-above-content-ctn .fi-ta-filters {
        row-gap: 0.3rem !important;
    }

    .fi-ta-filters-above-content-ctn .fi-ta-filters-header {
        display: none !important;
    }

    .fi-ta-filters-above-content-ctn .fi-ta-filters-actions-ctn {
        margin-top: 0 !important;
    }

    .fi-ta-table {
        font-size: 0.75rem !important;
    }

    .fi-ta-header-cell {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.72rem !important;
        line-height: 0.95rem !important;
        white-space: nowrap;
    }

    .fi-ta-header-cell:first-of-type {
        padding-inline-start: 0.65rem !important;
    }

    .fi-ta-header-cell:last-of-type {
        padding-inline-end: 0.65rem !important;
    }

    .fi-ta-text:not(.fi-inline),
    .fi-ta-icon:not(.fi-inline) {
        padding: 0.35rem 0.5rem !important;
    }

    .fi-ta-text-item,
    .fi-ta-cell-label {
        font-size: 0.75rem !important;
        line-height: 1rem !important;
    }

    .fi-ta-cell .fi-badge {
        min-width: 1rem !important;
        padding: 0.1rem 0.35rem !important;
        font-size: 0.68rem !important;
        line-height: 0.9rem !important;
    }

    .fi-ta-ctn {
        border-radius: 0.5rem !important;
    }
}

/* Rental linen dashboard: this view is not part of the compiled Filament theme. */
.rental-linen-dashboard {
    display: grid;
    gap: 0.75rem;
}

.rental-linen-filters {
    display: grid;
    grid-template-columns: minmax(12rem, 20rem) minmax(10rem, 14rem);
    gap: 0.75rem;
    align-items: end;
}

.rental-linen-field {
    display: grid;
    gap: 0.3rem;
    min-width: 0;
    color: rgb(55 65 81);
    font-size: 0.75rem;
    font-weight: 600;
}

.dark .rental-linen-field {
    color: rgb(229 231 235);
}

.rental-linen-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.rental-linen-kpi,
.rental-linen-table-card {
    border: 1px solid rgb(229 231 235);
    border-radius: 0.5rem;
    background: white;
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.dark .rental-linen-kpi,
.dark .rental-linen-table-card {
    border-color: rgb(255 255 255 / 0.1);
    background: rgb(24 24 27);
}

.rental-linen-kpi {
    min-width: 0;
    padding: 0.75rem;
}

.rental-linen-kpi-label {
    overflow: hidden;
    color: rgb(107 114 128);
    font-size: 0.7rem;
    line-height: 1rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dark .rental-linen-kpi-label {
    color: rgb(156 163 175);
}

.rental-linen-kpi-value {
    margin-top: 0.2rem;
    color: rgb(17 24 39);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.35rem;
    white-space: nowrap;
}

.dark .rental-linen-kpi-value {
    color: rgb(249 250 251);
}

.rental-linen-table-card {
    overflow: hidden;
}

.rental-linen-table-scroll {
    overflow-x: auto;
}

.rental-linen-table {
    width: 100%;
    min-width: 52rem;
    border-collapse: collapse;
    color: rgb(55 65 81);
    font-size: 0.75rem;
    line-height: 1rem;
}

.dark .rental-linen-table {
    color: rgb(229 231 235);
}

.rental-linen-table th,
.rental-linen-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgb(229 231 235);
    text-align: left;
    white-space: nowrap;
}

.dark .rental-linen-table th,
.dark .rental-linen-table td {
    border-bottom-color: rgb(255 255 255 / 0.08);
}

.rental-linen-table th {
    background: rgb(249 250 251);
    color: rgb(75 85 99);
    font-size: 0.7rem;
    font-weight: 600;
}

.dark .rental-linen-table th {
    background: rgb(39 39 42);
    color: rgb(209 213 219);
}

.rental-linen-table tbody tr:last-child td {
    border-bottom: 0;
}

.rental-linen-table tbody tr:hover td {
    background: rgb(249 250 251 / 0.8);
}

.dark .rental-linen-table tbody tr:hover td {
    background: rgb(255 255 255 / 0.03);
}

.rental-linen-table .is-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.rental-linen-table .is-item,
.rental-linen-table .is-strong {
    font-weight: 600;
}

.rental-linen-empty {
    padding: 1.5rem !important;
    color: rgb(107 114 128);
    text-align: center !important;
}

/* Invoice matching: draw attention to the only product price users must enter. */
.invoice-line-price-entry .fi-input-wrp {
    background: rgb(219 234 254) !important;
    box-shadow: inset 0 0 0 2px rgb(37 99 235 / 0.8) !important;
}

.invoice-line-price-entry .fi-input {
    background: transparent !important;
    color: rgb(30 58 138) !important;
    font-weight: 650;
}

.invoice-line-price-entry .fi-input::placeholder {
    color: rgb(29 78 216 / 0.8) !important;
}

.dark .invoice-line-price-entry .fi-input-wrp {
    background: rgb(30 58 138 / 0.6) !important;
    box-shadow: inset 0 0 0 2px rgb(96 165 250 / 0.9) !important;
}

.dark .invoice-line-price-entry .fi-input {
    color: rgb(219 234 254) !important;
}

/* Operational tables: clearly separate operator input from calculated data. */
.fi-fo-table-repeater.fi-compact > table > tbody > tr > td:has(.fi-input-wrp:not(.fi-disabled)),
.fi-ta-table > tbody > tr > td:has(.fi-input-wrp:not(.fi-disabled)) {
    background: rgb(239 246 255) !important;
    box-shadow: inset 0 0 0 1px rgb(147 197 253) !important;
}

.fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled),
.fi-ta-table .fi-input-wrp:not(.fi-disabled) {
    background: rgb(219 234 254) !important;
    box-shadow: inset 0 0 0 2px rgb(59 130 246 / 0.75) !important;
}

.fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled):focus-within,
.fi-ta-table .fi-input-wrp:not(.fi-disabled):focus-within {
    background: rgb(191 219 254) !important;
    box-shadow: inset 0 0 0 3px rgb(37 99 235) !important;
}

.fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled) .fi-input,
.fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled) .fi-select-input,
.fi-ta-table .fi-input-wrp:not(.fi-disabled) .fi-input,
.fi-ta-table .fi-input-wrp:not(.fi-disabled) .fi-select-input {
    background: transparent !important;
    color: rgb(30 58 138) !important;
    font-weight: 600;
}

.dark .fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled),
.dark .fi-ta-table .fi-input-wrp:not(.fi-disabled) {
    background: rgb(30 58 138 / 0.65) !important;
    box-shadow: inset 0 0 0 2px rgb(96 165 250 / 0.85) !important;
}

.dark .fi-fo-table-repeater.fi-compact > table > tbody > tr > td:has(.fi-input-wrp:not(.fi-disabled)),
.dark .fi-ta-table > tbody > tr > td:has(.fi-input-wrp:not(.fi-disabled)) {
    background: rgb(30 58 138 / 0.25) !important;
    box-shadow: inset 0 0 0 1px rgb(96 165 250 / 0.45) !important;
}

.dark .fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled):focus-within,
.dark .fi-ta-table .fi-input-wrp:not(.fi-disabled):focus-within {
    background: rgb(30 64 175 / 0.8) !important;
    box-shadow: inset 0 0 0 3px rgb(147 197 253) !important;
}

.dark .fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled) .fi-input,
.dark .fi-fo-table-repeater.fi-compact .fi-input-wrp:not(.fi-disabled) .fi-select-input,
.dark .fi-ta-table .fi-input-wrp:not(.fi-disabled) .fi-input,
.dark .fi-ta-table .fi-input-wrp:not(.fi-disabled) .fi-select-input {
    color: rgb(239 246 255) !important;
}

/* Invoice total mismatch: make accounting discrepancies impossible to miss. */
.invoice-totals-alert-danger {
    border: 2px solid rgb(220 38 38);
    border-radius: 0.5rem;
    background: rgb(254 242 242);
    padding: 0.75rem 1rem;
    color: rgb(153 27 27) !important;
    box-shadow: 0 1px 2px rgb(127 29 29 / 0.12);
}

.invoice-totals-alert-danger .fi-in-entry-label,
.invoice-totals-alert-danger .fi-in-entry-content,
.invoice-totals-alert-danger .fi-in-text-item,
.invoice-totals-alert-danger .fi-fo-field-wrp-helper-text {
    color: inherit !important;
}

.invoice-totals-alert-danger .fi-in-entry-content {
    font-weight: 700;
}

.dark .invoice-totals-alert-danger {
    border-color: rgb(248 113 113);
    background: rgb(69 10 10 / 0.8);
    color: rgb(254 202 202) !important;
}

@media (min-width: 96rem) {
    .rental-linen-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 63.99rem) {
    .rental-linen-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 39.99rem) {
    .rental-linen-filters,
    .rental-linen-kpis {
        grid-template-columns: 1fr;
    }
}
