/* ==========================================================================
   pages.css — Page-specific styles
   ========================================================================== */

/* --- Login (/Index) --- */

.login-container .cf-turnstile {
    margin-bottom: 0.75rem;
}

.login_container--desktop {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    max-width: 400px;
    width: 100%;
    padding: 30px; 
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    align-items: center;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-form-title {
    display: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Focus ring comes from the global :focus-visible rule in site.css (WCAG 2.4.7) */
.form-group input:focus {
    border-color: var(--color-focus);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-login:hover {
    background-color: #0056b3;
}

/* Same look when used as a link (ChangePassword "request new link") */
a.btn-login {
    display: block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}

a.btn-login:hover {
    color: white;
}

.login-cancel {
    display: block;
    margin-top: 16px;
    text-align: center;
    color: #007bff;
    text-decoration: none;
}

.login-cancel:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}


@media (min-width: 1024px) {
    .score-title-desktop {
        display: inline;
    }
}

@media (min-width:769px) {
    .score-title-mobile {
        display: none;
    }
}
/* --- Status --- */

.status-header-wrapper {
    margin-top:4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    align-content: center;
    height: 35px;
    padding-right: 100px;
}

.status-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 8px;
    margin-bottom: 1rem;
}

.status-filter label {
    font-size: 0.85rem;
    white-space: nowrap;
}

.status-filter select {
    width: auto;
    min-width: 150px;
    height: 35px;
}

.status-circle-narrow { display: none; }
.status-text-wide { display: inline; }

@media (max-width: 1024px) {
    /* Kept in the accessibility tree (not display:none) so the status word is still
       announced when only the circle is shown on screen — title alone isn't reliably
       announced and does nothing on touch (WCAG 1.1.1 / 1.4.1). Same technique as
       Bootstrap's .visually-hidden. */
    .status-text-wide {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    .status-circle-narrow { display: inline-block; }
}

/* --- Status: filter/sort toolbar + panel --- */

.status-header-wrapper { flex-wrap: wrap; }

.status-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-filter-toggle { display: none; } /* desktop: filters are inline, no toggle needed */

.status-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-export-btn img { width: 22px; height: 22px; }

.status-filter-panel {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 8px;
    margin-bottom: 1rem;
}

.status-filter-panel-header { display: none; } /* only shown inside the mobile overlay */
.status-filter-panel-title { font-size: 1.25rem; margin: 0; }

.status-filter-fields {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.status-filter-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-filter-field label {
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Search box + submit button side by side; the button submits dates and search text */
.status-search-group {
    display: flex;
    gap: 0.5rem;
}

.status-search-group .status-apply-btn { white-space: nowrap; }

/* Per-client date-range limit warning, on its own line under the filter fields */
.status-range-warning {
    flex-basis: 100%;
    color: #b00020;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-range-warning.pulse {
    animation: status-warning-pulse 0.4s ease-in-out 3;
}

@keyframes status-warning-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.15; }
}

/* Date value outside the client's available data extent */
.status-filter-panel input.date-out-of-range {
    background-color: #fff3cd;
    border-color: #e0a800;
    color: #7a5c00;
}

.status-filter-panel select,
.status-filter-panel input { height: 35px; }

@media (max-width: 665px) {
    .status-filter-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
    }

    /* Mobile: the filter panel becomes a full-screen overlay opened by the Filter button */
    .status-filter-panel {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 1050;
        margin: 0;
        padding: 1rem;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        overflow-y: auto;
    }

    .status-filter-panel.is-open { 
        display: flex; 
        padding-top: 100px;
    }

    .status-filter-panel-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
    }

    .status-filter-fields {
        flex-direction: column;
        align-items: stretch;
    }

    .status-filter-field { width: 100%; }

    .status-filter-panel select,
    .status-filter-panel input { width: 100%; }

    /* The sort dropdown doesn't auto-submit in the overlay, so it moves above the
       search row to keep the submit button last in the form. */
    .status-filter-field--sort { order: -1; }

    .status-search-group .status-search-input { flex: 1; min-width: 0; }
    .status-search-group .status-apply-btn { height: 44px; }
}

/* --- Products: header with the view switch --- */

.products-header {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 5rem;
    margin-bottom: 1rem;
}

.products-header__secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.products-header .page_header {
    margin-bottom: 0;
}

/* Icon segmented control: a pill with the active option raised like a slider thumb.
   The active state is also carried by aria-current and the link's own aria-label. */
.view-switch {
    display: inline-flex;
    padding: 3px;
    background: #eef1f4;
    border: 1px solid #d5dbe0;
    border-radius: 999px;
    align-items: center;
    align-content: center;
    vertical-align: middle;
}

.view-switch__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 36px;
    border-radius: 999px;
    color: #5a6570;
}

.view-switch__option svg {
    width: 20px;
    height: 20px;
    fill:rgb(240, 240, 240);
}

.view-switch__option:hover {
    color: var(--color-brand-text);
}

