:root {
    --bg: #f5f7fa;
    --panel: #ffffff;
    --text: #172033;
    --muted: #6b7280;
    --border: #e5e7eb;
    --accent: #1f2937;
    --accent-soft: #eef2f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 250px;
    flex: 0 0 250px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 20px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 700;
}

.brand-title {
    font-weight: 700;
    font-size: 18px;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-link {
    text-decoration: none;
    color: var(--text);
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.active {
    background: var(--accent-soft);
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 28px;
}

.page-header {
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0;
    font-size: 30px;
}

.page-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.card-header h2 {
    margin: 0;
    font-size: 20px;
}

.card-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.button {
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: white;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    opacity: 0.9;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 12px 10px;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Nesting > Offcut Lookup: slightly denser data grid without affecting other tables. */
.offcut-lookup-table {
    width: 86%;
    font-size: 13px;
    table-layout: fixed;
}
.offcut-lookup-table .lookup-col-colour { width: 30%; }
.offcut-lookup-table .lookup-col-length { width: 9%; }
.offcut-lookup-table .lookup-col-width { width: 9%; }
.offcut-lookup-table .lookup-col-thickness { width: 10%; }
.offcut-lookup-table .lookup-col-location { width: 16%; }
.offcut-lookup-table .lookup-col-date { width: 26%; }
.offcut-lookup-table th:first-child,
.offcut-lookup-table td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.offcut-lookup-table th,
.offcut-lookup-table td {
    padding: 7px 8px;
    line-height: 1.2;
}
.offcut-lookup-table th {
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.error {
    color: #b91c1c;
}

.empty-state {
    border: 1px dashed var(--border);
    border-radius: 14px;
    padding: 32px;
    text-align: center;
    background: #fafafa;
}

.empty-state h3 {
    margin: 0 0 8px;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 800px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-link {
        padding: 10px 12px;
    }

    .main-content {
        padding: 18px;
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.search-group {
    flex: 1;
    min-width: 240px;
}

.search-group label,
.form-grid label span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
}

.input:focus {
    outline: 2px solid #dbeafe;
    border-color: #93c5fd;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: #f8fafc;
}

.inactive-row {
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    font-weight: 700;
}

.status-pill.active {
    background: #dcfce7;
    color: #166534;
}

.status-pill.inactive {
    background: #f3f4f6;
    color: #4b5563;
}

.message {
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    font-weight: 700;
}

.message.success {
    background: #dcfce7;
    color: #166534;
}

.message.error {
    background: #fee2e2;
    color: #991b1b;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: grid;
    place-items: center;
    padding: 20px;
    z-index: 50;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal {
    width: min(620px, 100%);
    background: var(--panel);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.25);
    padding: 22px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.modal-header h2 {
    margin: 0;
}

.icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #f3f4f6;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid label:first-of-type,
.form-grid label:nth-of-type(2) {
    grid-column: span 2;
}

.form-toggle {
    align-self: center;
}

.modal-actions {
    grid-column: span 2;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.button.secondary {
    background: #e5e7eb;
    color: var(--text);
}

code {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 2px 6px;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid label:first-of-type,
    .form-grid label:nth-of-type(2),
    .modal-actions {
        grid-column: span 1;
    }

    .modal-actions {
        flex-direction: column-reverse;
    }

    .modal-actions .button {
        width: 100%;
    }
}

.raw-layout {
    display: grid;
    grid-template-columns: 380px minmax(0, 1fr);
    gap: 18px;
}

.raw-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: #fff;
    min-width: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.panel-title-row h3 {
    margin: 0;
    font-size: 18px;
}

.raw-detail-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.raw-detail-title-row > h3 {
    justify-self: start;
}

.raw-file-count {
    min-width: 68px;
    text-align: right;
    white-space: nowrap;
}

.machine-choice {
    display: flex;
    align-items: center;
    gap: 6px;
}

.machine-choice-button {
    min-width: 100px;
    padding: 10px 14px;
    white-space: nowrap;
}

.button.secondary.machine-choice-button.selected,
.button.secondary.machine-choice-button.selected:hover:not(:disabled),
.machine-choice-button[aria-pressed="true"] {
    background: #15803d !important;
    color: #fff !important;
    border-color: #166534 !important;
    box-shadow: 0 0 0 2px rgba(21, 128, 61, 0.20);
    opacity: 1 !important;
}

.machine-choice-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.path-note {
    color: var(--muted);
    font-size: 12px;
    word-break: break-word;
    margin-bottom: 12px;
}

.folder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-item {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text);
}

.folder-item:hover,
.folder-item.selected {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.small-text {
    font-size: 12px;
    margin-top: 3px;
}

.compact {
    padding: 22px;
}

.job-row {
    display: grid;
    grid-template-columns: 170px 120px auto auto;
    gap: 12px;
    align-items: end;
    justify-content: start;
    margin-bottom: 16px;
}

.job-machine-choice {
    align-self: end;
    justify-content: flex-start;
}

.job-row label span {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fafafa;
}

.raw-files-wrap {
    max-height: 460px;
    overflow: auto;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.rover-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.rover-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rover-queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.rover-queue-item {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 17px 16px;
    min-height: 68px;
    background: #fff;
    cursor: pointer;
}

.rover-queue-item:hover,
.rover-queue-item.selected {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.rover-queue-item input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.rover-queue-name {
    font-weight: 700;
}

.rover-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rover-queue-item .rover-row-actions .button {
    min-width: 82px;
}

.rover-rename-input {
    width: 100%;
    min-width: 180px;
}

.rover-queue-item-renaming {
    cursor: default;
}

@media (max-width: 900px) {
    .raw-layout {
        grid-template-columns: 1fr;
    }

    .job-row,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .job-row .button {
        width: 100%;
    }

    .raw-detail-title-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .machine-choice {
        justify-content: flex-start;
    }

    .raw-file-count {
        text-align: left;
    }

    .rover-toolbar {
        align-items: flex-start;
    }

    .rover-toolbar-left {
        justify-content: flex-start;
    }

    .rover-queue-item {
        grid-template-columns: auto 1fr;
    }

    .rover-queue-item .muted {
        grid-column: 2;
    }

    .rover-row-actions {
        grid-column: 2;
        justify-content: flex-start;
    }

    .rover-rename-input {
        grid-column: 2;
    }
}

.jobs-layout {
    display: grid;
    grid-template-columns: minmax(420px, 1fr) minmax(300px, 380px);
    gap: 18px;
}

.jobs-info-grid {
    grid-template-columns: 1fr;
}

.action-row,
.button-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.winstore-rename-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.winstore-rename-row .input {
    flex: 1 1 220px;
    min-width: 0;
}

.secondary-button {
    background: #e5e7eb;
    color: var(--text);
    text-decoration: none;
    display: inline-block;
}

.button.danger {
    background: #b91c1c;
}

.text-break {
    overflow-wrap: anywhere;
}

.material-select {
    min-width: 260px;
}

@media (max-width: 900px) {
    .jobs-layout,
    .jobs-info-grid {
        grid-template-columns: 1fr;
    }

    .material-select {
        min-width: 180px;
    }
}

.status-good-text {
    color: #166534;
    font-weight: 700;
}

.status-bad-text {
    color: #b91c1c;
    font-weight: 700;
}

.link-summary-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    background: #f8fafc;
}

.link-summary-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.link-summary-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-summary-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    background: #fff;
}

.linked-material {
    font-weight: 700;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .link-summary-row {
        grid-template-columns: 1fr;
    }
}

.wide-modal {
    width: min(820px, 100%);
}

.small-control {
    flex: 0 0 220px;
}

.status-pill.assigned {
    background: #fef3c7;
    color: #92400e;
}

.tab-bar {
    display: flex;
    gap: 8px;
    margin: 4px 0 18px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.tab-button {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 11px 14px;
    font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}

.tab-button:hover {
    color: var(--text);
}

.tab-button.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.tab-panel[hidden] {
    display: none;
}

.modal-detail {
    color: var(--text);
    line-height: 1.45;
    margin: 0 0 18px;
}

.single-row-actions {
    grid-column: auto;
    margin-top: 0;
}

.input-button-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.input-button-row .input {
    min-width: 0;
}

.small-button {
    padding: 8px 12px;
    white-space: nowrap;
}


/* Public board offcuts page */
.public-page {
    background: #f4f6f8;
    color: #172033;
}

.public-container {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.public-shell {
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.public-heading-frame {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.public-logo {
    width: 120px;
    max-width: 120px;
    height: auto;
    display: block;
}

.public-title-block h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.08;
}

.public-title-block p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.public-card {
    padding: 22px 24px 26px;
    background: #ffffff;
}

.public-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

.public-tab {
    border: 1px solid var(--border);
    border-bottom: 0;
    background: #f7f9fb;
    color: var(--text);
    padding: 11px 18px;
    border-radius: 12px 12px 0 0;
    font-weight: 700;
    cursor: default;
}

.public-tab.active {
    background: #ffffff;
    position: relative;
    top: 1px;
}

.public-tab-panel {
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 16px 16px;
    padding: 20px;
    background: #ffffff;
}

.public-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.public-section-heading h2 {
    margin: 0;
    font-size: 20px;
}

.public-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
    align-items: end;
    margin-bottom: 18px;
}

.public-search-label {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.public-search {
    font-size: 17px;
    padding: 12px 14px;
}

.public-table th,
.public-table td {
    font-size: 16px;
}

@media (max-width: 800px) {
    .public-heading-frame {
        grid-template-columns: 86px 1fr;
        gap: 14px;
        padding: 14px 16px;
    }

    .public-logo {
        width: 86px;
        max-width: 86px;
    }

    .public-title-block h1 {
        font-size: clamp(22px, 7vw, 30px);
    }

    .public-title-block p {
        font-size: 13px;
    }

    .public-toolbar {
        grid-template-columns: 1fr;
    }

    .public-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-container {
        width: min(100% - 20px, 1080px);
        padding-top: 12px;
    }

    .public-card {
        padding: 16px;
    }

    .public-tab-panel {
        padding: 16px;
    }
}

/* Compact offcut dialogs and Stone Slabs toolbar */
.offcut-modal-compact { width: min(680px, 100%); }
.manage-search-compact { flex: 0 1 380px; min-width: 260px; }
.type-control { flex: 0 0 180px; }
.setup-action-buttons { display:flex; gap:8px; flex-wrap:wrap; }
.hidden-file-input { display:none; }

/* Stone slab add/manage layout */
.stone-type-job-row {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 14px;
}
.stone-type-job-row label { grid-column: auto !important; }
@media (max-width: 640px) {
    .stone-type-job-row { grid-column: span 1; grid-template-columns: 1fr; }
}

/* Inventory application navigation/refactor */
.app-shell.no-sidebar .main-content {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}
.brand-link {
    color: inherit;
    text-decoration: none;
}
.nav-section-title {
    margin: 0 0 10px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.secondary-nav-section-title {
    margin-top: 24px;
}
.sidebar-footer {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.sidebar-footer a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
}
.home-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}
.home-tile {
    display: block;
    min-height: 210px;
    padding: 28px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    transition: transform .12s ease, box-shadow .12s ease;
}
.home-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}
.home-tile-icon {
    width: 48px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    margin-bottom: 20px;
}
.home-tile h2 { margin: 0 0 10px; }
.home-tile p { margin: 0; color: var(--muted); line-height: 1.5; }
.empty-workspace-card { min-height: 300px; display: grid; align-items: center; }
.link-directory {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 18px;
}
.link-group {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
}
.link-group h3 { margin: 0 0 12px; }
.link-group a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    padding: 10px 8px;
    border-radius: 8px;
    font-weight: 700;
}
.link-group a:hover { background: var(--accent-soft); }
.link-group a span { color: var(--muted); font-weight: 400; font-family: monospace; }
.two-column-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 20px;
}
.sub-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
}
.compact-header { margin-bottom: 14px; }
@media (max-width: 900px) {
    .home-grid, .link-directory, .two-column-panels { grid-template-columns: 1fr; }
}



/* Stores > Bins category tabs. */
.stores-bin-tabs {
    display:flex;
    gap:5px;
    flex-wrap:wrap;
    padding:7px;
    background:#eef1f5;
    border:1px solid #d7dce3;
    border-radius:9px;
    margin:0 0 16px;
}
.stores-bin-tab {
    border:1px solid transparent;
    border-radius:7px;
    background:transparent;
    color:#596273;
    padding:8px 13px;
    font-weight:700;
    cursor:pointer;
}
.stores-bin-tab:hover { background:#fff; color:#111827; }
.stores-bin-tab.active {
    background:#fff;
    color:#111827;
    border-color:#cfd5dd;
    box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.stores-bin-panel { margin-top:0; }
/* Stores > Bins: compact rows without changing text sizes. */
.stores-bin-panel table thead th { padding:8px 10px; }
.stores-bin-panel table tbody td { padding:6px 10px; vertical-align:middle; }
/* Stores > Bins: align the list text and headings with Goods Issue. */
.stores-bin-panel thead th { font-size:12px; }
.stores-bin-panel tbody td,
.stores-bin-panel tbody .status-pill { font-size:14px; }
@media(max-width:800px){
    .stores-bin-tabs{overflow-x:auto;flex-wrap:nowrap;}
    .stores-bin-tab{white-space:nowrap;}
}


/* Catalogue management shell */
.catalogue-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.catalogue-grid .empty-state {
    margin-top: 16px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    background: #f8fafc;
}
@media (max-width: 900px) {
    .catalogue-grid { grid-template-columns: 1fr; }
}

/* Catalogue management */
.catalogue-category-card { margin-bottom: 18px; }
.catalogue-reconcile-actions {
    min-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
}
.catalogue-reconcile-actions > label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.catalogue-reconcile-user-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
}
.catalogue-reconcile-user-help {
    max-width: 520px;
    font-size: 12px;
    line-height: 1.35;
}
.catalogue-toolbar { align-items: center; }
.catalogue-summary { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.catalogue-category-table th:nth-child(1) { min-width: 220px; }
.catalogue-category-table th:nth-child(3) { min-width: 280px; }
.catalogue-category-table th:nth-child(6) { min-width: 135px; }
.catalogue-source-line { margin-top: 6px; }
.catalogue-uid { font-size: 12px; color: #475569; white-space: nowrap; }
.catalogue-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.catalogue-group-select { min-width: 120px; padding: 8px 10px; }
.catalogue-reconcile-card h2 { margin-top: 0; }
.catalogue-next-stage {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
}
.catalogue-next-stage strong { color: var(--text); }
@media (max-width: 900px) {
    .catalogue-reconcile-actions { min-width: 0; width: 100%; }
    .catalogue-reconcile-user-row { grid-template-columns: 1fr; }
    .catalogue-summary { white-space: normal; }
    .catalogue-category-table th:nth-child(3) { min-width: 220px; }
}

/* Compact Board catalogue reconciliation list */
/* Keep this page on the same outer card/layout rules as Item Categories.
   Only the data grid is allowed to be wider than the page. */
.catalogue-category-card {
    min-width: 0;
    max-width: 100%;
}
.catalogue-category-links { margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.catalogue-category-links-label { font-weight: 700; color: var(--text); }
.catalogue-items-toolbar {
    align-items: end;
    margin-top: 12px;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}
.catalogue-items-search { flex: 1 1 360px; max-width: 620px; min-width: 220px; }
.catalogue-filter-group { flex: 0 1 125px; min-width: 115px; }
.catalogue-biesse-filter { flex-basis: 165px; }
.catalogue-filter-group label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.catalogue-filter-group .input { width: 100%; min-width: 0; }

/*
   The Board catalogue uses a true two-part grid:
   - this OUTER frame owns horizontal scrolling only;
   - the header is a normal non-sticky table, so rows can never render behind it;
   - the body owns vertical scrolling only.
   This deliberately avoids sticky table-header browser quirks in two-axis scrollers.
*/
.catalogue-grid-x-scroll {
    --catalogue-grid-width: 1355px;
    --catalogue-scrollbar-space: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
    overscroll-behavior-x: contain;
}
.catalogue-grid-inner {
    width: calc(var(--catalogue-grid-width) + var(--catalogue-scrollbar-space));
    min-width: calc(var(--catalogue-grid-width) + var(--catalogue-scrollbar-space));
    background: var(--panel);
}
.catalogue-grid-body-scroll {
    width: calc(var(--catalogue-grid-width) + var(--catalogue-scrollbar-space));
    max-height: calc(100vh - 330px);
    min-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    background: var(--panel);
}
.catalogue-items-table {
    font-size: 12px;
    white-space: nowrap;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: var(--catalogue-grid-width);
    min-width: var(--catalogue-grid-width);
    max-width: var(--catalogue-grid-width);
    background: var(--panel);
}
.catalogue-items-header-table {
    border-bottom: 1px solid var(--border);
}
.catalogue-items-header-table th {
    background: var(--panel);
}
.catalogue-items-body-table {
    margin: 0;
}
.catalogue-items-table col.catalogue-col-id { width: 54px; }
.catalogue-items-table col.catalogue-col-name { width: 300px; }
.catalogue-items-table col.catalogue-col-category { width: 130px; }
.catalogue-items-table col.catalogue-col-status { width: 90px; }
.catalogue-items-table col.catalogue-col-dimension { width: 72px; }
.catalogue-items-table col.catalogue-col-uid { width: 275px; }
.catalogue-items-table col.catalogue-col-code { width: 120px; }
.catalogue-items-table col.catalogue-col-material-code { width: 170px; }
.catalogue-items-table th,
.catalogue-items-table td { padding: 5px 7px; line-height: 1.18; vertical-align: middle; }
.catalogue-items-table th:nth-child(2),
.catalogue-items-table td:nth-child(2) { white-space: normal; }
.catalogue-items-table th:nth-child(4),
.catalogue-items-table td:nth-child(4),
.catalogue-items-table th:nth-child(5),
.catalogue-items-table td:nth-child(5),
.catalogue-items-table th:nth-child(6),
.catalogue-items-table td:nth-child(6),
.catalogue-items-table th:nth-child(7),
.catalogue-items-table td:nth-child(7) { text-align: center; }
.catalogue-id-cell { text-align: right; font-variant-numeric: tabular-nums; }
.catalogue-dimension-cell { text-align: center; font-variant-numeric: tabular-nums; }
.catalogue-status-cell { text-align: center; }
.catalogue-deleted-row td { background: #fff1f2; }
.catalogue-deleted-row .status-pill.inactive { background: #fee2e2; color: #991b1b; }
.catalogue-item-uid { font-size: 11px; color: #475569; }
.catalogue-code-cell { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; }
.catalogue-code-missing { color: var(--muted); }
.catalogue-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }
.catalogue-page-label { min-width: 105px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
@media (max-width: 900px) {
    .catalogue-filter-group,
    .catalogue-biesse-filter { flex: 1 1 180px; }
}


/* Catalogue Items Board / Stone tabs */
.catalogue-item-tabs { margin-top: 0; }
.stone-catalogue-grid { --catalogue-grid-width: 1065px; }


/* Stores -> Add to Winstore */
.winstore-add-card { min-width: 0; max-width: 100%; }
.winstore-add-header { align-items: flex-end; }
.winstore-destination { margin-top: 8px; font-size: 13px; }
.winstore-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.winstore-code-tabs { margin: 0 0 14px; }
.winstore-toolbar { align-items: end; gap: 12px; flex-wrap: wrap; }
.winstore-search { flex: 1 1 360px; max-width: 620px; }
.winstore-grid-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--panel);
}
.winstore-items-table {
    min-width: 1260px;
    table-layout: fixed;
    font-size: 12px;
}
.winstore-items-table th,
.winstore-items-table td { padding: 6px 7px; line-height: 1.2; vertical-align: middle; }
.winstore-items-table th:nth-child(1) { width: 38px; }
.winstore-items-table th:nth-child(2) { width: 55px; }
.winstore-items-table th:nth-child(3) { width: 300px; }
.winstore-items-table th:nth-child(4) { width: 135px; }
.winstore-items-table th:nth-child(5) { width: 120px; text-align: center; }
.winstore-items-table th:nth-child(6) { width: 105px; text-align: center; }
.winstore-items-table th:nth-child(7) { width: 130px; }
.winstore-items-table th:nth-child(8) { width: 175px; }
.winstore-items-table th:nth-child(9) { width: 285px; }
.winstore-offcut-cell { text-align: center; }
.winstore-items-table tbody tr[data-item-id] { cursor: pointer; }
.winstore-items-table tbody tr[data-item-id]:hover td { background: #f8fafc; }
.winstore-items-table tbody tr.selected-row td { background: #eef2f7; }
.winstore-select-col { text-align: center; }
.message.info { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
@media (max-width: 900px) {
    .winstore-add-header { align-items: flex-start; }
    .winstore-actions { justify-content: flex-start; }
}

.winstore-connection-ok { color:#166534; font-weight:700; }
.winstore-connection-warn { color:#92400e; font-weight:700; }
.winstore-connection-error { color:#b91c1c; font-weight:700; }

/* Board offcut touchscreen prototype */
.offcut-modal-open { overflow: hidden; }
.offcut-kiosk {
    width: 100%;
    height: calc(100vh - 56px);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(265px, 1.15fr);
    gap: 18px;
}
.offcut-entry-panel,
.offcut-recent-panel {
    min-width: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
.offcut-entry-panel {
    padding: 18px;
    display: flex;
    min-height: 0;
    flex-direction: column;
}
.offcut-kiosk-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}
.offcut-kiosk-eyebrow { font-size: 13px; letter-spacing: .10em; font-weight: 900; color: #475569; }
.offcut-clock { font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; color: #475569; }
.offcut-filter-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dbe1e8;
}
.offcut-filter {
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #f8fafc;
    color: #334155;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}
.offcut-filter.active { background: #1f2937; color: #fff; border-color: #1f2937; }
.offcut-search-row { display: grid; grid-template-columns: 380px 90px minmax(0, 1fr); column-gap: 12px; align-items: center; margin-bottom: 10px; }
.offcut-search-input {
    width: 100%;
    height: 46px;
    border: 2px solid #cbd5e1;
    border-radius: 11px;
    padding: 0 14px;
    background: #fff;
    color: #0f172a;
    font-size: 20px;
    font-weight: 800;
}
.offcut-search-clear {
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 11px;
    background: #eef2f7;
    font-weight: 800;
    font-size: 16px;
    cursor: pointer;
}
.touch-keyboard { margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.touch-keyboard-row { display: flex; justify-content: center; gap: 7px; }
.touch-keyboard button {
    flex: 0 0 68px;
    width: 68px;
    max-width: 68px;
    min-width: 68px;
    height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #334155;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}
.touch-keyboard button:active { background: #dbe4ee; transform: translateY(1px); }
.touch-keyboard .keyboard-wide { flex: 0 0 112px; width: 112px; max-width: 112px; min-width: 112px; font-size: 14px; }
.touch-keyboard .keyboard-action { flex: 0 0 76px; width: 76px; max-width: 76px; min-width: 76px; background: #e2e8f0; font-size: 18px; }
.offcut-add-button,
.offcut-jobman-button,
.numberpad-ok {
    border: 0;
    border-radius: 11px;
    background: #1f2937;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.offcut-add-button { min-width: 140px; height: 46px; padding: 0 18px; font-size: 15px; }
.offcut-add-button.top-action { min-width: 190px; width: 190px; height: 46px; justify-self: end; margin-left: 18px; font-size: 17px; background: #166534; }
.offcut-add-button:disabled,
.offcut-jobman-button:disabled { opacity: .35; cursor: not-allowed; }
.offcut-list-head { display: flex; justify-content: space-between; align-items: center; padding: 0 3px 7px; font-size: 13px; }
.offcut-list-head span { color: var(--muted); }
.offcut-material-list {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #dbe1e8;
    border-radius: 12px;
    background: #fff;
}
.offcut-material-row {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: #fff;
    padding: 9px 12px;
    text-align: left;
    cursor: pointer;
    color: #1f2937;
    touch-action: manipulation;
}
.offcut-material-row:last-child { border-bottom: 0; }
.offcut-material-row:hover { background: #f8fafc; }
.offcut-material-row.selected { background: #dcfce7; box-shadow: inset 6px 0 #16a34a; }
.offcut-material-name { min-width: 0; font-size: 14px; line-height: 1.25; font-weight: 700; }
.offcut-material-meta { flex: 0 0 auto; min-width: 55px; padding: 5px 7px; border-radius: 999px; background: #eef2f7; color: #475569; text-align: center; font-size: 11px; font-weight: 800; }
.offcut-no-results, .offcut-no-bins { padding: 26px; text-align: center; color: var(--muted); }
.offcut-recent-panel { padding: 17px; display: flex; min-height: 0; flex-direction: column; background: #f8fafc; }
.recent-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.recent-heading span:first-child { color: #64748b; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.recent-heading h2 { margin: 3px 0 0; font-size: 20px; }
.offcut-refresh-button {
    flex: 0 0 auto;
    width: 66px;
    height: 42px;
    padding: 3px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #eef2f7;
    color: #334155;
    font-family: inherit;
    font-size: 11px;
    line-height: 1.05;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}
.offcut-refresh-button span { color: inherit; font: inherit; text-transform: none; letter-spacing: 0; }
.offcut-refresh-button:active:not(:disabled) { background: #dbe4ee; transform: translateY(1px); }
.offcut-refresh-button:disabled { opacity: .6; cursor: default; }
.offcut-refresh-button.refreshing span { opacity: .75; }
.recent-help { margin: 10px 0 12px; color: #64748b; font-size: 12px; line-height: 1.35; }
.recent-offcut-list { min-height: 0; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; }
.recent-empty { padding: 22px 12px; border: 1px dashed #cbd5e1; border-radius: 12px; text-align: center; color: #64748b; font-size: 13px; }
.recent-offcut-card { padding: 11px; border: 1px solid #dbe1e8; border-radius: 12px; background: #fff; }
.recent-card-top { display: flex; justify-content: space-between; gap: 8px; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.recent-card-top strong { color: #0f172a; }
.recent-offcut-card h3 { margin: 6px 0; font-size: 13px; line-height: 1.25; }
.recent-dimensions { font-size: 14px; font-weight: 800; color: #334155; margin-bottom: 8px; }
.recent-delete { width: 100%; height: 34px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #b91c1c; font-weight: 800; cursor: pointer; }
.recent-delete.confirm { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.offcut-modal-backdrop,
.numberpad-backdrop {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
    padding: 18px;
}
.offcut-modal-backdrop { z-index: 1000; }
.offcut-modal-backdrop[hidden], .offcut-toast[hidden] { display: none !important; }
.offcut-modal {
    width: min(980px, 96vw);
    max-height: 94vh;
    overflow-y: auto;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.28);
    padding: 20px;
}
.offcut-modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.offcut-modal-header span, .offcut-modal-section-heading span { color: #64748b; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.offcut-modal-header h2 { margin: 2px 0 0; font-size: 24px; }
.offcut-modal-close { width: 44px; height: 44px; border: 0; border-radius: 10px; background: #eef2f7; color: #334155; font-size: 30px; line-height: 1; cursor: pointer; }
.offcut-modal-material { margin: 13px 0 15px; padding: 12px 14px; border-radius: 11px; background: #eff6ff; color: #1e3a8a; font-size: 16px; font-weight: 800; }
.offcut-popup-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: start; }
.offcut-popup-left, .offcut-popup-right { min-width: 0; }
.offcut-modal-section-heading.compact { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.offcut-modal-section-heading.compact h3 { margin: 2px 0 0; font-size: 18px; }
.offcut-modal-section-heading.compact > strong, .offcut-modal-section-heading.compact > small { color: #64748b; font-size: 12px; }
.offcut-bin-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 470px;
    overflow-y: auto;
    border: 1px solid #dbe1e8;
    border-radius: 12px;
    padding: 8px;
    background: #f8fafc;
}
.offcut-bin-button {
    width: 100%;
    min-height: 50px;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    text-align: left;
    padding: 0 14px;
}
.offcut-bin-button.selected { background: #dcfce7; color: #166534; border-color: #22c55e; }
.offcut-size-stack { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.offcut-size-card { min-height: 88px; border: 2px solid #cbd5e1; border-radius: 13px; padding: 12px 14px; background: #fff; text-align: left; color: #334155; }
button.offcut-size-card { cursor: pointer; }
.offcut-size-card.editable { border-color: #cbd5e1; background: #fff; }
.offcut-size-card.editable.active { border-color: #22c55e; background: #dcfce7; }
.offcut-size-card span { display: block; color: #64748b; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.offcut-size-card strong { display: block; margin: 8px 0 3px; color: #0f172a; font-size: 30px; line-height: 1; }
.offcut-size-card small { color: #64748b; }
.inline-numberpad { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.inline-numberpad-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.inline-numberpad-row.actions { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.inline-numberpad button {
    min-height: 62px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
}
.inline-numberpad button:active { background: #e2e8f0; }
.inline-numberpad .clear { font-size: 16px; color: #b91c1c; background: #fff1f2; }
.inline-numberpad .back { font-size: 18px; background: #eef2f7; }
.inline-numberpad .ok { font-size: 16px; background: #dcfce7; color: #166534; }
.offcut-confirm-strip { margin-top: 4px; padding: 12px 14px; border-radius: 11px; background: #f1f5f9; color: #475569; text-align: center; font-size: 14px; font-weight: 800; }
.offcut-confirm-strip.ready { background: #dcfce7; color: #166534; }
.offcut-modal-actions { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; margin-top: 13px; }
.offcut-cancel-button { min-height: 54px; font-size: 15px; }
.offcut-jobman-button { min-height: 54px; font-size: 18px; }
.offcut-toast { position: fixed; left: 50%; bottom: 26px; z-index: 1200; transform: translateX(-50%); min-width: 310px; max-width: 80vw; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 30px rgba(15,23,42,.18); text-align: center; font-size: 14px; font-weight: 800; }
.offcut-toast.success { background: #166534; color: #fff; }
.offcut-toast.info { background: #1e3a8a; color: #fff; }
.offcut-toast.warn { background: #92400e; color: #fff; }

@media (max-width: 1050px) {
    .offcut-kiosk { grid-template-columns: minmax(0, 3fr) minmax(235px, 1fr); gap: 12px; }
    .offcut-entry-panel, .offcut-recent-panel { padding: 14px; }
    .offcut-search-row { grid-template-columns: 280px 90px 160px; column-gap: 10px; }
    .touch-keyboard button { height: 40px; }
    .offcut-popup-layout { grid-template-columns: 210px minmax(0, 1fr); }
    .inline-numberpad button { min-height: 58px; }
}
@media (max-width: 760px) {
    .offcut-kiosk { height: auto; grid-template-columns: 1fr; }
    .offcut-entry-panel { min-height: 760px; }
    .offcut-recent-panel { min-height: 300px; }
    .offcut-filter-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .offcut-search-row { grid-template-columns: minmax(0, 1fr) 88px; }
    .offcut-search-row .top-action { grid-column: 1 / -1; margin-left: 0; }
    .offcut-add-button.top-action { min-width: 0; height: 58px; }
    .offcut-popup-layout { grid-template-columns: 1fr; }
    .offcut-bin-list { max-height: 180px; }
}

/* Offcut popup v28: strict two-column kiosk layout */
.offcut-popup-split {
    display: grid !important;
    grid-template-columns: 220px minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
    width: 100%;
}
.offcut-bin-panel,
.offcut-entry-panel-popup {
    min-width: 0;
    border: 1px solid #dbe1e8;
    border-radius: 14px;
    background: #f8fafc;
    padding: 14px;
}
.offcut-bin-panel {
    display: flex;
    flex-direction: column;
    max-height: 535px;
}
.offcut-entry-panel-popup {
    display: flex;
    flex-direction: column;
}
.offcut-panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex: 0 0 auto;
}
.offcut-panel-heading span {
    display: block;
    color: #64748b;
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .08em;
}
.offcut-panel-heading h3 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 18px;
}
.offcut-panel-heading strong,
.offcut-panel-heading small {
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}
.offcut-bin-panel .offcut-bin-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    align-content: start !important;
    min-height: 0;
    max-height: none !important;
    flex: 1 1 auto;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 6px !important;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
}
.offcut-bin-panel .offcut-bin-button {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    flex: 0 0 auto !important;
    padding: 0 8px !important;
    text-align: center !important;
    font-size: 13px !important;
}
.offcut-entry-panel-popup .offcut-size-stack {
    width: min(100%, 420px);
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px;
    margin-bottom: 12px;
}
.offcut-entry-panel-popup .offcut-size-card {
    min-height: 78px;
    width: 100%;
}
.offcut-entry-panel-popup .inline-numberpad {
    width: min(100%, 420px);
    margin: 0 0 12px;
}
.offcut-entry-panel-popup .inline-numberpad-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.offcut-entry-panel-popup .inline-numberpad-row.actions {
    grid-template-columns: 1.25fr 1fr 1fr 1fr;
}
.offcut-entry-panel-popup .inline-numberpad button {
    min-height: 54px;
}
.offcut-entry-panel-popup .offcut-confirm-strip {
    width: 100%;
    margin-top: auto;
}
.offcut-entry-panel-popup .offcut-modal-actions {
    width: 100%;
}
@media (max-width: 760px) {
    .offcut-popup-split {
        grid-template-columns: 220px minmax(0, 1fr) !important;
    }
    .offcut-bin-panel,
    .offcut-entry-panel-popup {
        padding: 10px;
    }
}

/* Offcut popup v29: compact size controls with matched panel heights */
.offcut-popup-split {
    grid-template-columns: 280px minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
}
.offcut-bin-panel,
.offcut-entry-panel-popup {
    height: 482px !important;
    max-height: 482px !important;
    box-sizing: border-box;
}
.offcut-bin-panel {
    padding: 10px !important;
}
.offcut-bin-status {
    flex: 0 0 auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}
.offcut-bin-panel .offcut-bin-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
}
.offcut-entry-panel-popup {
    padding: 14px !important;
    display: flex !important;
    flex-direction: column !important;
}
.offcut-size-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
    flex: 0 0 auto;
}
.offcut-size-field {
    width: 170px;
    min-width: 0;
}
.offcut-size-field label {
    display: block;
    margin: 0 0 5px 2px;
    color: #475569;
    font-size: 13px;
    font-weight: 800;
}
.offcut-size-input {
    width: 100%;
    height: 58px;
    border: 2px solid #cbd5e1;
    border-radius: 11px;
    background: #fff;
    color: #0f172a;
    font-size: 27px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.offcut-size-input.active {
    border-color: #22c55e;
    background: #dcfce7;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, .08);
}
.offcut-entry-panel-popup .inline-numberpad {
    width: min(100%, 400px) !important;
    margin: 0 !important;
    flex: 0 0 auto;
}
.offcut-entry-panel-popup .inline-numberpad-row.actions {
    grid-template-columns: 1.25fr 1fr 1fr !important;
}
.offcut-entry-panel-popup .inline-numberpad button {
    min-height: 52px !important;
}
.offcut-entry-panel-popup .offcut-confirm-strip {
    margin-top: auto !important;
}
.offcut-entry-panel-popup .offcut-modal-actions {
    margin-top: 12px !important;
}
@media (max-width: 760px) {
    .offcut-bin-panel,
    .offcut-entry-panel-popup {
        height: 447px !important;
        max-height: 447px !important;
    }
    .offcut-size-field {
        width: min(48%, 180px);
    }
}


/* Offcut popup v31: final bin-pane sizing override */
.offcut-popup-split {
    grid-template-columns: 300px minmax(0, 1fr) !important;
}
.offcut-bin-panel .offcut-bin-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    align-content: start !important;
    gap: 7px !important;
}
.offcut-bin-panel .offcut-bin-button {
    width: 100% !important;
    min-height: 40px !important;
    padding: 0 6px !important;
    font-size: 13px !important;
}
.offcut-entry-panel-popup .inline-numberpad {
    width: min(100%, 390px) !important;
}
@media (max-width: 760px) {
    .offcut-popup-split {
        grid-template-columns: 240px minmax(0, 1fr) !important;
    }
}


/* Offcut popup v33: center keypad and equal action widths */
.offcut-entry-panel-popup .inline-numberpad {
    width: min(100%, 390px) !important;
    margin: 0 auto !important;
}
.offcut-entry-panel-popup .inline-numberpad-row.actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}


/* Offcut popup v34: center Length/Width controls */
.offcut-entry-panel-popup .offcut-size-row {
    justify-content: center !important;
}

/* Catalogue Board write/reconciliation user selectors */
.catalogue-board-actions {
    min-width: 700px;
    display: grid;
    grid-template-columns: minmax(300px, 1fr) minmax(300px, 1fr);
    gap: 8px 12px;
    align-items: end;
}
.catalogue-user-setting {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.catalogue-user-setting > label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.catalogue-board-actions > #boardReconcileBtn {
    width: 100%;
}
@media (max-width: 1200px) {
    .catalogue-board-actions {
        min-width: 0;
        width: 100%;
        grid-template-columns: 1fr;
    }
    .catalogue-board-reconcile-spacer { display: none; }
}

/* Board Offcut live JobMan posting overlay */
.offcut-posting-overlay {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, .68);
    backdrop-filter: blur(2px);
    cursor: wait;
    touch-action: none;
    user-select: none;
}
.offcut-posting-overlay[hidden] {
    display: none !important;
}
.offcut-posting-card {
    min-width: min(520px, calc(100vw - 48px));
    padding: 30px 36px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(0,0,0,.32);
    color: #0f172a;
    font-size: 24px;
    font-weight: 900;
    text-align: center;
}
.offcut-posting-spinner {
    width: 46px;
    height: 46px;
    margin: 0 auto 18px;
    border: 5px solid #dbe1e8;
    border-top-color: #334155;
    border-radius: 50%;
    animation: offcut-posting-spin .8s linear infinite;
}
body.offcut-posting-active {
    overflow: hidden;
}
@keyframes offcut-posting-spin {
    to { transform: rotate(360deg); }
}

/* Board Offcut delete safety message */
.offcut-message-backdrop {
    position: fixed;
    inset: 0;
    z-index: 5100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
    backdrop-filter: blur(2px);
}
.offcut-message-backdrop[hidden] {
    display: none !important;
}
.offcut-message-card {
    width: min(560px, calc(100vw - 48px));
    padding: 26px 28px 24px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0,0,0,.30);
    text-align: center;
}
.offcut-message-card h2 {
    margin: 0 0 12px;
    color: #991b1b;
    font-size: 24px;
}
.offcut-message-card p {
    margin: 0 0 20px;
    color: #334155;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 700;
}
.offcut-message-card .button {
    min-width: 150px;
    min-height: 48px;
}

/* Nesting > Offcut Lookup: two-pane available/job workspace. */
.offcut-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}
.offcut-pane {
    min-width: 0;
    overflow: hidden;
}
.offcut-pane-header {
    gap: 10px;
    margin-bottom: 4px;
}
.offcut-pane-header h2 {
    margin-bottom: 3px;
}
.offcut-pane-header p {
    margin: 0;
}
.offcut-pane-toolbar {
    padding-top: 10px;
    padding-bottom: 6px;
}
.offcut-colour-search {
    flex: 1 1 260px;
    min-width: 180px;
    max-width: 360px;
}
.offcut-job-load-bar {
    display: flex;
    align-items: end;
    gap: 8px;
    padding: 10px 0 6px;
}
.offcut-job-load-bar .offcut-job-field {
    flex: 0 1 220px;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.offcut-job-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}
.offcut-job-summary {
    min-height: 28px;
    padding: 5px 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.offcut-pane-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.offcut-dual-table {
    width: 100%;
    table-layout: fixed;
    font-size: 13px;
}
.offcut-dual-table .dual-col-colour { width: 48%; }
.offcut-dual-table .dual-col-size { width: 24%; }
.offcut-dual-table .dual-col-rack { width: 13%; }
.offcut-dual-table .dual-col-action { width: 15%; }
.offcut-dual-table th,
.offcut-dual-table td {
    padding: 7px 7px;
    line-height: 1.2;
    vertical-align: middle;
}
.offcut-dual-table th {
    font-size: 12px;
}
.offcut-colour-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.offcut-action-cell {
    text-align: right;
    white-space: nowrap;
}
.button-small {
    min-height: 28px;
    padding: 4px 9px;
    font-size: 12px;
}
.offcut-remove-button {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b91c1c;
    font-weight: 800;
}
.offcut-remove-button:hover:not(:disabled) {
    background: #fee2e2;
}
.offcut-remove-button:disabled {
    opacity: .45;
}
@media (max-width: 1100px) {
    .offcut-workspace {
        grid-template-columns: 1fr;
    }
}


/* Offcut Lookup v44: single Add action with green row selection. */
.offcut-pane-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}
.offcut-selected-add-button {
    min-width: 82px;
    background: #166534;
    border-color: #166534;
    color: #fff;
}
.offcut-selected-add-button:disabled {
    opacity: .42;
    cursor: not-allowed;
}
.offcut-dual-table .dual-col-colour-left { width: 56%; }
.offcut-dual-table .dual-col-size-left { width: 28%; }
.offcut-dual-table .dual-col-rack-left { width: 16%; }
.offcut-selectable-row {
    cursor: pointer;
    transition: background-color .08s ease;
}
.offcut-selectable-row:hover {
    background: #f0fdf4;
}
.offcut-selectable-row.selected,
.offcut-selectable-row.selected:hover {
    background: #dcfce7;
    box-shadow: inset 5px 0 #16a34a;
}
.offcut-selectable-row.selected td {
    background: transparent;
}


/* Offcut Lookup v46: single Remove action with red row selection on the job pane. */
.offcut-selected-remove-button {
    min-width: 92px;
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}
.offcut-selected-remove-button:hover:not(:disabled) {
    background: #991b1b;
    border-color: #991b1b;
}
.offcut-selected-remove-button:disabled {
    opacity: .42;
    cursor: not-allowed;
}
.offcut-dual-table .dual-col-colour-right { width: 56%; }
.offcut-dual-table .dual-col-size-right { width: 28%; }
.offcut-dual-table .dual-col-rack-right { width: 16%; }
.offcut-job-selectable-row {
    cursor: pointer;
    transition: background-color .08s ease;
}
.offcut-job-selectable-row:hover {
    background: #fff1f2;
}
.offcut-job-selectable-row.selected,
.offcut-job-selectable-row.selected:hover {
    background: #fee2e2;
    box-shadow: inset 5px 0 #dc2626;
}
.offcut-job-selectable-row.selected td {
    background: transparent;
}


/* Offcut Lookup v47: visual tidy-up for pane headers and inventory refresh controls. */
.offcut-left-action-header {
    justify-content: flex-end;
}
.offcut-inventory-refresh-button {
    flex: 0 0 auto;
    min-width: 70px;
    align-self: flex-end;
}
.offcut-selected-add-button {
    min-width: 92px;
}

/* Offcut Lookup v48: paired headings and single-row pane controls. */
.offcut-workspace-column {
    min-width: 0;
}
.offcut-workspace-title {
    margin: 0 0 22px;
    font-size: 30px;
    line-height: 1.2;
}
.offcut-pane-top-controls {
    min-height: 62px;
    margin: 0;
    padding: 0 0 12px;
    flex-wrap: nowrap;
}
.offcut-pane-top-controls .offcut-colour-search {
    max-width: none;
    min-width: 0;
}
.offcut-top-action-button {
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
    min-height: 38px;
    padding: 8px 10px;
    align-self: flex-end;
}
.offcut-inventory-refresh-button,
.offcut-selected-add-button {
    min-width: 92px;
}
.offcut-job-load-bar.offcut-pane-top-controls {
    padding-top: 0;
    align-items: flex-end;
}
.offcut-pane-top-spacer {
    flex: 1 1 auto;
    min-width: 8px;
}
.offcut-job-load-bar .offcut-selected-remove-button {
    flex: 0 0 92px;
    width: 92px;
    min-width: 92px;
}
@media (max-width: 1100px) {
    .offcut-workspace-title {
        margin-top: 0;
    }
}
@media (max-width: 700px) {
    .offcut-pane-top-controls {
        flex-wrap: wrap;
    }
    .offcut-pane-top-spacer {
        display: none;
    }
}

/* Offcut Lookup v49: job address summary plus Offcuts / All Stock tabs. */
.offcut-job-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 32px;
    margin: -1px 0 8px;
    border-bottom: 1px solid var(--border);
}
.offcut-job-tab {
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 6px 12px 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.offcut-job-tab:hover {
    color: var(--text);
}
.offcut-job-tab.active {
    color: var(--text);
    border-bottom-color: var(--text);
}


/* Offcut Lookup v50: clickable JobMan material link and removable All Stock rows. */
.offcut-job-summary-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}
.offcut-job-summary-link:hover {
    text-decoration: underline;
}

/* Move to Winstore / Job Setup refinements */
.compact-danger-button {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 13px;
}

.job-setup-info-line {
    display: grid;
    grid-template-columns: minmax(95px, 0.65fr) minmax(230px, 1.55fr) minmax(145px, 0.9fr) minmax(175px, 1fr);
    gap: 18px;
    align-items: start;
    margin-bottom: 12px;
}

.job-setup-info-item {
    min-width: 0;
}

.job-setup-run-line {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 24px;
    margin-bottom: 16px;
}

.job-setup-run-status {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    min-width: 250px;
    padding-top: 9px;
}

.jobman-materials-control {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    max-width: min(520px, 100%);
    text-align: right;
}

.jobman-material-dropdown {
    min-width: 420px;
    cursor: pointer;
}

.button.secondary.jobman-filter-button.selected,
.button.secondary.jobman-filter-button.selected:hover:not(:disabled),
.jobman-filter-button[aria-pressed="true"] {
    background: #15803d !important;
    color: #fff !important;
    border-color: #166534 !important;
    opacity: 1 !important;
}

@media (max-width: 1000px) {
    .job-setup-info-line {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .job-setup-info-line {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .jobman-materials-control {
        width: 100%;
        align-items: flex-start;
        text-align: left;
        margin-left: 0;
    }
}

/* Move to Winstore material grid v61: fixed columns in both selector modes. */
.job-materials-table {
    table-layout: fixed;
    width: 100%;
}
.job-materials-table .job-materials-col-size { width: 17%; }
.job-materials-table .job-materials-col-cv { width: 26%; }
.job-materials-table .job-materials-col-quantity { width: 9%; }
.job-materials-table .job-materials-col-winstore { width: 48%; }
.job-materials-table .material-select,
.job-materials-table .jobman-material-dropdown {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.job-material-size {
    white-space: nowrap;
}

/* Catalogue settings */
.catalogue-settings-card {
    max-width: 1050px;
}
.catalogue-setting-row {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.catalogue-setting-field {
    flex: 1 1 650px;
    min-width: 280px;
}
.catalogue-setting-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}
.catalogue-setting-field .input {
    width: 100%;
}
.catalogue-setting-field .small-text {
    margin-top: 6px;
}


/* Stores > Put Away */
.stores-putaway-card { margin-bottom:18px; }
.stores-putaway-header { align-items:flex-start; margin-bottom:14px; }
.stores-putaway-subtitle { margin:4px 0 0; }
.stores-putaway-bin-types {
    display:flex;
    gap:7px;
    flex-wrap:wrap;
    padding:9px;
    margin:0 0 16px;
    background:#eef1f5;
    border:1px solid #d7dce3;
    border-radius:9px;
}
.stores-putaway-bin-type {
    border:1px solid transparent;
    border-radius:7px;
    background:transparent;
    color:#596273;
    padding:9px 14px;
    font-weight:700;
    cursor:pointer;
}
.stores-putaway-bin-type:hover { background:#fff; color:#111827; }
.stores-putaway-bin-type.active {
    background:#fff;
    color:#111827;
    border-color:#cfd5dd;
    box-shadow:0 1px 2px rgba(16,24,40,.05);
}
.stores-putaway-message {
    margin:0 0 12px;
    padding:10px 12px;
    border:1px solid #bbf7d0;
    border-radius:8px;
    background:#f0fdf4;
    color:#166534;
    font-weight:600;
}
.stores-putaway-message.error { border-color:#fecaca; background:#fef2f2; color:#b91c1c; }
.stores-putaway-list { display:flex; flex-direction:column; align-items:flex-start; gap:7px; width:100%; }
.stores-putaway-record {
    display:grid;
    grid-template-columns:minmax(0, 1fr) 360px;
    width:min(1290px,100%);
    gap:10px;
    align-items:stretch;
}
.stores-putaway-row {
    display:grid;
    grid-template-columns:minmax(200px,1fr) minmax(170px,220px) 170px 115px;
    grid-template-areas:"item task bin action";
    width:100%;
    min-width:0;
    box-sizing:border-box;
    gap:10px;
    align-items:center;
    padding:9px 12px;
    border:1px solid #d7dce3;
    border-radius:9px;
    background:#fff;
    box-shadow:0 1px 2px rgba(16,24,40,.035);
}
.stores-putaway-row.done { background:#f8fafc; }
.stores-putaway-item { grid-area:item; min-width:0; }
.stores-putaway-title-row { display:block; min-width:0; }
.stores-putaway-topline { display:flex !important; flex-wrap:wrap !important; align-items:baseline; column-gap:20px; row-gap:3px; min-width:0; max-width:100%; margin-bottom:2px; }
.stores-putaway-qty { display:inline !important; flex:0 0 auto; font-weight:900; color:#111827; font-size:14px; white-space:nowrap; line-height:1.15; }
.stores-putaway-job { display:inline !important; flex:0 0 auto; font-weight:500; color:#334155; font-size:13px; white-space:nowrap; line-height:1.15; }
.stores-putaway-next-task { grid-area:task; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; gap:3px; min-width:0; font-size:12px; line-height:1.2; }
.stores-putaway-next-task-label { font-weight:700; color:#334155; }
.stores-putaway-next-task-name { color:#475569; overflow-wrap:anywhere; }
.stores-putaway-product-line { display:flex; align-items:baseline; gap:8px; min-width:0; margin-left:14px; flex-wrap:wrap; }
.stores-putaway-name { font-weight:750; color:#111827; font-size:14px; line-height:1.2; min-width:0; }
.stores-putaway-meta { color:#6b7280; font-size:13px; display:inline-flex; align-items:baseline; gap:7px; flex-wrap:wrap; font-weight:500; }
.stores-putaway-dot { color:#9ca3af; }
.stores-putaway-bin-select-wrap { grid-area:bin; min-width:0; }
.stores-putaway-bin-select { width:170px; max-width:100%; }
.stores-putaway-action { grid-area:action; display:flex; align-items:center; justify-content:flex-end; min-height:38px; }
.putaway-row-button { min-width:105px; }
.stores-putaway-done { color:#15803d; font-weight:800; white-space:nowrap; }
.stores-putaway-label-panel {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    padding:9px 11px;
    box-sizing:border-box;
    border:1px solid #cfd6df;
    border-radius:9px;
    background:#f1f5f9;
    box-shadow:0 1px 2px rgba(16,24,40,.035);
}
.stores-putaway-label-options { display:flex; align-items:center; gap:10px; flex-wrap:nowrap; }
.stores-putaway-label-options label { display:inline-flex; align-items:center; gap:4px; color:#334155; font-size:13px; font-weight:700; white-space:nowrap; }
.stores-putaway-label-options label.unavailable { color:#9ca3af; }
.stores-putaway-label-options input { margin:0; }
.putaway-label-button { min-width:68px; justify-self:end; }
.stores-putaway-empty { padding:30px 16px; text-align:center; color:#6b7280; border:1px dashed #cbd5e1; border-radius:9px; background:#f8fafc; }
.error-text { color:#b91c1c; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media(max-width:1400px){
    .stores-putaway-record { grid-template-columns:1fr; width:min(920px,100%); }
    .stores-putaway-label-panel { width:min(360px,100%); }
}
@media(max-width:1100px){
    .stores-putaway-row {
        grid-template-columns:minmax(0,1fr) 170px 115px;
        grid-template-areas:"item bin action" "task bin action";
    }
}
@media(max-width:900px){
    .stores-putaway-row { grid-template-columns:1fr; grid-template-areas:"item" "task" "bin" "action"; gap:10px; }
    .stores-putaway-action { justify-content:flex-start; }
    .stores-putaway-bin-types { overflow-x:auto; flex-wrap:nowrap; }
    .stores-putaway-bin-type { white-space:nowrap; }
}

/* Catalogue > Users: per-API Gateway routing */
.catalogue-users-card .table-wrap{margin-top:14px;}
.catalogue-users-table td{vertical-align:middle;}
.catalogue-users-table .route-mode{min-width:150px;}
.catalogue-users-table .route-user{min-width:190px;}
.catalogue-users-note{margin:4px 0 8px;}

/* Catalogue webhook sync master toggle */
.catalogue-webhook-sync-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
}
.catalogue-webhook-sync-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.catalogue-webhook-sync-copy span {
    color: var(--muted);
    font-size: 13px;
}
.catalogue-webhook-toggle {
    min-width: 205px;
    flex: 0 0 auto;
}
@media (max-width: 800px) {
    .catalogue-webhook-sync-bar {
        align-items: stretch;
        flex-direction: column;
    }
    .catalogue-webhook-toggle {
        width: 100%;
    }
}

/* Shared form and bin controls retained for Stores > Stock Add. */
.form-field{display:grid;gap:7px;}
.form-field>label,.single-bin-type-row>label{font-weight:700;}
.single-bin-type-row{display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.single-bin-type-row>label{flex:0 0 auto;}
.single-bin-types{display:flex;flex-wrap:wrap;gap:9px;min-height:40px;align-items:center;}
.single-bin-type{border:0;border-radius:10px;background:var(--accent);color:#fff;padding:10px 14px;cursor:pointer;font:inherit;font-weight:700;white-space:nowrap;}
.single-bin-type:hover{opacity:.9;}
.single-bin-type.active{box-shadow:0 0 0 3px rgba(32,40,51,.18);filter:brightness(.82);}
@media(max-width:720px){.single-bin-type-row{align-items:flex-start;flex-direction:column;gap:8px;}}

/* Catalogue Items - unified all-category view */
.catalogue-reconcile-all-actions {
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.catalogue-reconcile-category-select { width: 250px; min-width: 210px; }
.catalogue-category-filter select { width: 230px; }
.catalogue-col-use-as { width: 120px; }
.catalogue-col-jobman-category { width: 220px; }
.catalogue-all-grid-scroll { --catalogue-grid-width: 1800px; }
.catalogue-all-grid-inner { min-width: calc(var(--catalogue-grid-width) + var(--catalogue-scrollbar-space)); }

/* Stores > Goods Issue discovery */
.stores-goods-issue-card { max-width: 1320px; }
.stores-goods-issue-header { align-items:flex-start; margin-bottom:14px; }
.stores-goods-issue-subtitle { margin:4px 0 0; }
.stores-goods-issue-toolbar { align-items:flex-end; gap:20px; }
.stores-goods-issue-search-group { min-width:min(520px, 100%); }
.stores-goods-issue-search-row { display:flex; gap:8px; align-items:center; }
.stores-goods-issue-search-row .input { flex:1 1 auto; min-width:220px; }
.stores-goods-issue-table-wrap { margin-top:12px; }
.stores-goods-issue-table { width:100%; border-collapse:collapse; }
.stores-goods-issue-table th,
.stores-goods-issue-table td { padding:10px 12px; border-bottom:1px solid #e5e7eb; text-align:left; vertical-align:middle; }
.stores-goods-issue-table th { font-size:12px; color:#475569; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.stores-goods-issue-table td { font-size:14px; }
.stores-goods-issue-table tbody tr:hover { background:#f8fafc; }
.stores-goods-issue-row { cursor:pointer; }
.stores-goods-issue-row:focus { outline:2px solid #94a3b8; outline-offset:-2px; background:#f8fafc; }
.stores-goods-issue-size { white-space:nowrap; }
.stores-goods-issue-qty { font-weight:800; white-space:nowrap; }
.stores-goods-issue-pagination { display:flex; align-items:center; justify-content:flex-end; gap:12px; margin-top:14px; }
.stores-goods-issue-pagination[hidden] { display:none; }
.stores-goods-issue-page-info { min-width:180px; text-align:center; color:#475569; font-weight:700; }

.stores-goods-issue-modal { width:min(560px, 100%); }
.stores-goods-issue-selected-name { font-size:18px; font-weight:800; margin:-4px 0 16px; }
.stores-goods-issue-detail-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px 16px; padding:14px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.stores-goods-issue-detail-grid div { min-width:0; }
.stores-goods-issue-detail-grid span,
.stores-goods-issue-issue-field > span,
.stores-goods-issue-remaining-row > span { display:block; font-size:12px; color:#64748b; font-weight:700; text-transform:uppercase; letter-spacing:.03em; margin-bottom:3px; }
.stores-goods-issue-detail-grid strong { display:block; overflow-wrap:anywhere; }
.stores-goods-issue-issue-field { display:block; margin-top:16px; }
.stores-goods-issue-issue-field .input { width:100%; max-width:220px; font-size:18px; font-weight:800; }
.stores-goods-issue-remaining-row { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-top:14px; padding:12px 14px; border-radius:10px; background:#f8fafc; }
.stores-goods-issue-remaining-row > span { margin:0; }
.stores-goods-issue-remaining-row strong { font-size:20px; }
.stores-goods-issue-remaining-row strong.error { color:#b91c1c; }
.stores-goods-issue-modal-status { min-height:22px; margin-top:12px; font-weight:800; }
.stores-goods-issue-modal-status.error { color:#b91c1c; }
.stores-goods-issue-modal-actions { grid-column:auto; }
.stores-goods-issue-modal-busy .stores-goods-issue-selected-name,
.stores-goods-issue-modal-busy .stores-goods-issue-detail-grid,
.stores-goods-issue-modal-busy .stores-goods-issue-issue-field,
.stores-goods-issue-modal-busy .stores-goods-issue-remaining-row { opacity:.6; }
@media (max-width:760px) {
    .stores-goods-issue-toolbar { align-items:stretch; flex-direction:column; }
    .stores-goods-issue-search-group { min-width:0; width:100%; }
    .stores-goods-issue-search-row { align-items:stretch; }
    .stores-goods-issue-pagination { justify-content:center; }
    .stores-goods-issue-detail-grid { grid-template-columns:1fr; }
}

/* Catalogue > global Goods Issue scope */
.catalogue-global-goods-issue {
    display:flex;
    align-items:center;
    gap:16px;
    flex-wrap:wrap;
    padding:12px 14px;
    margin:12px 0 4px;
    border:1px solid #dbe3ea;
    border-radius:10px;
    background:#f8fafc;
}
.catalogue-global-check { font-size:15px; }

/* Stores > Customer Supplied */
.customer-supplied-workspace {
    align-items: stretch;
    /* A further 20% reduction of the previous 40% add panel: 32% / 68%. */
    grid-template-columns: minmax(0, 32fr) minmax(0, 68fr);
}
/* Allow columns to shrink naturally without overflowing the narrower add panel. */
.customer-supplied-workspace .offcut-workspace-column { min-width: 0; }
.customer-supplied-workspace .offcut-pane-table-wrap { min-width: 0; width: 100%; overflow-x: auto; }
.customer-supplied-table { min-width: 710px; }
.customer-supplied-table th { white-space: nowrap; }
.customer-supplied-pane {
    height: 100%;
}
.customer-supplied-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 10px 0 6px;
}
.customer-supplied-category-row {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.65fr);
    gap: 18px;
    align-items: end;
}
.customer-supplied-details-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(95px, 0.5fr) auto;
    gap: 12px;
    align-items: end;
}
.customer-supplied-field {
    min-width: 0;
}
.customer-supplied-field label,
.customer-supplied-preview-wrap label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.customer-supplied-field .input {
    width: 100%;
    box-sizing: border-box;
}
.customer-supplied-category-field .input {
    min-width: 0;
}
.customer-supplied-preview-wrap {
    min-width: 0;
}
.customer-supplied-preview {
    min-height: 38px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #dbe3ea;
    border-radius: 8px;
    background: #f8fafc;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.customer-supplied-add-action {
    display: flex;
    align-items: flex-end;
}
.customer-supplied-add-action .button {
    min-width: 92px;
    min-height: 38px;
}
@media (max-width: 1100px) {
    .customer-supplied-workspace { grid-template-columns: minmax(0, 1fr); }
}
.customer-supplied-table .customer-supplied-col-item { width: 38%; }
.customer-supplied-table .customer-supplied-col-category { width: 13%; }
.customer-supplied-table .customer-supplied-col-qty { width: 7%; }
.customer-supplied-table .customer-supplied-col-picked { width: 16%; }
.customer-supplied-table .customer-supplied-col-location { width: 18%; }
.customer-supplied-table .customer-supplied-col-bay { width: 8%; }
/* Picked state is shown by dark-green text, not a green row fill. */
.customer-supplied-table tr.customer-supplied-picked-row,
.customer-supplied-table tr.customer-supplied-partial-row { color: #166534; }
.customer-supplied-locked-row {
    color: var(--muted);
}
.customer-supplied-locked-row:hover {
    background: #f8fafc;
}
.catalogue-category-table th:nth-child(7) { min-width: 170px; }
@media (max-width: 900px) {
    .customer-supplied-category-row {
        grid-template-columns: 1fr;
    }
    .customer-supplied-details-row {
        grid-template-columns: minmax(0, 1fr) minmax(110px, 0.45fr) auto;
    }
}
@media (max-width: 620px) {
    .customer-supplied-details-row {
        grid-template-columns: 1fr;
    }
    .customer-supplied-add-action {
        align-self: end;
    }
}

/* Catalogue > Stock */
.stock-card { max-width: 1500px; }
.stock-header { align-items:flex-start; gap:20px; }
.stock-header h2 { margin:0 0 4px; }
.stock-header p { margin:0; }
.stock-header-actions { display:flex; gap:10px; flex-wrap:wrap; }
.stock-toolbar { display:flex; justify-content:space-between; align-items:flex-end; gap:18px; flex-wrap:wrap; }
.stock-query-controls { display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap; min-width:0; }
.stock-query-controls .stock-search-group { flex:1 1 400px; width:400px; min-width:260px; max-width:600px; }
.stock-search-group label, .stock-type-group label, .stock-category-group label { display:block; margin-bottom:6px; font-size:12px; color:var(--muted); font-weight:700; }
.stock-search-group .input { width:100%; min-width:0; }
.stock-query-controls .stock-category-group { flex:0 1 230px; width:230px; min-width:175px; }
.stock-category-group .input { width:100%; }
.stock-query-controls .stock-type-group { flex:0 0 130px; width:130px; min-width:130px; }
.stock-type-group .input { width:100%; }
.stock-search-buttons { display:flex; flex:0 0 auto; gap:8px; align-items:center; white-space:nowrap; }
.stock-table-wrap { margin-top:14px; }
.stock-table { width:100%; border-collapse:collapse; }
.stock-table th, .stock-table td { padding:10px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; }
.stock-table th { white-space:nowrap; }
/* Stores > Labels and Stock: align list typography with Goods Issue. */
.stock-table thead th { font-size:12px; }
.stock-table tbody td { font-size:14px; }
/* Stores > Stock only: compact rows to match Labels without changing the Labels table. */
.stock-inventory-table thead th { padding:8px 12px; }
.stock-inventory-table tbody td { padding:6px 12px; }
.stock-inventory-table .stock-job-pill { padding:3px 8px; }
.stock-row { cursor:pointer; }
.stock-row:hover { background:#f8fafc; }
.stock-qty { font-weight:800; }
.stock-job-pill { display:inline-flex; padding:4px 8px; border-radius:999px; background:#dcfce7; color:#166534; font-weight:800; white-space:nowrap; }
.stock-pagination { display:flex; justify-content:flex-end; align-items:center; gap:12px; margin-top:16px; }
.stock-pagination[hidden] { display:none; }
.stock-page-info { min-width:190px; text-align:center; color:#475569; font-weight:700; }
.stock-edit-modal { width:min(660px, 100%); }
.stock-add-modal { width:min(900px, 100%); max-height:calc(100vh - 40px); overflow:auto; }
.stock-selected-name, .stock-add-selected-name { font-size:18px; font-weight:800; margin:-4px 0 14px; }
.stock-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 16px; padding:14px; border:1px solid #e2e8f0; border-radius:10px; background:#f8fafc; }
.stock-detail-grid span { display:block; margin-bottom:3px; font-size:12px; color:#64748b; font-weight:700; text-transform:uppercase; letter-spacing:.03em; }
.stock-detail-grid strong { display:block; overflow-wrap:anywhere; }
.stock-edit-field { margin-top:14px; }
.stock-edit-field .input { width:100%; }
.stock-assigned-actions { display:grid; gap:10px; margin-top:16px; padding:14px; border:1px solid #fecaca; border-radius:10px; background:#fff7f7; }
.stock-assigned-actions[hidden] { display:none; }
.stock-warning { color:#991b1b; font-weight:800; }
.stock-assigned-actions .button { width:100%; white-space:normal; text-align:center; line-height:1.4; }
.button.danger { background:#b91c1c; color:#fff; }
.stock-modal-status { min-height:22px; margin-top:12px; font-weight:800; }
.stock-modal-status.error { color:#b91c1c; }
.stock-modal-actions { grid-column:auto; }
.stock-add-search-row { display:flex; gap:8px; }
.stock-add-search-row .input { flex:1 1 auto; }
.stock-catalogue-list { display:grid; gap:8px; max-height:310px; overflow:auto; margin:12px 0; padding-right:3px; }
.stock-catalogue-item { width:100%; display:grid; gap:3px; text-align:left; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:#fff; color:var(--text); cursor:pointer; font:inherit; }
.stock-catalogue-item:hover { background:#f8fafc; }
.stock-catalogue-item.selected { border-color:var(--accent); box-shadow:0 0 0 2px rgba(32,40,51,.12); background:#f8fafc; }
.stock-catalogue-item span { color:var(--muted); font-size:13px; }
.stock-catalogue-pagination { display:flex; align-items:center; justify-content:center; gap:12px; margin-bottom:14px; }
.stock-catalogue-pagination[hidden] { display:none; }
.stock-add-selection { display:grid; gap:14px; padding-top:14px; border-top:1px solid var(--border); }
.stock-add-selection[hidden] { display:none; }
.stock-bin-type-row { align-items:flex-start; }
.stock-add-fields { display:grid; grid-template-columns:minmax(220px,1fr) 130px; gap:12px; align-items:end; }
.stock-add-fields .input { width:100%; }
@media (max-width:760px) {
    .stock-toolbar, .stock-header { flex-direction:column; align-items:stretch; }
    .stock-header-actions { justify-content:flex-start; }
    .stock-query-controls { flex-wrap:wrap; }
    .stock-query-controls .stock-search-group { flex:1 1 100%; min-width:0; width:100%; max-width:none; }
    .stock-query-controls, .stock-add-search-row { align-items:stretch; }
    .stock-query-controls .stock-type-group { flex:1 1 130px; width:auto; min-width:130px; }
    .stock-search-buttons { flex:0 0 auto; width:auto; align-self:flex-end; }
    .stock-detail-grid { grid-template-columns:1fr; }
    .stock-add-fields { grid-template-columns:1fr; }
    .stock-pagination { justify-content:center; }
}

.stock-assignment-filter {
    min-width: 135px;
    width: auto;
}

/* Catalogue item-level Orphaned Stock Pick Operation override */
.catalogue-col-orphan-override { width: 220px; }
.catalogue-orphan-override-cell { min-width: 220px; }
.catalogue-orphan-override-button {
    width: 100%;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Customer supplied: prevent shared table/row styles from hiding the picked column. */
.customer-supplied-workspace .customer-supplied-table th,
.customer-supplied-workspace .customer-supplied-table td { box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; }
.customer-supplied-workspace .customer-supplied-table th:nth-child(4) { min-width: 110px; white-space: nowrap; }
.customer-supplied-workspace .customer-supplied-table td:nth-child(4) { min-width: 110px; white-space: normal; }
.customer-supplied-workspace .customer-supplied-table td:first-child {
    white-space: normal; overflow-wrap: anywhere; text-overflow: clip;
}
.customer-supplied-workspace > .offcut-workspace-column:first-child { container-type: inline-size; }
/* Keep Category, Model, Quantity and Add usable in the narrower 32% panel. */
@container (max-width: 450px) {
    .customer-supplied-category-row { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .customer-supplied-details-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
    .customer-supplied-model-field { grid-column: 1 / -1; }
    .customer-supplied-qty-field { grid-column: 1; }
    .customer-supplied-add-action { grid-column: 2; }
}
.customer-supplied-picked-amount { font-weight: 700; }

/* InventoryApp55 – row selection is independent of picked status. */
.customer-supplied-workspace .customer-supplied-table tr.offcut-job-selectable-row:hover:not(.selected) > td {
    background-color: #f1f5f9;
}
.customer-supplied-workspace .customer-supplied-table tr.offcut-job-selectable-row.selected > td,
.customer-supplied-workspace .customer-supplied-table tr.offcut-job-selectable-row.selected:hover > td {
    background-color: #dbeafe;
}
.customer-supplied-workspace .customer-supplied-table tr.offcut-job-selectable-row.selected {
    box-shadow: inset 5px 0 #2563eb;
}
.customer-supplied-workspace .customer-supplied-table tr.offcut-job-selectable-row:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: -2px;
}
.customer-supplied-item-name { font-weight: 600; overflow-wrap: anywhere; }
.customer-supplied-info-button {
    min-width: 66px;
    background-color: #6d28d9;
    border-color: #6d28d9;
    color: #fff;
}
.customer-supplied-info-button:hover:not(:disabled) { background-color: #5b21b6; }
.customer-supplied-info-button:disabled { opacity: .4; cursor: not-allowed; }

/* InventoryApp54 – Customer Supplied on-demand JobMan inventory activities */
.customer-supplied-activity-modal { width: min(650px, 100%); max-height: min(760px, 90vh); display: flex; flex-direction: column; overflow: hidden; }
.customer-supplied-activity-modal .modal-header { margin-bottom: 9px; }
.customer-supplied-activity-close { border: 0; border-radius: 8px; background: #e9eef4; cursor: pointer; font-size: 26px; width: 38px; height: 38px; line-height: 1; }
.customer-supplied-activity-item { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.customer-supplied-activity-summary { margin-top: 5px; font-size: 13px; color: var(--muted); }
.customer-supplied-activity-list { overflow-y: auto; min-height: 60px; padding-right: 2px; }
.customer-supplied-activity-row { border-top: 1px solid var(--border); padding: 13px 10px; }
.customer-supplied-activity-row.is-picked { border-left: 4px solid #059669; background: #ecfdf5; }
.customer-supplied-activity-event { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.customer-supplied-activity-meta { margin-top: 5px; color: #475569; font-size: 12px; }
.customer-supplied-activity-footer { display: flex; justify-content: center; padding-top: 8px; }
.customer-supplied-activity-error { background: #fee2e2; color: #991b1b; border-radius: 8px; padding: 12px; }


/* JobmanInventory12: Nesting, Stores and Stone primary navigation matches Management259.
   Management sidebar is 154px; this application uses 20% extra width (185px).
   These rules are intentionally scoped to the two requested navigation sections. */
.app-shell.management-nav .sidebar {
    width: 185px;
    flex: 0 0 185px;
    padding: 10px 8px 9px;
    background: #fff;
    border-right: 1px solid #d6dce2;
    overflow-y: auto;
}
.app-shell.management-nav .brand {
    display: block;
    margin: 4px 0 8px;
    padding: 5px 8px;
    background: #2d638f;
    border: 1px solid #23557b;
    border-radius: 0;
    color: #fff;
    text-align: center;
}
.app-shell.management-nav .brand-mark,
.app-shell.management-nav .nav-section-title { display: none; }
.app-shell.management-nav .brand-title {
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: .1px;
}
.app-shell.management-nav .nav {
    gap: 3px;
}
.app-shell.management-nav .nav-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    padding: 5px 8px;
    border: 1px solid transparent;
    border-left: 4px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #53606c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
}
.app-shell.management-nav .nav-link:hover { background: #f4f7f9; }
.app-shell.management-nav .nav-link.active {
    background: #edf3f8;
    border-color: #d7e2ec;
    border-left-color: #245b96;
    color: #245b96;
}
@media (max-width: 800px) {
    .app-shell.management-nav .sidebar {
        width: 100%;
        height: auto;
        flex-basis: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid #d6dce2;
    }
    .app-shell.management-nav .nav { flex-direction: row; flex-wrap: wrap; }
    .app-shell.management-nav .nav-link { width: auto; }
}
