.btn { font-weight: 400; }
.form-page { max-width: 44rem; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-block; }
.select2-container { width: 100% !important; }

[data-bs-theme="dark"] .select2-dropdown, [data-bs-theme="dark"] .select2-selection--single { background: var(--bs-body-bg); color: var(--bs-body-color); }
[data-bs-theme="dark"] .select2-selection__rendered { color: var(--bs-body-color) !important; }

/* Functional auth layout: bounded forms and locally rendered QR kept scannable in both themes. */
.auth-panel { max-width: 28rem; }
.auth-qr { max-width: 16rem; background: white; }
.auth-qr svg { display: block; width: 100%; height: auto; }
.theme-sun { display: none; }
[data-bs-theme="dark"] .theme-sun { display: inline-block; }
[data-bs-theme="dark"] .theme-moon { display: none; }

/* Fixed overview columns allow one-line truncation without widening the viewport. */
.table th, .table td { white-space: nowrap; }
.office-orders { table-layout: fixed; min-width: 80rem; }
.office-orders .selection-column { width: 2.25rem; }
.office-orders .date-column { width: 10rem; }
.office-orders .hours-column { width: 5rem; }
.office-orders .action-column { width: 9rem; }
.preserve-lines { white-space: pre-line; overflow-wrap: anywhere; }
.summary-table { table-layout: fixed; min-width: 24rem; }
.office-orders th { overflow: hidden; text-overflow: ellipsis; }

/* Shared input focus and Select2 Bootstrap 5 theme. */
.form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection { border-color: #495057; }
[data-bs-theme="dark"] .select2-search__field { background-color: #212529; color: #dee2e6; }
[data-bs-theme="dark"] .select2-selection__placeholder { color: #bbb !important; }
[data-bs-theme="dark"] .select2-results__option--highlighted { background-color: #99c8ff !important; color: #495057 !important; }
[data-bs-theme="dark"] .select2-results__option--selected:not(.select2-results__option--highlighted) { background-color: #343a40; color: #dee2e6; }
.select2-container--bootstrap-5.select2-container--disabled .select2-selection { background-color: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.mle-pagination {
    gap: 0.125rem;
}

.mle-pagination .page-link {
    border-color: transparent;
    border-radius: var(--bs-border-radius);
    padding: 0.375rem 0.55rem;
}

.mle-pagination .page-item:first-child .page-link,
.mle-pagination .page-item:last-child .page-link {
    padding-inline: 0.45rem;
}

.mle-pagination .page-item:not(:first-child) .page-link {
    margin-left: 0;
}

.mle-pagination .page-item:not(.active):not(.disabled) .page-link {
    background-color: transparent;
}

.mle-pagination .page-item.disabled .page-link {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
}
.office-form-page { max-width: 90rem; }
.office-worktypes { table-layout: fixed; min-width: 40rem; }

.office-machine-list { table-layout:fixed; min-width:65rem; }
.office-machine-history { table-layout:fixed; min-width:55rem; }
.office-machine-list th, .office-machine-history th { overflow:hidden; text-overflow:ellipsis; }

.office-machine-tasks { table-layout:fixed; min-width:35rem; }
.office-machine-tasks th { overflow:hidden; text-overflow:ellipsis; }

.office-users { table-layout: fixed; min-width: 65rem; }
.office-users th { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.office-settings {table-layout:fixed;min-width:35rem;}

.user-menu-name { display:inline-block; max-width: min(18rem, 65vw); overflow:hidden; text-overflow:ellipsis; vertical-align:bottom; white-space:nowrap; }

/* Shared light heading weight; includes Bootstrap heading utilities. */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-weight: 300; }

/* List actions, pagination and search share the row above their own results. */
.list-toolbar { display: grid; gap: .75rem; align-items: center; margin-block: 1rem; }
.list-toolbar > p, .list-toolbar .pagination { margin: 0; }
.list-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.list-search { min-width: 0; }
.work-order-actions { grid-column: 1 / -1; }

@media (scripting: none) {
    .offcanvas[id$="-filters"] {
        position: static;
        visibility: visible;
        transform: none;
        width: 100%;
        margin-bottom: 1rem;
    }
    [data-bs-target$="-filters"], .offcanvas[id$="-filters"] .btn-close { display: none; }
}
@media (min-width: 992px) {
    .list-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); }
    .list-pager { grid-column: 2; }
    .list-pager .pagination { justify-content: center; }
    .list-search { grid-column: 3; }
}

.work-type-chart { position: relative; }
.work-type-chart-labels { position: absolute; inset: 0 auto 0 0; pointer-events: none; }
.work-type-chart-labels span {
    position: absolute;
    left: 0;
    right: .5rem;
    transform: translateY(-50%);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
    font-size: .875rem;
    pointer-events: auto;
}

.machine-plate {
    flex: 0 1 auto;
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #000;
    background: #ff0;
    border: 1px solid #000;
    border-radius: 5px;
    padding: 1px 5px;
    font-size: .875rem;
    font-weight: 700;
}