.view-switch__option:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.view-switch__option.is-active {
    background: #fff;
    color: var(--color-brand-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

@media (max-width: 665px) {
    .view-switch__option {
        height: 44px;
    }
}

/* --- Products: list view (?view=list, master/detail) --- */

.product-split {
    display: grid;
    grid-template-columns: minmax(320px, 350px) 3fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

/* Search box shared by both views (_ProductSearch.cshtml) */
.products-search {
    margin-bottom: 0.5rem;
}

.products-search__group {
    display: flex;
    gap: 0.5rem;
}

.products-search__group .products-search__input {
    flex: 1;
    min-width: 0;
    height: 35px;
}

/* "Ordered only" checkbox under the search box; applies with the Search button */
.products-search__options {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.4rem;
    font-size: 0.9rem;
}

.products-search__options input {
    margin: 0;
}

.products-search__options label {
    margin: 0;
    cursor: pointer;
}

.products-count {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #5a6570;
}

/* Grid view: same box, but capped to the list pane's width above the full-width table */
.products-grid-search {
    max-width: 350px;
    margin-bottom: 0.75rem;
}

/* Two lines per row: number + client code, then the description across the full width —
   the pane is too narrow for three columns. The header mirrors the same grid. */
.product-list__head,
.product-list__item {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.125rem 0.75rem;
    align-items: center;
    padding: 0.2rem 0.75rem;
}

.product-list__desc {
    grid-column: 1 / -1;
    color: #5a6570;
    overflow-wrap: anywhere;
}

.product-list__head .product-list__desc {
    font-size: inherit;
}

.product-list__head {
    font-size: 0.8rem;
    font-weight: 600;
    color: #5a6570;
    text-transform: uppercase;
    border: 1px solid #e3e6e9;
    border-radius: 6px 6px 0 0;
    background: #f8f9fa;
}

.product-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 1px solid #e3e6e9;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    max-height: 70vh;
    overflow-y: auto;
}

.product-list li + li {
    border-top: 1px solid #f0f0f0;
}

/* Selection is shown by the border, the background and the weight — not colour alone. */
.product-list__item {
    min-height: 44px;
    color: inherit;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.product-list__item:hover,
.product-list__item:focus-visible {
    background: #f5f8fa;
    color: inherit;
}
.product-list__number {
    font-variant-numeric: tabular-nums;
}
.product-list__item.is-selected {
    border-left-color: var(--color-brand-text);
    background: #eaf6fc;
    font-weight: 700;
}



.product-list__code {
    overflow-wrap: anywhere;
}

.product-list__empty {
    padding: 1rem 0.75rem;
    color: #5a6570;
}

/* The card pane grows with its content and the page scrolls — no inner scrollbar (and so
   not sticky either: a pinned pane taller than the viewport would hide its bottom).
   Reuses the overlay's .overlay-table / .overlay-pdf-* rules. */
.product-split__detail {
    background: #fff;
    border: 1px solid #e3e6e9;
    border-radius: 6px;
}

.product-split__detail-header {
    display: flex;
    align-items: center;   /* the .product-stock strip (local.css) sits at the right edge */
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.product-split__detail-header h2 {
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.product-split__detail-body {
    padding: 16px;
}

/* Wide desktops: the attribute table is capped at 600px and the drawing / print /
   pallet thumbnails (.overlay-pdf-section, rendered by site.js) move up beside it as a
   right-hand column instead of a strip below. */
@media (min-width: 1400px) {
    .product-split__detail-body {
        display: flex;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 20px;
    }

    .product-split__detail-body .overlay-table {
        flex: 0 1 600px;
        max-width: 600px;
    }

    .product-split__detail-body .overlay-pdf-section {
        flex: 1 1 240px;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0;
        padding-top: 0;
        padding-left: 20px;
        border-top: 0;
        border-left: 1px solid #eee;
    }

    .product-split__detail-body .overlay-loading,
    .product-split__detail-body .overlay-actions {
        flex: 1 1 100%;
    }
}

/* Phones: no room for two panes — the list fills the width and a tap opens the overlay
   (products.js checks the same breakpoint). */
@media (max-width: 665px) {
    .product-split {
        grid-template-columns: 1fr;
    }

    .product-split__detail {
        display: none;
    }

    .product-list {
        max-height: none;
    }

    .products-search__group .a-btn {
        height: 44px;
    }

    .products-search__options {
        min-height: 44px;
    }

    .products-grid-search {
        max-width: none;
    }
}

/* --- Cart: order templates --- */

.cart-templates-toolbar {
    display: flex;
    gap: 0.5rem;
    margin: 8px 0;
}

.tpl-save-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tpl-save-row input { flex: 1; }

.tpl-count { color: var(--color-muted); font-size: 0.85rem; }
.tpl-empty { color: var(--color-muted); padding: 8px 0; }

/* --- Templates & history page --- */

.tpl-page-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 8px 0 1rem;
}

.tpl-page-tabs .tpl-tab.active {
    font-weight: 700;
    text-decoration: underline;
}

.tpl-lines-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.5rem;
}

.tpl-lines-table th,
.tpl-lines-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.tpl-lines-table .qty-input { width: 80px; }

.tpl-detail-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Loading spinner: .app-spinner / .app-spinner-wrap live in site.css (shared with the tour) */

/* Order history picker */
.history-qtymode {
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-end;
    /* it's a <fieldset> now (WCAG 1.3.1 grouping) — reset the browser's default chrome */
    border: none;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.history-qtymode .history-radio {
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

/* --- "Order again" panel (Order page) --- */
/* Sits below .product-overlay (z-index 2000) so its save-template prompt stays on top. */

.reorder-panel-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1890;
}

.reorder-panel-backdrop.is-open { display: block; }

.reorder-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(560px, 100%);
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0,0,0,0.2);
    z-index: 1900;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    /* visibility (not just the off-screen transform) so the closed drawer drops out of the
       tab order and the accessibility tree (WCAG 2.4.3) — delayed until the slide-out
       transition finishes so the close animation itself stays visible */
    visibility: hidden;
    transition: transform 0.2s ease, visibility 0s linear 0.2s;
}

.reorder-panel.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.2s ease;
}

.reorder-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 16px;
    border-bottom: 1px solid #ddd;
}

.reorder-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.reorder-panel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    padding: 12px 16px 0;
}

.reorder-panel-filters label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.reorder-panel-tabs {
    padding: 0 16px;
    margin: 12px 0 0;
}

.reorder-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 24px;
}

.rp-history-filters { padding: 0 0 12px; }

.rp-item { border-bottom: 1px solid #eee; }

.rp-item-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 0;
    cursor: pointer;
    /* it's a <button> now (WCAG 2.1.1) — reset the browser's button chrome */
    width: 100%;
    background: none;
    border: none;
    font: inherit;
    text-align: left;
}

#colSettingsBtn {
    padding: 2px 6px 5px 6px;
    border: 1px solid var(--color-brand-text);
}
.rp-item-title { font-weight: 600; }

.rp-item-meta {
    flex: 1;
    color: #666;
    font-size: 0.85rem;
}

.rp-item-body { padding: 4px 0 12px; }

/* Ship-to picker and the "Order again" button sit side by side above the grid. */
#order-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.filter-group--action { align-self: flex-end; }

/* "Cart pins the location" hint: a full line of its own under the select + button, so
   the row's flex-end alignment only sees those two. Pulled up against the row gap. */
#order-filter-row .shipto-locked-hint {
    flex-basis: 100%;
    margin-top: calc(4px - 1rem);
}
/* Phone: the button wraps under the select, so put the hint back right under the select */
@media (max-width: 665px) {
    #order-filter-row .shipto-locked-hint { order: 1; }
    #order-filter-row .filter-group--action { order: 2; }
}

/* --- Order --- */

#order-table { width: 100%; }

.filter-row td { padding: 2px 4px; }

.filter-input {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
    padding: 2px 4px;
    border: 1px solid #ccc;
}

.filter-row-spacing {
    margin-bottom: 0.75rem;
}

/* Price-list quantities (_PriceBreaks.cshtml): link-style buttons that set the quantity field */
.qty-breaks {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}
.qty-break {
    border: none;
    background: none;
    padding: 0 4px;
    color: var(--color-primary);
    text-decoration: underline;
    font: inherit;
    cursor: pointer;
}
.qty-break:hover { text-decoration-thickness: 2px; }
.qty-breaks-sep { color: var(--color-muted); }

.order-expand { display: none; }
.cart-header-icon { display: none; }
.kjop-icon { display: none; }
.order-mobile-header { display: none; }

/* The text stays readable to screen readers when the icon replaces it (visually hidden, not display:none) */
@media (max-width: 1024px) {
    .cart-header-text {
        position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    }
    .cart-header-icon { display: inline; }
}

@media (max-width: 1023px) {
    #order-table .qty-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    #order-table .qty-input {
        height: 44px;
        font-size: 16px;
        width: 60px;
    }

    #order-table .btn-kjop {
        padding: 5px 40px 5px 10px; /* right: room for the ~32px arrow circle */
        font-size: 16px;
        min-height: 36px;
    }

    #order-table .qty-break {
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    .order-expand { display: inline; }
}

@media (max-width: 665px) {
    .order-mobile-header {
        display: flex;
        align-items: center;
        padding: 4px 0;
        border-bottom: 2px solid #999;
        font-weight: 700;
        font-size: 0.85rem;
        color: #555;
    }
    .order-col-prodnum-header { flex: 1; padding: 0 4px; }
    .order-col-qty-header { padding: 0 4px; }
    .order-col-cart-header { padding: 0 4px; }

    /* Visually replaced by .order-mobile-header, but kept for screen readers */
    #order-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    /* …but the filter inputs must not become invisible tab stops */
    #order-table thead .filter-row { display: none; }

    #order-table tr.data-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid #ccc;
        padding: 4px 0;
    }

    #order-table tr.data-row > td {
        display: block;
        border: none;
        padding: 2px 4px;
    }

    #order-table tr.data-row > td.priority_2_column {
        display: none;
    }

    /* Line 1: product number + client code on the left, then qty stepper, buy button, cart status.
       Client code carries flex: 1 so it sits right next to the product number while the
       qty/buy/cart group stays pushed to the right. */
    #order-table .order-col-prodnum { order: 1; font-weight: bold; }
    #order-table .order-col-clientcode { order: 1; flex: 1; }
    #order-table td:has(.qty-wrapper) { order: 2; }
    #order-table td:has(.btn-kjop) { order: 3; }
    #order-table .cart-qty { order: 4; }

    /* Line 2: description (with expand arrow) on its own full-width line */
    #order-table .order-col-desc {
        display: flex;
        order: 5;
        flex: 1 1 100%;
        align-items: center;
        gap: 4px;
    }
    #order-table .order-col-desc .order-expand {
        display: inline;
        flex-shrink: 0;
        margin-right: 4px;
    }

    /* Buy button icon swap disabled for testing — the regular a-btn--sm Buy button
       shows on mobile instead. Restore the block below to bring the icon back.
    .kjop-text { display: none; }
    .kjop-icon {
        display: table-cell;
        width: 600px;
        text-align: end;
    }
    #order-table .btn-kjop {
        padding: 6px 10px;
        border: none;
        background: transparent;
        font-size: 24px;
        min-height: 44px;
        min-width: 44px;
    }
    #order-table .btn-kjop:hover { background: transparent; }
    */

    #order-table .qty-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    #order-table .qty-input {
        height: 30px;
        font-size: 14px;
        width: 35px;
    }
}

/* --- Cart --- */

#cart-table, #plater-table { width: 100%; }
.cart-mobile-header, .data-row {min-width:335px !important;}
.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.cart-header label {
    /* display: flex;
    align-items: center; */
    gap: 6px;
    white-space: nowrap;
}
.cartheader_dateselect {
        width:100%;
}
.cart-text-input {
    padding: 2px 6px;
    border: 1px solid #ccc;
    font-size: 13px;
    width: auto;
    max-width: 250px;
}

.cart-date-input {
    padding: 2px 6px;
    border: 1px solid #ccc;
    font-size: 13px;
    width: 100px;
}

.date-input {
    padding: 2px 4px;
    border: 1px solid #ccc;
    font-size: 13px;
}

/* Delete button: icon-only trash at all widths, quiet grey that turns red on hover
   (visuals from .a-btn--ghost-danger; accessible name comes from aria-label on the button) */
.slett-text { display: none; }
.slett-icon { display: inline; }

.btn-slett {
    white-space: nowrap;
    padding: 4px 10px;
    font-size: 18px;
    line-height: 1;
}
.apply-all-mobile { display: none; }

/* Hide description column and mobile expand on desktop */
/* .cart-col-desc { display: none; } */
.expand-mobile { display: none; }

/* .clientlogo-container-image {
    min-height: 120px !important;
} */
.clientlogo-container {
    width:100%;
    flex-wrap: wrap;
    display: flex;
    justify-content: space-between;
    /* padding-top:5px;
    margin-top:5px; */
}
.clientlogo-container-top {
    padding-top:0;
    margin-top:0; 
}
#currentLogoName {
    min-width:40% !important;
    min-height:10px !important;
}
.filename-label {
    margin-top: .5rem !important;
    height: 100% !important;
    vertical-align: bottom !important;
}


.cart-footer { margin-top: 12px; }

.cart-expand { display: none; }

.sheets-heading { margin-top: 2rem; }

@media (max-width: 768px) {
    .cart-expand { 
        display: inline; 
        margin-top: 10px;
    }

    #cart-table .qty-input {
        width: 40px;
    }

    .date-input {
        width: 110px;
    }
}



@media (max-width: 665px) {
    #cart-table .qty-input {
        width: 25px;
    }

    .date-input {
        width: 90px;
    }
}

/* --- BoardOrders --- */

.plater-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-content: space-between;
    align-items: flex-end;
    /* display: table-column; */
}

.plater-field {
    display: flex;
    flex-direction: column;
}

.plater-field label,
.plater-field .plater-field-label {
    font-weight: bold;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.plater-field select,
.plater-field input {
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    width: 100px;
}

.plater-field:first-child select {
    width: 110px;
}

.plater-shipto {
    margin-bottom: 1.5rem;
}

.plater-shipto label {
    font-weight: bold;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.plater-shipto select {
    padding: 0.3rem 0.4rem;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    width: 300px;
    max-width: 100%; /* no horizontal scroll at 320px (WCAG 1.4.10) */
}

.plater-alert-mb { margin-bottom: 1rem; }

.plater-actions {
    text-align: right;
    margin-top: 0.5rem;
}

.plater-cart-heading { margin-top: 2rem; }

/* Board card list (responsive board/plater grid) */
.board-card-list {
    width: 100%;
}

.board-card {
    display: flex;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid #eee;
}

.board-card-header {
    font-weight: bold;
    border-bottom: 2px solid #999;
}

.board-card-alt {
    background-color: #f9f9f9;
}

.board-card-main {
    display: flex;
    gap: 0;
}

.board-card-scores {
    display: flex;
    gap: 0;
}

.board-card-action {
    min-width: 40px;
    text-align: center;
}

.board-col {
    padding: 4px 8px;
    white-space: nowrap;
}

.board-col-num {
    min-width: 30px;
    text-align: right;
}

.board-col-quality {
    min-width: 80px;
}

.board-col-width,
.board-col-length,
.board-col-qty {
    min-width: 60px;
    text-align: right;
}

.board-col-score {
    min-width: 50px;
    text-align: right;
}

@media (max-width: 768px) {
    .board-card {
        flex-wrap: wrap;
    }
    .board-card-main {
        flex: 1 1 auto;
        justify-content: space-between;
    }
    .board-card-scores {
        flex: 1 1 100%;
        justify-content: space-between;
        padding-left: 8px;
    }
    .board-card-action {
        margin-left: auto;
    }
    .board-card-header .board-card-scores .board-col-score:first-child {
        font-weight: bold;
    }
    .board-col-score {
        min-width: 40px;
    }
    /* Hidden visually (the mobile rows carry their own caption) but kept as column headers */
    .board-card-scores-headers-desktop {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); white-space: nowrap;
    }
    .score-title-mobile {
        display: inline;
    }
    .score-title-desktop {
        display: none;
    }
}

@media (max-width: 430px) {
    .board-col {
        padding: 3px 4px;
    }
    .board-col-quality {
        min-width: 60px;
    }
    .board-col-width,
    .board-col-length,
    .board-col-qty {
        min-width: 45px;
    }
    .board-col-score {
        min-width: 35px;
    }
}

.form-inline-remove { display: inline; }

/* --- DeliveryReport --- */

.delivery-report-form {
    margin-bottom: 1.5rem;
}

.report-filters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.delivery-report-form .filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-row-inline {
    flex-wrap: wrap;
}

.delivery-report-form .filter-group {
    width: 100%;
}

.delivery-report-form .filter-group label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.filter-group-radio {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-group-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1.5rem;
}

.filter-group-dates label {
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-group-dates input[type="date"] {
    padding: 0.25rem 0.4rem;
    border: 1px solid #adb5bd;
    font-size: 0.9rem;
}

.filter-group-action {
    margin-left: 1.5rem;
}

.delivery-report-form .shipto-select {
    width: 80%;
}

.filter-group-vis {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (max-width: 576px) {
    .delivery-report-form .shipto-select {
        width: 100%;
    }

    .filter-row-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .filter-group-radio {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .filter-group-dates {
        margin-left: 0;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .filter-group-dates input[type="date"] {
        width: 100%;
    }

    .filter-group-action {
        margin-left: 0;
    }

    .filter-group-action .a-btn {
        width: 100%;
    }

    .filter-group-vis {
        width: 100%;
    }
}

/* --- Admin/Clients --- */

#clientNumber {
    max-width: 120px;
}

#clientSearch {
    max-width: 320px;
}

#clientList {
    font-size: 0.85rem;
    max-width: 320px;
    max-height:200px;
    overflow-x: hidden;
}

#userList {
    font-size: 0.9rem;
    max-width: 320px;
    overflow-x: hidden;
}
#userList option.user-disabled {
    color: #AAA;
}
.admin-client-group {
    width: 100% !important;
    display: flex;
    flex-direction: row;
    gap:2rem;
}
.clients-section {
    font-size: 0.9rem;
    width: 300px !important;
    overflow-x: hidden;
}
#clientsettings {
    /* padding-top: 6.5rem; */
    display: none;
}
#usersettings {
    font-size: 0.9rem;
    max-width: 320px;
    overflow-x: hidden;
    margin-top: 0.5rem;
    font-weight: 600;

}

#userDisabled {
    margin-right: 0.5rem;
}
.clientsettings-inner {
    max-width: 320px;
}

.users-section {
    /* order: 3;  */
    font-size: 0.9rem;
    width: 300px !important;
    max-width: 400px;
    overflow-x: hidden;
}

/* Hidden until a user is picked; adminClients.js switches it to flex */
.user-details-section {
    display: none;
    flex-direction: column;
}

.user-shipto-table {
    width: 800px !important;
}

.user-shipto-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bs-table-bg, #fff);
}

#shiptoGrid {
    display: none; /* shown by adminClients.js when the user has ship-tos */
    max-height: 250px;
    overflow-y: auto;
}

/* --- Impersonation banner --- */
.impersonation-banner {
    position: sticky;
    top: 0;
    /* z-index: 9999; */
    background: #ff9800;
    color: #000;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
}

@media (max-width: 576px) {

    .admin-client-group {
    width: 100% !important;
    display: flex;
    flex-direction: row;
    gap:2rem;
    }
}
    .clients-layout {
        flex-direction: column;
    }
    .clients-section {
         order: 1; 
        }
    .settings-section { order: 2; padding-top: 1rem !important; }
    /* .users-section { order: 3; } */

    #clientList,
    #userList {
        max-width: 100%;
    }

    #clientSearch {
        max-width: 100%;
    }

    #clientsettings, #usersettings {
        padding-top: 1rem;
        margin-top: 1rem;
    }

/* --- Admin/Editor --- */

.editor-wrapper {
    max-width: 900px;
    margin-bottom: 1rem;
}

#editor {
    min-height: 400px;
    font-size: 1rem;
    background: #fff;
}

.editor-actions {
    margin-top: 0.75rem;
}

.btn-editor-action {
    padding: 0.3rem 1.2rem;
    background: #fff;
    border: 1px solid #adb5bd;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-editor-action:hover {
    background: #e9ecef;
}

/* --- ContactPage (overrides) --- */

.spacer_white {
    height: 15px !important;
    background-color: #ddd;
}

.contact-cards .m-page-wrap {
    margin-top: 10px;
    background-color: rgb(240, 240, 240);
}

.home-left--contact {
    max-width: 30% !important;
}

/* ContactPage switchboard lines: icon + labelled tel:/mailto: link */
.contact-lines { list-style: none; padding-left: 0; margin: 1rem 0; }
.contact-lines li { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.contact-line-icon { width: 18px; height: 18px; }
.contact-lines a { text-decoration: underline; }
.row-number {
    margin-right: 5px;
    text-align: left;

}
.contact-link {
    color: black;
}
/* Mobile-only header row for cart (hidden on desktop) */
.cart-mobile-header {
    display: none;
}
.boardinfo-wrapper{
    width:500px !important;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.scores-wrapper {
    width: 675px;
    max-width: 100%; /* was a fixed 675px !important that overflowed on phones */
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
.plater-input-row {
    max-width:1200px !important;
  
}
.plater-actions {
    max-width:1187px !important;
}

@media (max-width: 1399px) {
.plater-input-row {
    max-width:700px !important; 
}
.boardinfo-wrapper{
    max-width:450px !important; 
}
.plater-actions {
    max-width:675px !important;
}

}
@media (max-width: 665px) {
    .cart-mobile-header {
        display: flex;
        align-items: center;
        padding: 4px 0;
        border-bottom: 2px solid #999;
        font-weight: 700;
        font-size: 0.85rem;
        color: #555;
    }
    .cart-mobile-header .row-number-header { order: 1; width: 10px; padding: 0 4px; }
    .cart-mobile-header .cart-col-prodnum-header { order: 2; flex: 1; padding: 0 4px; }
    .cart-mobile-header .cart-col-quantity--mobile { order: 3; padding: 0 4px; }
    .cart-mobile-header .cart-col-date--mobile { order: 4; padding: 0 4px; }
}
@media (max-width: 768px) {
    .cart-mobile-header, .data-row {min-width:100% !important;}
    .row-number {
        gap:5px;
    }
    .cart-col-prodnum {
        width: 50% !important;
        padding: 5px 5px;
    }
    .cart-col-date--mobile {
        text-align:left;
    }
}

@media (max-width: 665px) {
    .slett-text { display: none; }
    .slett-icon { display: inline; }
    .apply-all-full { display: none; }
    .apply-all-mobile { display: inline; }
    .btn-slett { padding: 6px 10px; border: none; background: transparent; font-size: 24px; min-height: 44px; min-width: 44px; }
    /* border: the theme's .a-btn:hover adds a 2px border; on a touch screen the tap triggers :hover before the click, the extra 4px wraps the row and the click lands on another cell */
    .btn-slett:hover { background: transparent; border: none; }
    .cart-date-input {
        max-width: 100px;
    }
    .spacer_label {
        display: none;
    }
    .cart-col-prodnum {
        max-width: 50% !important;
        padding: 5px 5px;
    }
    .cart-col-prodnum-header {
        min-width: 50% !important;
        max-width: 55% !important;
        padding: 5px 5px;
    }
    .cart-col-quantity--mobile{
        width: 12% !important;
        padding: 5px 5px;
    }
    .cartheader_datesele1ct {
        width:100%;
    }    
    .cart-text-input {
        width: auto;
        /* min-width:220px; */
    }
    /* Two-line cart rows */
    /* Visually replaced by .cart-mobile-header, but kept for screen readers */
    #cart-table thead {
        position: absolute; width: 1px; height: 1px; overflow: hidden;
        clip: rect(0, 0, 0, 0); white-space: nowrap;
    }

    #cart-table tr.data-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid #ccc;
        padding: 4px 0;
    }

    #cart-table tr.data-row > td {
        display: block;
        border: none;
        padding: 2px 4px;
    }

    #cart-table tr.data-row > td.priority_2_column {
        display: none;
    }
    .row-number {width:3%; padding:0 0;}
    .product_header{width:50%}
    /* Line 1: row-number, product number, qty, date */
    #cart-table .row-number { order: 1; width:10px;}
    #cart-table .cart-col-prodnum { order: 2; flex: 1; font-weight: bold; }
    #cart-table td:has(.qty-wrapper) { order: 3; }
    #cart-table td:has(.date-input) { order: 4; }

    /* Line 2: description (with arrow) + trash */
    #cart-table .cart-col-desc { display: flex; order: 6; flex: 1 1 calc(100% - 60px); align-items: center; gap: 4px; }
    #cart-table .cart-col-desc .expand-mobile { display: inline; flex-shrink: 0; margin-right: 4px; }
    #cart-table td:has(.btn-slett) { order: 7; }

    /* Hide the desktop expand arrow on mobile */
    #cart-table .row-number-cell .expand-indicator { display: none; }
    #cart-table .row-number-cell 
    { flex-direction: row; 
     
    }
}
@media (max-width:500px) {
    .cart-header {
        padding-top:10px;
    }
    .cart-col-prodnum {
        max-width: 40% !important;
    }
    .clientsettings {
        max-width: 220px !important;
    }
}

@media (max-width: 525px) {
    .admin-client-group {
        flex-direction: column;
    }
    .clients-section, .clientsettings-inner, .users-section, .user-shipto-table {
        width:100% !important;
        max-width: 450px !important;
    }
    .userShipTocolumn {
        max-width: 150px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .impersonation-banner {
        margin-top:12px;
    }
}

@media (max-width: 576px) {
    #cart-table .qty-input {
        width: 35px;
    }
    .cart-mobile-header, .data-row {min-width:100% !important;}
    .cart-col-prodnum-header {
        min-width: 50% !important;
        max-width: 55% !important;
        padding: 5px 5px;
    }
    .cart-col-quantity--mobile{
        width: 15% !important;
        padding: 5px 5px;
    }

    .cart-col-date--mobile {
        text-align:left;
    }
    .date-input {
        width: 105px;
    }
    /* .plater-input-row {
        display:inline;    
    } */
    .plater-field select,
    .plater-field input {
        padding: 0.3rem 0.4rem;
        border: 1px solid #ccc;
        font-size: 0.9rem;
        width: 90px;
    }    
    .plater-field:first-child select {
        width: 80px !important;

    }

    .boardinfo-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores_input,
    .scores_field {
        width: 55px !important;
    }
    .plater-actions {
        margin-top: 2rem;
    }
}

@media (max-width: 430px) {

    .cart-col-prodnum, .cart-col-prodnum-header {
        max-width: 35% !important;
        min-width: 34% !important;
        padding: 5px 5px;
    }

    .cart-col-quantity--mobile{
        width: 20% !important;
        padding: 5px 5px;
    }
    .date-input {
         max-width: 105px;

    }
    .cart-col-prodnum {
        max-width: 120px !important;
    }
    .qty-input {
        max-width:25px;
    }
    .plater-field select,
    .plater-field input {
        padding: 0.3rem 0.4rem;
        border: 1px solid #ccc;
        font-size: 0.9rem;
        width: 80px;
    }    
    .plater-field:first-child select {
        width: 80px !important;

    }
    .boardinfo-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores_input,
    .scores_field {
        width: 45px !important;
    }    
}

@media (max-width: 400px) {
    .userShipTocolumn {
        max-width: 125px !important;
    }
    .shipto-col-header {
        max-width: 35px;
    }
}
@media (max-width: 350px) {

    .site-container {
        padding-left: 5px !important;
    }
    .cart-col-prodnum {
        max-width: 120px !important;
        padding: 5px 5px;
    }

    .cart-col-quantity--mobile, .cart-col-date--mobile {
        text-align: left;
    }

    .btn-slett { padding: 6px 10px; border: none; background: transparent; font-size: 24px; min-height: 44px; min-width: 44px; }
    .btn-slett:hover { border: none; }
    .plater-field select,
    .plater-field input {
        padding: 0.3rem 0.4rem;
        border: 1px solid #ccc;
        font-size: 0.9rem;
        width: 68px;
    }    
    .plater-field:first-child select {
        width: 70px !important;

    }
    .boardinfo-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores-wrapper {
        width:100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
    .scores_input,
    .scores_field {
        width: 50px !important;
    }

}
@media (max-width: 344px) {
    .date-input {
        max-width:95px;
    }
    .cart-col-desc {
        max-width:220px !important;
    }
}

/* --- Admin/BoardCodes --- */

.boardcodes-add-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boardcodes-input {
    max-width: 250px;
}

.boardcodes-col-inactive,
.boardcodes-col-check {
    width: 80px;
    text-align: center;
}

/* Two checkbox columns now, so the header text has to be allowed to wrap rather
   than forcing the list pane wider. */
.boardcodes-table thead th.boardcodes-col-check {
    font-size: 0.75rem;
    line-height: 1.15;
    white-space: normal;
}

/* Master/detail: the quality list on the left, its PDF and the file controls on the
   right. Same shape as .product-split on the Products list view. */
.boardcodes-split {
    display: grid;
    grid-template-columns: minmax(340px, 420px) 3fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

/* The search box and the count stay put; only the rows scroll. With 1600+ qualities
   the list is always longer than the pane beside it. */
.boardcodes-tablewrap {
    max-height: 70vh;
    overflow-y: auto;
}

.boardcodes-tablewrap .boardcodes-table {
    margin-bottom: 0;
}

.boardcodes-search {
    margin-bottom: 0.5rem;
}

.boardcodes-search__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.boardcodes-search__group input[type="search"] {
    min-width: 0;
}

.boardcodes-count {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: #5a6570;
}

/* A sticky header needs an opaque background or the rows show through it. */
.boardcodes-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-body-bg, #fff);
}

.boardcodes-cell-code {
    padding: 0;
}

/* The row link fills its cell so the whole cell is the 44px target. */
.boardcodes-row-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.2rem 0.5rem;
    color: inherit;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.boardcodes-row-link:hover,
.boardcodes-row-link:focus-visible {
    background: #f5f8fa;
    color: inherit;
}

/* Selection is carried by the border, the background and the weight — not colour alone. */
.boardcodes-table tr.is-selected .boardcodes-row-link {
    border-left-color: var(--color-brand-text);
    background: #eaf6fc;
    font-weight: 700;
}

.boardcodes-cell-file {
    font-size: 0.85rem;
    word-break: break-word;
}

.boardcodes-nofile {
    color: #5a6570;
}

.boardcodes-detail {
    background: #fff;
    border: 1px solid #e3e6e9;
    border-radius: 6px;
}

.boardcodes-detail__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.boardcodes-detail__header h3 {
    margin: 0;
    font-size: 0.9rem;
}

.boardcodes-detail__body {
    padding: 16px;
}

/* An iframe gives multi-page, zoom and print for free; the pdf.js helpers in site.js
   only ever render page 1, which is not enough for a quality spec. min-height: 0 keeps
   it from overflowing its container (same note as .user-agreement-frame). */
.boardcodes-viewer {
    width: 100%;
    height: 70vh;
    min-height: 0;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    background: #f4f4f4;
}

.boardcodes-empty {
    padding: 1rem 0;
    color: #5a6570;
}

.boardcodes-filepanel {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.boardcodes-fileform {
    flex: 1 1 260px;
    max-width: 360px;
}

.boardcodes-fileform__title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Phones: no room for two columns, so the pane stacks under the list rather than being
   hidden — unlike the Products list view, there is no overlay to fall back to and the
   upload controls live in here. A row tap navigates to ?code= and the script scrolls the
   pane into view (adminBoardCodes.js tests the same breakpoint). */
@media (max-width: 665px) {
    .boardcodes-split {
        grid-template-columns: 1fr;
    }

    .boardcodes-tablewrap {
        max-height: none;
    }

    .boardcodes-viewer {
        height: 60vh;
    }

    .boardcodes-fileform {
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    .boardcodes-add-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .boardcodes-input {
        max-width: 100%;
        width: 100%;
    }
}

/* --- Login: Remember me checkbox row --- */
.login-remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-remember-row label {
    margin: 0;
    font-weight: normal;
}

.login-forgot-password {
    margin-top: 10px;
    text-align: center;
}

/* --- Cart: Review order overlay --- */
.review-overlay-panel {
    max-width: 700px;
}

.review-order-ref {
    margin-bottom: 12px;
}

.review-overlay-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #eee;
}

.review-cancel-btn {
    min-width: 100px;
}

@media (max-width: 520px) {
    #review-table th:nth-child(4),
    #review-table td:nth-child(4) {
        display: none;
    }
}

/* --- Admin/ActivityLog --- */
.activitylog-useragent-col {
    max-width: 250px;
}

.activitylog-summary-card {
    min-width: 140px;
}

/* --- Admin/Localizations --- */
.localizations-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.localizations-search {
    max-width: 300px;
}

.localizations-status {
    color: var(--bs-success);
}

.localizations-table-wrap {
    max-height: 75vh;
    overflow-y: auto;
}

/* Three translation columns plus the key get cramped on a laptop: keep the
   value columns readable and let the table scroll sideways in its own box. */
.localizations-table {
    min-width: 900px;
}

.localizations-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: var(--bs-body-bg);
}

.localizations-col-key {
    width: 22%;
}

.localizations-key {
    font-family: monospace;
    font-size: 0.85em;
    font-weight: normal;
    text-align: left;
    word-break: break-all;
}

.localizations-value {
    width: 100%;
    resize: vertical;
}
/* ---- Admin: site settings ---- */
.sitesettings-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.sitesettings-search {
    max-width: 320px;
}

.sitesettings-status {
    color: #157347;
    font-size: .875rem;
}

.sitesettings-restart-banner {
    max-width: 900px;
}

.sitesettings-section {
    margin-bottom: 1.75rem;
    max-width: 900px;
}

.sitesettings-section-title {
    font-size: 1.05rem;
    font-weight: 600;
    padding-bottom: .35rem;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: .85rem;
}

.sitesettings-row {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: .25rem .75rem;
    align-items: center;
    padding: .4rem 0;
}

.sitesettings-label {
    font-family: monospace;
    font-size: .8125rem;
    word-break: break-all;
}

.sitesettings-badge {
    font-size: .65rem;
    margin-left: .35rem;
    vertical-align: middle;
}

.sitesettings-help {
    grid-column: 2;
    margin: 0;
    font-size: .8125rem;
    color: #6c757d;
}

.sitesettings-value:disabled {
    background-color: #e9ecef;
}

@media (max-width: 767.98px) {
    .sitesettings-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .sitesettings-help {
        grid-column: 1;
    }
}

/* --- Admin/ChatGroups --- */

.chat-group-side {
    font-size: 12px;
}

.chat-group-badge {
    font-size: 13px;
}

#groupDetail {
    display: none; /* shown by adminChatGroups.js when a group is picked or created */
}

/* --- Admin/Workflows, WorkflowInstances, WorkflowRoles --- */

#varsContent {
    max-height: 400px;
    overflow-y: auto;
}

.role-item {
    cursor: pointer;
}

/* --- Tasks --- */

.task-detail {
    max-width: 700px;
}

/* --- Admin/WorkflowDesigner --- */

.designer-wrap {
    display: flex;
    height: calc(100vh - 120px);
    overflow: hidden;
}

#bpmnCanvas {
    flex: 1;
    border-right: 1px solid #dee2e6;
    position: relative;
    min-width: 0;
}

#bpmnCanvas .bjs-container {
    height: 100%;
}

#sidePanel {
    width: 380px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sidePanel .panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.designer-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.designer-toolbar input {
    flex: 1;
    max-width: 220px;
}

.designer-toolbar #defKey {
    max-width: 160px;
}

.designer-toolbar #defVer {
    max-width: 70px;
}

#formEditorMount {
    height: 400px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.task-section {
    display: none;
}

.task-section.visible {
    display: block;
}

/* Palette "more elements" overflow menu */
.djs-palette .entry.palette-more-toggle {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.djs-palette .entry.palette-more-toggle::before {
    content: '\2026';
    font-family: inherit !important;
}

.palette-more-menu {
    position: absolute;
    left: 100%;
    bottom: 0;
    margin-left: 6px;
    width: 235px;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    padding: 6px 0;
    z-index: 20;
}

.palette-more-group-title {
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    padding: 6px 10px 2px;
}

.palette-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12.5px;
    color: #212529;
}

.palette-more-item:hover {
    background: #f1f3f5;
}

.palette-more-badge {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    border: 1.5px solid #6c757d;
    color: #495057;
    background: #fff;
    box-sizing: border-box;
}

.palette-more-badge.shape-task { border-radius: 3px; }
.palette-more-badge.shape-event { border-radius: 50%; }
.palette-more-badge.shape-event.boundary { border-style: dashed; }
.palette-more-badge.shape-artifact { border-style: dashed; border-radius: 2px; }

.palette-more-badge.shape-gateway {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
    transform: rotate(45deg);
}

.palette-more-badge.shape-gateway .badge-text {
    transform: rotate(-45deg);
    display: block;
}

/* --- Admin/WorkflowFormEditor --- */

.fje-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid #dee2e6;
    background: #f8f9fa;
}

.fje-toolbar input {
    max-width: 220px;
}

.fje-toolbar #formKey {
    max-width: 180px;
}

#formEditorCanvas {
    overflow: hidden;
}

/* --- ServiceOrders/Contract --- */

#contractTable .field-input {
    display: none; /* serviceOrdersContract.js swaps display/input while editing */
}

#contractTable.editing .field-display {
    display: none;
}

#contractTable.editing .field-input {
    display: block;
}

/* --- Admin/Satisfaction --- */
/* The tab strip is the shared .page-tabs in site.css. */

/* Distribution and trend bars. <progress> is used instead of a div with a width so the
   markup carries no inline style and the value is exposed to assistive technology. */

.rating-dist__score {
    width: 2rem;
    font-weight: 600;
}

.rating-dist__bar-cell {
    width: 60%;
}

.rating-dist__bar,
.trend-bar {
    width: 100%;
    height: 0.9rem;
    vertical-align: middle;
    border: none;
    background: #eef1f3;
    border-radius: 4px;
}

.trend-bar {
    width: 70px;
    margin-left: 0.5rem;
}

.rating-dist__bar::-webkit-progress-bar,
.trend-bar::-webkit-progress-bar {
    background: #eef1f3;
    border-radius: 4px;
}

.rating-dist__bar::-webkit-progress-value,
.trend-bar::-webkit-progress-value {
    background: #01A1DD;
    border-radius: 4px;
}

.rating-dist__bar::-moz-progress-bar,
.trend-bar::-moz-progress-bar {
    background: #01A1DD;
    border-radius: 4px;
}

/* A week that mixes two wordings: the average in that row is not comparing like with
   like, so it is marked rather than left to look like every other row. */
.trend-row--mixed {
    background: #fffaf0;
}

.prompt-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.prompt-card__title {
    font-size: 1rem;
    margin: 0;
}

.prompt-card__version {
    color: var(--color-muted);
    font-weight: 400;
}

.prompt-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.prompt-card__stats {
    margin: 0.75rem 0 0.5rem;
}

.prompt-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.prompt-text {
    border-top: 1px solid #eef1f3;
    padding: 0.5rem 0;
}

.prompt-text__summary {
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prompt-text__lang {
    display: inline-block;
    min-width: 3.5rem;
    font-weight: 600;
    color: #5a6570;
}

.prompt-text__form,
.prompt-text__readonly {
    padding: 0.5rem 0 0.25rem;
}

@media (max-width: 665px) {
    .prompt-card__actions .a-btn {
        width: 100%;
    }
}
