body.mst-warehouse-app {
    margin: 0;
    background: #f4f5f2;
    color: #17202a;
    font-family: Arial, Helvetica, sans-serif;
}

.mst-warehouse-app *,
.mst-warehouse-app *::before,
.mst-warehouse-app *::after {
    box-sizing: border-box;
}

.mst-warehouse-app a {
    color: inherit;
    text-decoration: none;
}

.mst-app {
    min-height: 100vh;
}

.mst-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mst-logo__mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    background: #f26507;
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
    border-radius: 8px;
}

.mst-logo__text {
    display: grid;
    gap: 1px;
    line-height: 1;
}

.mst-logo__text strong {
    font-size: 18px;
    letter-spacing: 0;
}

.mst-logo__text small {
    color: #65717d;
    font-size: 12px;
}

.mst-login-screen {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 28px;
    background:
        linear-gradient(135deg, rgba(242, 101, 7, 0.08), rgba(31, 95, 153, 0.08)),
        #f4f5f2;
}

.mst-login-panel {
    width: min(100%, 420px);
    padding: 28px;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(23, 32, 42, 0.12);
}

.mst-login-panel .mst-logo {
    margin-bottom: 26px;
}

.mst-login-form {
    display: grid;
    gap: 16px;
}

.mst-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #52616f;
    font-size: 13px;
    font-weight: 700;
}

.mst-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #f26507;
}

.mst-field {
    display: grid;
    gap: 7px;
    color: #33404d;
    font-size: 13px;
    font-weight: 700;
}

.mst-field input,
.mst-field select,
.mst-field textarea,
.mst-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    color: #17202a;
    background: #fff;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    font: inherit;
    font-weight: 500;
}

.mst-field textarea {
    min-height: 92px;
    resize: vertical;
}

.mst-field input:focus,
.mst-field select:focus,
.mst-field textarea:focus,
.mst-control:focus {
    border-color: #1f5f99;
    outline: 2px solid rgba(31, 95, 153, 0.16);
    outline-offset: 0;
}

.mst-pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.mst-pin-pad button,
.mst-button,
.mst-icon-button {
    min-height: 42px;
    border: 1px solid #bec8d2;
    border-radius: 6px;
    background: #fff;
    color: #17202a;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mst-pin-pad button:hover,
.mst-icon-button:hover {
    border-color: #f26507;
}

.mst-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: #17202a;
    color: #fff;
    border-color: #17202a;
}

.mst-button:hover {
    background: #f26507;
    border-color: #f26507;
}

.mst-button:disabled {
    cursor: progress;
    opacity: 0.72;
}

.mst-button--secondary {
    background: #fff;
    color: #17202a;
    border-color: #bec8d2;
}

.mst-button--secondary:hover {
    color: #fff;
}

.mst-login-message {
    min-height: 20px;
    margin: 0;
    color: #1f5f99;
    font-size: 13px;
    font-weight: 700;
}

.mst-login-message.is-error {
    color: #b42318;
}

.mst-login-users {
    display: grid;
    gap: 10px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e4e8eb;
}

.mst-user-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.mst-user-line strong,
.mst-user-line span {
    overflow-wrap: anywhere;
}

.mst-user-line span {
    color: #65717d;
}

.mst-workspace {
    width: min(100%, 1580px);
    margin: 0 auto;
    padding: 20px;
}

.mst-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
}

.mst-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mst-nav a {
    padding: 9px 12px;
    color: #52616f;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 800;
}

.mst-nav a.is-active,
.mst-nav a:hover {
    color: #17202a;
    background: #f3f5f7;
    border-color: #d7dee5;
}

.mst-page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.mst-notice {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 800;
}

.mst-notice--success {
    color: #17623a;
    background: #e7f5ec;
    border-color: #b8dfc7;
}

.mst-notice--error {
    color: #b42318;
    background: #fff0ed;
    border-color: #ffc8bd;
}

.mst-kicker {
    margin: 0 0 6px;
    color: #f26507;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.mst-page-head h1 {
    margin: 0;
    font-size: clamp(28px, 3vw, 44px);
    line-height: 1;
    letter-spacing: 0;
}

.mst-page-head p:last-child {
    max-width: 680px;
    margin: 10px 0 0;
    color: #52616f;
    font-size: 15px;
}

.mst-head-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.mst-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mst-metric {
    min-height: 98px;
    padding: 16px;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
}

.mst-metric span {
    display: block;
    color: #65717d;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.mst-metric strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    line-height: 1;
}

.mst-metric small {
    display: block;
    margin-top: 8px;
    color: #52616f;
    font-size: 12px;
}

.mst-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 190px 170px;
    gap: 10px;
    margin-bottom: 12px;
}

.mst-warehouse-app--catalog .mst-toolbar {
    grid-template-columns: minmax(220px, 1fr) 190px 170px 150px 130px;
}

.mst-filter-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    color: #33404d;
    background: #fff;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.mst-filter-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #f26507;
}


.mst-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.mst-panel {
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
}

.mst-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #e4e8eb;
}

.mst-panel__head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
}

.mst-panel__body {
    padding: 16px;
}

.mst-orders-panel {
    margin-bottom: 16px;
}

.mst-orders-panel[hidden] {
    display: none;
}

.mst-orders-table td strong {
    display: block;
    margin-bottom: 3px;
}

.mst-orders-table td {
    vertical-align: top;
}

.mst-orders-cards {
    display: none;
}

.mst-table-wrap {
    overflow: visible;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
}

.mst-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.mst-table th,
.mst-table td {
    padding: 8px 9px;
    border-right: 1px solid #e3e8ed;
    border-bottom: 1px solid #e3e8ed;
    text-align: left;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}

.mst-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #edf1f4;
    color: #33404d;
    font-size: 12px;
    font-weight: 900;
}

.mst-table tbody tr:hover {
    background: #fff8f2;
}

.mst-table tbody tr[data-record-row] {
    cursor: pointer;
}

.mst-table tbody tr[data-record-row]:focus {
    outline: 2px solid rgba(242, 101, 7, 0.35);
    outline-offset: -2px;
}

.mst-table tbody tr.is-selected {
    background: #fff2e8;
    box-shadow: inset 4px 0 0 #f26507;
}

.mst-product-code-cell {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mst-product-code-cell strong {
    color: #17202a;
}

.mst-lot-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 2px 7px;
    color: #b84800;
    background: #fff3ea;
    border: 1px solid #ffd9bd;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
}

.mst-lot-toggle {
    font: inherit;
    cursor: pointer;
}

.mst-lot-toggle:hover,
.mst-lot-toggle[aria-expanded="true"] {
    color: #fff;
    background: #f26507;
    border-color: #f26507;
}

.mst-table tbody tr.is-lot-expanded {
    background: #fff8f2;
}

.mst-lot-detail-row[hidden] {
    display: none;
}

.mst-lot-detail-row td {
    padding: 0;
    background: #fffdf9;
}

.mst-lot-detail {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-left: 4px solid #f26507;
}

.mst-lot-detail__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mst-lot-detail__head strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}

.mst-lot-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: min(100%, 360px);
    margin: 0;
}

.mst-lot-summary div {
    min-width: 0;
    padding: 8px 10px;
    background: #17202a;
    color: #fff;
    border-radius: 6px;
}

.mst-lot-summary dt {
    margin: 0 0 3px;
    color: #cfd6dc;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.mst-lot-summary dd {
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.mst-lot-table-wrap {
    overflow: visible;
    border: 1px solid #e3e8ed;
    border-radius: 6px;
}

.mst-lot-table {
    min-width: 0;
    font-size: 12px;
}

.mst-lot-table td strong,
.mst-lot-table td .mst-muted {
    display: block;
}

.mst-lot-table td .mst-muted {
    margin-top: 2px;
    font-size: 11px;
}

.mst-lot-empty {
    margin: 0;
    padding: 12px;
    color: #65717d;
    background: #fff;
    border: 1px dashed #d7dee5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.mst-table td:last-child,
.mst-table th:last-child {
    border-right: 0;
}

.mst-table tr:last-child td {
    border-bottom: 0;
}

.mst-table__number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mst-diff {
    font-weight: 900;
}

.mst-diff.is-negative,
.mst-status--difference,
.mst-status--damage {
    color: #b42318;
}

.mst-diff.is-positive {
    color: #1b7f46;
}

.mst-status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef2f5;
    color: #33404d;
    font-size: 12px;
    font-weight: 900;
}

.mst-status--ok {
    background: #e7f5ec;
    color: #17623a;
}

.mst-status--difference,
.mst-status--damage {
    background: #fff0ed;
}

.mst-status--pending {
    background: #fff6d7;
    color: #7a5600;
}

.mst-action-list {
    display: flex;
    gap: 6px;
}

.mst-icon-button {
    display: inline-grid;
    width: 34px;
    min-height: 34px;
    place-items: center;
    padding: 0;
}

.mst-record-form {
    display: grid;
    gap: 14px;
}

.mst-catalog-record-panel.is-active {
    border-color: #f26507;
    box-shadow: 0 0 0 3px rgba(242, 101, 7, 0.12);
}

.mst-record-selection {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 11px 12px;
    background: #fff8f2;
    border: 1px solid #ffd9bd;
    border-radius: 6px;
}

.mst-record-selection strong {
    color: #17202a;
    font-size: 14px;
    line-height: 1.25;
}

.mst-record-selection span {
    color: #52616f;
    font-size: 12px;
    font-weight: 800;
}

@media (min-width: 1101px) {
    .mst-catalog-record-panel {
        position: sticky;
        top: 18px;
    }

    body.admin-bar .mst-catalog-record-panel {
        top: 50px;
    }
}

.mst-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.mst-upload-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.mst-upload-slot {
    display: grid;
    min-width: 0;
    min-height: auto;
    gap: 8px;
    place-items: stretch;
    padding: 11px;
    color: #33404d;
    background: #f8fafb;
    border: 1px solid #d7dee5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.mst-upload-slot input {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 8px;
    color: #17202a;
    background: #fff;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.mst-mobile-products {
    display: none;
}

.mst-product-card {
    padding: 14px;
    background: #fff;
    border: 1px solid #d9ded8;
    border-radius: 8px;
    scroll-margin-top: 132px;
}

.mst-product-card:target {
    border-color: #f26507;
    box-shadow: 0 0 0 3px rgba(242, 101, 7, 0.18);
}

.mst-product-card.is-selected {
    border-color: #f26507;
    box-shadow: 0 0 0 3px rgba(242, 101, 7, 0.18);
}

.mst-product-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.mst-product-card__top strong {
    color: #17202a;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.mst-product-card h2 {
    margin: 0 0 12px;
    color: #17202a;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: 0;
}

.mst-product-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.mst-product-facts div {
    min-width: 0;
    padding: 8px;
    background: #f6f8f9;
    border: 1px solid #e3e8ed;
    border-radius: 6px;
}

.mst-product-facts dt {
    margin: 0 0 3px;
    color: #65717d;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.mst-product-facts dd {
    margin: 0;
    color: #17202a;
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.mst-mobile-stock-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 10px;
}

.mst-mobile-stock-strip div {
    min-width: 0;
    padding: 9px 8px;
    background: #17202a;
    color: #fff;
    border-radius: 6px;
}

.mst-mobile-stock-strip span {
    display: block;
    color: #cfd6dc;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.mst-mobile-stock-strip strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.mst-mobile-stock-strip .mst-diff.is-negative {
    color: #ffb8ae;
}

.mst-mobile-stock-strip .mst-diff.is-positive {
    color: #9ce6ba;
}

.mst-mobile-quick-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e4e8eb;
}

.mst-mobile-count-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    gap: 8px;
    align-items: end;
}

.mst-mobile-count-row .mst-field input {
    min-height: 50px;
    font-size: 18px;
    font-weight: 900;
}

.mst-mobile-count-row .mst-button {
    min-height: 50px;
    padding: 10px;
}

.mst-mobile-record {
    margin-top: 10px;
}

.mst-mobile-lots {
    margin-top: 10px;
}

.mst-mobile-lots summary {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    background: #fff8f2;
    color: #17202a;
    border: 1px solid #ffd9bd;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.mst-mobile-lots summary::-webkit-details-marker {
    display: none;
}

.mst-mobile-lots[open] summary {
    margin-bottom: 10px;
    color: #fff;
    background: #f26507;
    border-color: #f26507;
}

.mst-mobile-lots .mst-lot-detail {
    padding: 10px;
    border: 1px solid #ffd9bd;
    border-left: 4px solid #f26507;
    border-radius: 6px;
}

.mst-mobile-lots .mst-lot-detail__head {
    align-items: stretch;
    flex-direction: column;
}

.mst-mobile-record summary {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: #f6f8f9;
    color: #17202a;
    border: 1px solid #d7dee5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.mst-mobile-record summary::-webkit-details-marker {
    display: none;
}

.mst-mobile-record[open] summary {
    margin-bottom: 12px;
    color: #fff;
    background: #17202a;
    border-color: #17202a;
}

.mst-mobile-photos {
    display: grid;
    gap: 8px;
}

.mst-mobile-photos label {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 11px;
    color: #33404d;
    background: #f8fafb;
    border: 1px solid #d7dee5;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 800;
}

.mst-mobile-photos input {
    width: 100%;
    min-width: 0;
    padding: 8px;
    color: #17202a;
    background: #fff;
    border: 1px solid #cfd6dc;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.mst-upload-slot input::file-selector-button,
.mst-mobile-photos input::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    padding: 7px 10px;
    color: #17202a;
    background: #eef2f5;
    border: 1px solid #bec8d2;
    border-radius: 5px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mst-admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

.mst-admin-grid .mst-panel--wide {
    grid-column: 1 / -1;
}

.mst-comment-list,
.mst-activity-list {
    display: grid;
    gap: 10px;
}

.mst-comment,
.mst-activity {
    padding: 12px;
    background: #f8fafb;
    border: 1px solid #e3e8ed;
    border-radius: 6px;
}

.mst-comment strong,
.mst-activity strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.mst-comment p,
.mst-activity p {
    margin: 0;
    color: #465461;
    font-size: 13px;
}

.mst-muted {
    color: #65717d;
}

/* ── Barcode scanner modal ──────────────────────────────── */
.mst-scanner {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.mst-scanner[hidden] { display: none; }

.mst-scanner__card {
    width: 100%;
    max-width: 480px;
    background: #111827;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.64);
}

.mst-scanner__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1c2533;
    color: #e2e8f0;
    font-size: 15px;
    font-weight: 600;
}

.mst-scanner__header span { flex: 1; }

.mst-scanner__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.15s;
}

.mst-scanner__close:hover { background: rgba(255, 255, 255, 0.18); }

.mst-scanner__viewport {
    position: relative;
    background: #000;
    aspect-ratio: 4 / 3;
}

.mst-scanner__viewport video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mst-scanner__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mst-scanner__zone {
    position: relative;
    width: 72%;
    height: 52%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.44);
    border-radius: 4px;
    overflow: hidden;
}

.mst-scanner__corner {
    position: absolute;
    width: 22px;
    height: 22px;
}

.mst-scanner__corner--tl { top: 0;    left: 0;  border-top: 3px solid #f26507; border-left:  3px solid #f26507; border-radius: 3px 0 0 0; }
.mst-scanner__corner--tr { top: 0;    right: 0; border-top: 3px solid #f26507; border-right: 3px solid #f26507; border-radius: 0 3px 0 0; }
.mst-scanner__corner--bl { bottom: 0; left: 0;  border-bottom: 3px solid #f26507; border-left:  3px solid #f26507; border-radius: 0 0 0 3px; }
.mst-scanner__corner--br { bottom: 0; right: 0; border-bottom: 3px solid #f26507; border-right: 3px solid #f26507; border-radius: 0 0 3px 0; }

.mst-scanner__laser {
    position: absolute;
    left: 0;
    right: 0;
    top: 4px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #ef4444 20%, #ef4444 80%, transparent 100%);
    box-shadow: 0 0 6px 2px rgba(239, 68, 68, 0.55);
    animation: mst-laser 2s ease-in-out infinite;
}

@keyframes mst-laser {
    0%   { top: 4px; }
    50%  { top: calc(100% - 6px); }
    100% { top: 4px; }
}

.mst-scanner__status {
    margin: 0;
    padding: 12px 16px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    min-height: 40px;
}

.mst-empty-row {
    display: none;
}

.mst-empty-message {
    margin: 0;
    padding: 14px 16px;
    color: #65717d;
    background: #fff;
    border-top: 1px solid #e4e8eb;
    font-size: 13px;
}

.is-filtered-empty .mst-empty-row,
.mst-table.is-filtered-empty + .mst-empty-row {
    display: block;
    padding: 14px;
    color: #65717d;
    background: #fff;
    border: 1px solid #d9ded8;
    border-top: 0;
    border-radius: 0 0 8px 8px;
}

@media (max-width: 900px) {
    .mst-page-head p:last-child,
    .mst-head-actions [data-export-table],
    .mst-toolbar [data-export-table],
    .mst-table-wrap,
    .mst-catalog-record-panel {
        display: none;
    }

    .mst-workspace {
        padding: 10px;
    }

    .mst-warehouse-app--catalog .mst-topbar {
        margin-bottom: 12px;
        padding: 10px;
    }

    .mst-warehouse-app--catalog .mst-logo__mark {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .mst-warehouse-app--catalog .mst-logo__text small {
        display: none;
    }

    .mst-page-head {
        margin-bottom: 10px;
    }

    .mst-page-head h1 {
        font-size: 28px;
    }

    .mst-head-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mst-head-actions .mst-button {
        width: 100%;
        min-height: 48px;
    }

    .mst-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 10px;
    }

    .mst-metric {
        min-height: 74px;
        padding: 10px;
    }

    .mst-metric strong {
        font-size: 22px;
    }

    .mst-metric small {
        display: none;
    }

    .mst-toolbar {
        position: sticky;
        top: 0;
        z-index: 20;
        grid-template-columns: 1fr 1fr;
        margin: 0 -10px 10px;
        padding: 10px;
        background: #f4f5f2;
        border-bottom: 1px solid #d9ded8;
        box-shadow: 0 8px 18px rgba(23, 32, 42, 0.08);
    }

    body.admin-bar .mst-toolbar {
        top: 32px;
    }

    .mst-toolbar [data-table-search] {
        grid-column: 1 / -1;
    }

    .mst-toolbar .mst-control {
        min-height: 44px;
        font-size: 14px;
    }

    .mst-toolbar .mst-filter-check {
        grid-column: 1 / -1;
        justify-content: flex-start;
        min-height: 42px;
    }

    .mst-toolbar .mst-button {
        min-height: 44px;
    }

    .mst-layout-grid {
        display: block;
    }

    .mst-orders-panel .mst-table-wrap {
        display: none;
    }

    .mst-orders-cards {
        display: grid;
        gap: 10px;
        padding: 12px;
    }

    .mst-order-card {
        display: grid;
        gap: 10px;
        padding: 12px;
        background: #fff;
        border: 1px solid #d9ded8;
        border-radius: 8px;
    }

    .mst-order-card strong,
    .mst-order-card span {
        display: block;
        overflow-wrap: anywhere;
    }

    .mst-order-card span {
        margin-top: 3px;
        color: #65717d;
        font-size: 13px;
        font-weight: 800;
    }

    .mst-order-card dl {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .mst-order-card dl div {
        min-width: 0;
        padding: 8px;
        background: #f6f8f9;
        border: 1px solid #e3e8ed;
        border-radius: 6px;
    }

    .mst-order-card dt {
        margin: 0 0 3px;
        color: #65717d;
        font-size: 11px;
        font-weight: 900;
        text-transform: uppercase;
    }

    .mst-order-card dd {
        margin: 0;
        color: #17202a;
        font-size: 14px;
        font-weight: 900;
    }

    .mst-order-card p {
        margin: 0;
        color: #465461;
        font-size: 13px;
        overflow-wrap: anywhere;
    }

    .mst-mobile-products {
        display: grid;
        gap: 10px;
        padding-bottom: 24px;
    }

    .mst-product-card {
        padding: 12px;
    }

    .mst-lot-detail__head {
        align-items: stretch;
        flex-direction: column;
    }

    .mst-lot-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        min-width: 0;
    }

    .mst-pagination {
        justify-content: center;
        margin: 10px 0;
    }

    .mst-scanner__viewport {
        aspect-ratio: unset;
        max-height: 54vh;
    }
}

@media (max-width: 782px) {
    body.admin-bar .mst-toolbar {
        top: 46px;
    }
}

@media (max-width: 1100px) {
    .mst-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mst-layout-grid,
    .mst-admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .mst-workspace {
        padding: 12px;
    }

    .mst-topbar,
    .mst-page-head,
    .mst-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .mst-head-actions {
        justify-content: stretch;
    }

    .mst-head-actions .mst-button {
        width: 100%;
    }

    .mst-warehouse-app--catalog .mst-topbar {
        align-items: center;
        flex-direction: row;
        gap: 10px;
        margin-bottom: 10px;
    }

    .mst-warehouse-app--catalog .mst-logo {
        gap: 8px;
    }

    .mst-warehouse-app--catalog .mst-logo__text strong {
        font-size: 15px;
    }

    .mst-warehouse-app--catalog .mst-nav {
        justify-content: flex-end;
    }

    .mst-warehouse-app--catalog .mst-nav a {
        padding: 8px 9px;
        font-size: 12px;
    }

    .mst-warehouse-app--catalog .mst-page-head {
        gap: 8px;
    }

    .mst-warehouse-app--catalog .mst-page-head h1 {
        font-size: 24px;
    }

    .mst-warehouse-app--catalog .mst-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mst-warehouse-app--catalog .mst-metric {
        min-height: 64px;
        padding: 8px;
    }

    .mst-warehouse-app--catalog .mst-metric span {
        font-size: 10px;
    }

    .mst-warehouse-app--catalog .mst-metric strong {
        font-size: 19px;
    }

    .mst-product-card h2 {
        font-size: 15px;
    }

    .mst-mobile-stock-strip strong {
        font-size: 16px;
    }

    .mst-lot-summary {
        grid-template-columns: 1fr;
    }

    .mst-mobile-count-row .mst-field input,
    .mst-mobile-count-row .mst-button {
        min-height: 52px;
    }

    .mst-metrics,
    .mst-form-grid,
    .mst-upload-row {
        grid-template-columns: 1fr;
    }

    .mst-login-panel {
        padding: 22px;
    }
}

@media (max-width: 380px) {
    .mst-mobile-count-row,
    .mst-mobile-stock-strip,
    .mst-order-card dl {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------------
 * Users, PIN login, roles (added for warehouse user management)
 * --------------------------------------------------------------- */

/* Topbar user + logout */
.mst-nav-user {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mst-nav-user__name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #33404d;
    font-size: 13px;
    font-weight: 700;
}

.mst-nav-user__logout {
    padding: 7px 12px;
    border: 1px solid #bec8d2;
    border-radius: 8px;
    color: #17202a;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s ease, color 0.15s ease;
}

.mst-nav-user__logout:hover {
    background: #17202a;
    color: #fff;
}

/* PIN login */
.mst-login-lead {
    margin: 14px 0 18px;
    color: #65717d;
    font-size: 14px;
    text-align: center;
}

.mst-pin-form {
    display: grid;
    gap: 18px;
    justify-items: center;
}

.mst-pin-dots {
    display: flex;
    gap: 14px;
    min-height: 18px;
    align-items: center;
}

.mst-pin-dots span {
    width: 14px;
    height: 14px;
    border: 2px solid #bec8d2;
    border-radius: 50%;
    background: transparent;
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.mst-pin-dots span.is-filled {
    background: #f26507;
    border-color: #f26507;
    transform: scale(1.05);
}

.mst-pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: min(100%, 300px);
}

.mst-pin-key {
    padding: 0;
    height: 64px;
    font-size: 24px;
    font-weight: 700;
    color: #17202a;
    background: #fff;
    border: 1px solid #d4dad3;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.08s ease, background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.mst-pin-key:hover {
    border-color: #f26507;
}

.mst-pin-key:active {
    transform: scale(0.96);
    background: #fdf1e8;
    box-shadow: inset 0 2px 6px rgba(242, 101, 7, 0.18);
}

.mst-pin-key--ghost {
    background: #f4f5f2;
    color: #65717d;
    font-size: 20px;
}

.mst-pin-submit {
    width: min(100%, 300px);
    height: 52px;
    font-size: 16px;
    background: #f26507;
    border-color: #f26507;
}

.mst-pin-submit:hover {
    background: #d9590a;
    border-color: #d9590a;
}

.mst-login-fallback-toggle {
    display: block;
    margin: 18px auto 0;
    padding: 6px 10px;
    background: none;
    border: none;
    color: #1f5f99;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.mst-login-fallback {
    margin-top: 16px;
    padding-top: 18px;
    border-top: 1px dashed #d4dad3;
    display: grid;
    gap: 14px;
}

/* Button modifiers */
.mst-button--small {
    padding: 7px 11px;
    font-size: 12px;
}

.mst-button--danger {
    background: #fff;
    color: #b3261e;
    border-color: #e7b4b0;
}

.mst-button--danger:hover {
    background: #b3261e;
    color: #fff;
    border-color: #b3261e;
}

/* User management */
.mst-users-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.mst-users-table td {
    vertical-align: top;
}

.mst-users-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.mst-users-actions form {
    margin: 0;
}

.mst-user-form {
    display: grid;
    gap: 14px;
    padding: 18px;
    background: #fafbf9;
    border: 1px solid #e2e6df;
    border-radius: 10px;
    position: sticky;
    top: 16px;
}

.mst-user-form .mst-panel__head {
    margin: 0;
}

.mst-user-form h3 {
    margin: 0;
    font-size: 16px;
}

.mst-fieldset {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e2e6df;
    border-radius: 8px;
}

.mst-fieldset legend {
    padding: 0 6px;
    color: #33404d;
    font-size: 13px;
    font-weight: 700;
}

.mst-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.mst-record-noperm {
    padding: 16px;
    text-align: center;
}

@media (max-width: 900px) {
    .mst-users-layout {
        grid-template-columns: 1fr;
    }

    .mst-user-form {
        position: static;
    }

    .mst-nav-user__name {
        display: none;
    }
}

/* ==================================================================
 * WMS modern theme — design tokens + redesigned catalog list
 * (appended last so it refines the base styles)
 * ================================================================ */

:root {
    --wms-bg: #eef1f4;
    --wms-surface: #ffffff;
    --wms-surface-2: #f7f9fa;
    --wms-ink: #131922;
    --wms-muted: #66727f;
    --wms-line: #e2e7ec;
    --wms-line-strong: #cfd6dd;
    --wms-brand: #f26507;
    --wms-brand-dark: #d4570a;
    --wms-brand-soft: #fdeee2;
    --wms-info: #1f6feb;
    --wms-ok: #18794e;
    --wms-ok-bg: #e7f5ee;
    --wms-warn: #9a6700;
    --wms-warn-bg: #fff3d4;
    --wms-danger: #b3261e;
    --wms-danger-bg: #fdeceb;
    --wms-radius: 16px;
    --wms-radius-sm: 11px;
    --wms-shadow: 0 1px 2px rgba(19, 25, 34, 0.06), 0 8px 24px rgba(19, 25, 34, 0.06);
    --wms-shadow-pop: 0 10px 30px rgba(19, 25, 34, 0.14);
}

body.mst-warehouse-app {
    background: var(--wms-bg);
    color: var(--wms-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.mst-app {
    padding: 0;
}

.mst-workspace {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 14px 96px;
}

/* Sticky topbar */
.mst-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    border: none;
    border-radius: 0 0 var(--wms-radius) var(--wms-radius);
    box-shadow: var(--wms-shadow);
    padding: 12px 16px;
}

.mst-logo__mark {
    background: var(--wms-brand);
    border-radius: 10px;
}

.mst-nav {
    gap: 4px;
}

.mst-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    color: var(--wms-muted);
}

.mst-nav a.is-active {
    background: var(--wms-brand-soft);
    color: var(--wms-brand-dark);
}

/* Page head */
.mst-page-head {
    margin: 18px 4px 14px;
    gap: 12px;
}

.mst-page-head h1 {
    font-size: clamp(20px, 4vw, 26px);
    margin: 2px 0 0;
}

.mst-kicker {
    color: var(--wms-brand-dark);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 11px;
}

/* Sticky filter toolbar */
.mst-toolbar {
    position: sticky;
    top: 76px;
    z-index: 20;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: var(--wms-shadow);
    margin-bottom: 14px;
}

.mst-control,
.mst-field input,
.mst-field select,
.mst-field textarea {
    border-radius: var(--wms-radius-sm);
    border: 1px solid var(--wms-line-strong);
    font-size: 16px;
    padding: 12px 14px;
    background: var(--wms-surface);
}

.mst-control:focus,
.mst-field input:focus,
.mst-field select:focus,
.mst-field textarea:focus {
    outline: none;
    border-color: var(--wms-brand);
    box-shadow: 0 0 0 3px var(--wms-brand-soft);
}

/* Buttons */
.mst-button {
    border-radius: var(--wms-radius-sm);
    padding: 12px 18px;
    font-weight: 700;
    font-size: 15px;
    min-height: 46px;
    border: 1px solid transparent;
    transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
    background: var(--wms-ink);
    border-color: var(--wms-ink);
}

.mst-button:active { transform: translateY(1px); }
.mst-button--secondary { background: var(--wms-surface); color: var(--wms-ink); border-color: var(--wms-line-strong); }
.mst-button--secondary:hover { background: var(--wms-ink); color: #fff; }
.mst-button--save { background: var(--wms-brand); border-color: var(--wms-brand); }
.mst-button--save:hover { background: var(--wms-brand-dark); border-color: var(--wms-brand-dark); }

/* ---- Catalog list (accordion) ---- */
.mst-item-list {
    display: grid;
    gap: 10px;
}

.mst-item {
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: var(--wms-shadow);
    overflow: hidden;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.mst-item[open] {
    border-color: var(--wms-brand);
    box-shadow: var(--wms-shadow-pop);
}

.mst-item__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.mst-item__head::-webkit-details-marker { display: none; }

.mst-item__chevron {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--wms-muted);
    border-bottom: 2px solid var(--wms-muted);
    transform: rotate(-45deg);
    transition: transform 0.18s ease;
    margin-top: -3px;
}

.mst-item[open] .mst-item__chevron {
    transform: rotate(45deg);
    border-color: var(--wms-brand);
}

.mst-item__main {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 3px;
}

.mst-item__code-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mst-item__code {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.01em;
}

.mst-item__title {
    color: var(--wms-ink);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mst-item__meta {
    color: var(--wms-muted);
    font-size: 12.5px;
}

.mst-item__stats {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    text-align: center;
}

.mst-stat {
    display: grid;
    gap: 1px;
    min-width: 56px;
    padding: 6px 8px;
    background: var(--wms-surface-2);
    border-radius: 10px;
}

.mst-stat b { font-size: 16px; font-weight: 800; line-height: 1.1; }
.mst-stat i { font-size: 10px; font-style: normal; color: var(--wms-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.mst-stat.is-counted { background: var(--wms-ok-bg); }
.mst-stat.is-counted b { color: var(--wms-ok); }

/* Status pills */
.mst-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: var(--wms-surface-2);
    color: var(--wms-muted);
}

.mst-status--ok { background: var(--wms-ok-bg); color: var(--wms-ok); }
.mst-status--difference { background: var(--wms-warn-bg); color: var(--wms-warn); }
.mst-status--damage { background: var(--wms-danger-bg); color: var(--wms-danger); }
.mst-status--pending { background: #eef1f4; color: var(--wms-muted); }

.mst-lot-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eaf1fd;
    color: var(--wms-info);
    font-size: 11px;
    font-weight: 800;
}

.mst-item__barcode {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    max-width: 260px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mst-item__approval {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--wms-ok-bg);
    color: var(--wms-ok);
    font-size: 11px;
    font-weight: 800;
}

/* Item body */
.mst-item__body {
    padding: 4px 16px 16px;
    border-top: 1px solid var(--wms-line);
    display: grid;
    gap: 14px;
}

.mst-item__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin: 12px 0 0;
}

.mst-item__facts div {
    background: var(--wms-surface-2);
    border-radius: 10px;
    padding: 8px 10px;
}

.mst-item__facts dt { font-size: 11px; color: var(--wms-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.mst-item__facts dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; }

.mst-item__form {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: var(--wms-surface-2);
    border-radius: var(--wms-radius-sm);
    border: 1px solid var(--wms-line);
}

.mst-item__count-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.mst-field--count input {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    padding: 12px;
}

.mst-item__count-row .mst-button--save {
    min-height: 52px;
    padding: 12px 22px;
}

.mst-upload-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mst-upload-slot {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--wms-muted);
    text-align: center;
    padding: 10px;
    background: var(--wms-surface);
    border: 1px dashed var(--wms-line-strong);
    border-radius: 10px;
}

/* Lot details inside item */
.mst-lot-detail { background: var(--wms-surface); border: 1px solid var(--wms-line); border-radius: var(--wms-radius-sm); padding: 12px; }

/* Summary stat chips — override old dark-card style */
.mst-lot-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
}
.mst-lot-summary div {
    padding: 8px 10px;
    background: var(--wms-surface-2);
    color: var(--wms-ink);
    border-radius: 8px;
    border: 1px solid var(--wms-line);
}
.mst-lot-summary dt {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wms-muted);
}
.mst-lot-summary dd {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--wms-ink);
    font-variant-numeric: tabular-nums;
}

/* Lot table: compact, no scroll — 3 columns */
.mst-lot-table-wrap { overflow: visible; border: none; border-radius: 0; padding: 0; }
.mst-lot-table { width: 100%; min-width: 0; table-layout: fixed; }
.mst-lot-table th { font-size: 11px; color: var(--wms-muted); }
.mst-lot-table td .mst-muted { display: none; }

/* Column widths: Lot 50% | Υπόλοιπο 15% | Καταγραφή rest */
.mst-lot-table th:nth-child(2), .mst-lot-table td:nth-child(2) { width: 18%; }
.mst-lot-rec-th, .mst-lot-rec-td { width: 32%; }

/* Lot code cell */
.mst-lot-code { display: block; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; word-break: break-all; }
.mst-lot-wh { display: block; font-size: 11px; color: var(--wms-muted); margin-top: 1px; }

/* Recording status chip — green when recorded */
.mst-lot-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 6px;
    border-radius: 99px;
    background: var(--wms-ok-bg);
    color: var(--wms-ok);
    font: 700 12px/1 inherit;
    font-variant-numeric: tabular-nums;
}
.mst-lot-status__meta { font-size: 11px; color: var(--wms-muted); margin-top: 3px; line-height: 1.3; }

/* Grey circle = not yet recorded */
.mst-lot-unrecorded {
    display: inline-block;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--wms-line-strong);
    vertical-align: middle;
}

/* Re-record form sits below the status chip */
.mst-lot-record-form--update { margin-top: 6px; }

/* Recording row: input + icon button */
.mst-lot-count-row { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.mst-lot-count-input {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
    padding: 0 8px;
    border: 1px solid var(--wms-line-strong);
    border-radius: 8px;
    background: var(--wms-surface);
    color: var(--wms-ink);
    font: 600 15px/1 inherit;
    text-align: center;
    transition: border-color .15s, box-shadow .15s;
}
.mst-lot-count-input:focus { outline: none; border-color: var(--wms-brand); box-shadow: 0 0 0 3px var(--wms-brand-soft); }

/* Icon-only submit button */
.mst-lot-submit {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    min-width: 38px; min-height: 38px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
}

.mst-button--small { min-height: 34px; padding: 5px 12px; font-size: 13px; line-height: 1.3; }


/* Notices */
.mst-notice { border-radius: var(--wms-radius-sm); border: none; box-shadow: var(--wms-shadow); font-weight: 700; }
.mst-notice--success { background: var(--wms-ok-bg); color: var(--wms-ok); }
.mst-notice--error { background: var(--wms-danger-bg); color: var(--wms-danger); }

/* Empty states */
.mst-empty-row { display: none; text-align: center; padding: 28px; color: var(--wms-muted); }
.mst-workspace.is-filtered-empty .mst-empty-row { display: block; }

/* Metrics / admin panels modern */
.mst-metric, .mst-panel { border-radius: var(--wms-radius); border-color: var(--wms-line); box-shadow: var(--wms-shadow); }
.mst-metric strong { color: var(--wms-brand-dark); }

/* Desktop: toolbar inline */
@media (min-width: 720px) {
    .mst-toolbar {
        grid-template-columns: 2fr 1fr 1fr auto auto;
        align-items: center;
    }
}

/* Phone tuning */
@media (max-width: 560px) {
    .mst-item__head { flex-wrap: wrap; }
    .mst-item__stats { width: 100%; order: 3; justify-content: space-between; }
    .mst-stat { flex: 1; }
    .mst-item__title { white-space: normal; }
    .mst-item__count-row { grid-template-columns: 1fr; }
    .mst-item__count-row .mst-button--save { width: 100%; }
    .mst-page-head h1 { font-size: 22px; }
    .mst-toolbar { top: 70px; }
}

/* ==================================================================
 * WMS refine pass — data-driven slate palette, Inter, header/logo,
 * search & filters, pagination (mobile-first polish)
 * ================================================================ */

:root {
    --wms-bg: #f1f5f9;
    --wms-surface: #ffffff;
    --wms-surface-2: #f8fafc;
    --wms-ink: #0f172a;
    --wms-muted: #64748b;
    --wms-line: #e2e8f0;
    --wms-line-strong: #cbd5e1;
    --wms-brand: #f26507;
    --wms-brand-dark: #d4570a;
    --wms-brand-soft: #fdeee2;
    --wms-info: #2563eb;
    --wms-info-bg: #eaf1fd;
    --wms-ok: #15803d;
    --wms-ok-bg: #ecfdf3;
    --wms-warn: #b45309;
    --wms-warn-bg: #fffbeb;
    --wms-danger: #dc2626;
    --wms-danger-bg: #fef2f2;
    --wms-radius: 16px;
    --wms-radius-sm: 12px;
    --wms-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px rgba(15, 23, 42, 0.06);
    --wms-shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.14);
}

body.mst-warehouse-app {
    background: var(--wms-bg);
    color: var(--wms-ink);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-feature-settings: "cv05", "ss01";
}

.mst-workspace {
    padding: 12px 14px calc(96px + env(safe-area-inset-bottom));
}

/* ---- Topbar / logo ---- */
.mst-topbar {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--wms-line);
}

.mst-logo { gap: 10px; align-items: center; flex: 1 1 auto; }
.mst-logo__img { height: 30px; width: auto; display: block; }
.mst-logo__badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--wms-brand-dark);
    background: var(--wms-brand-soft);
    padding: 3px 7px;
    border-radius: 6px;
}

.mst-nav { gap: 6px; order: 3; flex: 1 1 100%; }
.mst-nav a {
    padding: 9px 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    color: var(--wms-muted);
    background: var(--wms-surface-2);
}
.mst-nav a.is-active { background: var(--wms-brand); color: #fff; }

.mst-nav-user { order: 2; gap: 10px; }
.mst-nav-user__logout {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--wms-line-strong);
    font-size: 13px;
    font-weight: 600;
}

@media (min-width: 720px) {
    .mst-nav { order: 0; flex: 0 1 auto; }
    .mst-nav-user { order: 0; }
}

/* ---- Toolbar: search + filters ---- */
.mst-toolbar {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: var(--wms-shadow);
}

.mst-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 4px 4px 12px;
    background: var(--wms-surface);
    border: 1.5px solid var(--wms-line-strong);
    border-radius: var(--wms-radius-sm);
}
.mst-search:focus-within { border-color: var(--wms-brand); box-shadow: 0 0 0 3px var(--wms-brand-soft); }
.mst-search__icon { display: inline-flex; color: var(--wms-muted); flex: 0 0 auto; }
.mst-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    padding: 10px 4px;
}
.mst-search__go {
    flex: 0 0 auto;
    border: none;
    background: var(--wms-ink);
    color: #fff;
    border-radius: 9px;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 14px;
    min-height: 42px;
    cursor: pointer;
}
.mst-search__go:hover { background: #1e293b; }

.mst-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.mst-filter-row .mst-control { flex: 1 1 150px; min-width: 0; }
.mst-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wms-muted);
    white-space: nowrap;
    padding: 0 4px;
}
.mst-filter-check input { width: 18px; height: 18px; accent-color: var(--wms-brand); }

@media (min-width: 720px) {
    .mst-toolbar { grid-template-columns: minmax(280px, 1.4fr) 2fr; align-items: center; }
}

@media (min-width: 1180px) {
    .mst-warehouse-app--catalog .mst-toolbar {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 14px 16px;
    }

    .mst-warehouse-app--catalog .mst-search {
        flex: 1 1 520px;
        min-width: 320px;
    }

    .mst-warehouse-app--catalog .mst-filter-row {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        gap: 10px;
    }

    .mst-warehouse-app--catalog .mst-filter-row .mst-control {
        flex: 0 0 auto;
        min-width: 178px;
    }

    .mst-warehouse-app--catalog .mst-filter-row [name="wh_warehouse"] {
        min-width: 230px;
    }

    .mst-warehouse-app--catalog .mst-filter-check {
        min-height: 46px;
        padding: 0 12px;
        border: 1px solid var(--wms-line-strong);
        border-radius: var(--wms-radius-sm);
        background: var(--wms-surface-2);
    }
}

@media (max-width: 719px) {
    .mst-warehouse-app--catalog .mst-topbar {
        position: static;
        top: auto;
        z-index: auto;
    }

    .mst-warehouse-app--catalog .mst-toolbar {
        grid-template-columns: minmax(0, 1fr);
    }

    .mst-warehouse-app--catalog .mst-item-list,
    .mst-warehouse-app--catalog .mst-mobile-products,
    .mst-warehouse-app--catalog .mst-product-card {
        scroll-margin-top: 14px;
    }

    .mst-warehouse-app--catalog .mst-search,
    .mst-warehouse-app--catalog .mst-filter-row {
        grid-column: 1 / -1;
        min-width: 0;
        width: 100%;
    }

    .mst-warehouse-app--catalog .mst-filter-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
    }

    .mst-warehouse-app--catalog .mst-filter-row .mst-control,
    .mst-warehouse-app--catalog .mst-filter-check {
        width: 100%;
        min-width: 0;
    }

    .mst-warehouse-app--catalog .mst-filter-check {
        justify-content: flex-start;
    }
}

/* ── Pagination ──────────────────────────────────────────────────── */
.mst-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}
.mst-pagination__bar { display: flex; align-items: center; gap: 6px; }
.mst-pagination__nav,
.mst-pagination__page {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid var(--wms-line-strong);
    background: var(--wms-surface);
    color: var(--wms-ink);
    font: 600 14px/1 inherit;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
    cursor: pointer;
}
.mst-pagination__nav:hover,
.mst-pagination__page:hover { background: var(--wms-bg); border-color: var(--wms-muted); }
.mst-pagination__nav.is-disabled { opacity: 0.3; pointer-events: none; cursor: default; }
.mst-pagination__page.is-current { background: var(--wms-brand); color: #fff; border-color: var(--wms-brand); pointer-events: none; cursor: default; }
.mst-pagination__pages { display: flex; gap: 6px; }
.mst-pagination__summary { margin: 0; font-size: 13px; color: var(--wms-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .mst-pagination__pages { display: none; } }

/* ---- Item list refinements ---- */
.mst-item__code { letter-spacing: 0; font-variant-numeric: tabular-nums; }
.mst-stat b { font-variant-numeric: tabular-nums; }
.mst-lot-pill { background: var(--wms-info-bg); color: var(--wms-info); }
.mst-item[open] { border-color: var(--wms-brand); }
.mst-item__head:active { background: var(--wms-surface-2); }

/* Orders panel + scanner spacing */
.mst-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mst-head-actions .mst-button { flex: 1 1 auto; }

@media (min-width: 720px) {
    .mst-head-actions .mst-button { flex: 0 0 auto; }
}

/* ─── Admin tabs ───────────────────────────────────────────────── */
.mst-tabs {
    display: flex;
    gap: 3px;
    padding: 4px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: calc(var(--wms-radius) + 2px);
    margin-bottom: 1.5rem;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
}
.mst-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: .45rem 1rem;
    border-radius: var(--wms-radius);
    border: none;
    background: transparent;
    color: var(--wms-muted);
    font: 500 .875rem/1.4 var(--wms-font);
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.mst-tab:hover { background: var(--wms-bg); color: var(--wms-ink); }
.mst-tab.is-active { background: var(--wms-brand); color: #fff; }
.mst-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 .3rem;
    border-radius: 99px;
    font-size: .7rem;
    font-weight: 700;
    background: rgba(0,0,0,.12);
    color: inherit;
    line-height: 1;
}
.mst-tab.is-active .mst-tab-badge { background: rgba(255,255,255,.25); }
.mst-tab-badge--warn { background: var(--wms-warn-bg); color: var(--wms-warn); }
.mst-tab.is-active .mst-tab-badge--warn { background: rgba(255,255,255,.25); color: rgba(255,255,255,.9); }
.mst-tab-panel.is-hidden { display: none !important; }

/* ─── Product visibility list ──────────────────────────────────── */
.mst-prod-search-form { margin-bottom: 1rem; }
.mst-prod-stats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    font-size: .875rem;
    color: var(--wms-muted);
    padding: .625rem 0;
    border-bottom: 1px solid var(--wms-line);
    margin-bottom: .75rem;
}
.mst-prod-stats strong { color: var(--wms-ink); }
.mst-prod-stats__hidden strong { color: var(--wms-warn); }
.mst-prod-list {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.mst-prod-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem .875rem;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    transition: opacity .2s, background .15s;
}
.mst-prod-row.is-hidden-prod {
    opacity: .6;
    background: var(--wms-bg);
    border-color: var(--wms-line);
}
.mst-prod-row.is-hidden-prod:hover { opacity: .8; }
.mst-prod-row__info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.mst-prod-row__code {
    font: 600 .7rem/1 'ui-monospace', monospace;
    color: var(--wms-muted);
    letter-spacing: .02em;
}
.mst-prod-row__title {
    font: 500 .875rem/1.3 var(--wms-font);
    color: var(--wms-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mst-prod-row__sku {
    font-size: .75rem;
    color: var(--wms-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mst-prod-row__meta {
    font-size: .75rem;
    color: var(--wms-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mst-prod-row__form { flex-shrink: 0; }
.mst-button--ghost {
    background: transparent;
    color: var(--wms-muted);
    border: 1px solid var(--wms-line);
}
.mst-button--ghost:hover { background: var(--wms-bg); color: var(--wms-ink); border-color: var(--wms-muted); }

.mst-approve-form {
    display: flex;
    min-width: 230px;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mst-approve-form__qty,
.mst-approve-form__note {
    min-height: 34px;
    border: 1px solid var(--wms-line-strong);
    border-radius: 8px;
    background: var(--wms-surface);
    color: var(--wms-ink);
    font: 600 13px/1 inherit;
}

.mst-approve-form__qty {
    width: 76px;
    padding: 0 8px;
    text-align: right;
}

.mst-approve-form__note {
    width: 120px;
    padding: 0 9px;
}

/* ── Lot per-DOT recording ────────────────────────────────────────── */
.mst-lot-count-row { display: flex; align-items: center; gap: 6px; }
.mst-lot-record-form { margin: 0; }
.mst-lot-count-input {
    width: 72px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--wms-line-strong);
    border-radius: 8px;
    background: var(--wms-surface);
    color: var(--wms-ink);
    font: 600 13px/1 inherit;
    text-align: right;
    transition: border-color .15s, box-shadow .15s;
}
.mst-lot-count-input:focus {
    outline: none;
    border-color: var(--wms-brand);
    box-shadow: 0 0 0 3px var(--wms-brand-soft);
}
.mst-lot-table--countable .mst-table__count-col { white-space: nowrap; }

/* ==================================================================
 * REDESIGN v2 — flat / minimal / professional WMS
 * One accent (orange), hairline borders, shadows only for elevation,
 * tabular numerics, consistent spacing. This block is authoritative
 * (last in cascade) for the shared shell + catalog + admin surfaces.
 * ================================================================== */

.mst-warehouse-app {
    --wms-radius: 14px;
    --wms-radius-sm: 10px;
    --wms-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    --wms-shadow-pop: 0 8px 28px -6px rgba(15, 23, 42, 0.18);
    --wms-ring: 0 0 0 3px var(--wms-brand-soft);
}

.mst-warehouse-app,
.mst-warehouse-app input,
.mst-warehouse-app select,
.mst-warehouse-app textarea,
.mst-warehouse-app button {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.mst-workspace { max-width: 1120px; }

/* ── Top bar ─────────────────────────────────────────────────────── */
.mst-warehouse-app .mst-topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--wms-line);
    border-radius: 0;
    box-shadow: none;
    padding: 10px 16px;
    align-items: center;
}
.mst-warehouse-app .mst-nav a {
    background: transparent;
    color: var(--wms-muted);
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 9px;
    transition: background .15s, color .15s;
}
.mst-warehouse-app .mst-nav a:hover { background: var(--wms-surface-2); color: var(--wms-ink); }
.mst-warehouse-app .mst-nav a.is-active { background: var(--wms-brand-soft); color: var(--wms-brand-dark); }
.mst-warehouse-app .mst-nav-user { align-items: center; gap: 12px; }
.mst-warehouse-app .mst-nav-user__name { font-weight: 600; font-size: 13px; color: var(--wms-ink); }
.mst-warehouse-app .mst-nav-user__logout {
    font-size: 13px;
    font-weight: 600;
    color: var(--wms-muted);
    padding: 6px 12px;
    border-radius: 9px;
    border: 1px solid var(--wms-line);
    transition: background .15s, color .15s, border-color .15s;
}
.mst-warehouse-app .mst-nav-user__logout:hover { background: var(--wms-surface-2); color: var(--wms-ink); border-color: var(--wms-line-strong); }

/* ── Page head ───────────────────────────────────────────────────── */
.mst-warehouse-app .mst-page-head { margin: 22px 2px 18px; align-items: flex-start; }
.mst-warehouse-app .mst-kicker {
    color: var(--wms-muted);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 5px;
}
.mst-warehouse-app .mst-page-head h1 {
    font-size: clamp(22px, 3.5vw, 28px);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.15;
}
.mst-warehouse-app .mst-page-head p:not(.mst-kicker) {
    margin: 7px 0 0;
    color: var(--wms-muted);
    font-size: 14px;
    max-width: 60ch;
}

/* ── Metric cards ────────────────────────────────────────────────── */
.mst-warehouse-app .mst-metrics {
    gap: 12px;
    margin-bottom: 22px;
}
.mst-warehouse-app .mst-metric {
    position: relative;
    min-height: 0;
    padding: 16px 18px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: none;
    transition: border-color .15s, transform .15s;
}
.mst-warehouse-app .mst-metric:hover { border-color: var(--wms-line-strong); }
.mst-warehouse-app .mst-metric span {
    color: var(--wms-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
}
.mst-warehouse-app .mst-metric strong {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--wms-ink);
    font-variant-numeric: tabular-nums;
}
.mst-warehouse-app .mst-metric small {
    margin-top: 6px;
    color: var(--wms-muted);
    font-size: 12.5px;
}
/* Attention metric: non-zero diffs / hidden items */
.mst-warehouse-app .mst-metric--alert { border-color: #fcd9b6; background: linear-gradient(180deg, #fffaf5, var(--wms-surface)); }
.mst-warehouse-app .mst-metric--alert strong { color: var(--wms-brand-dark); }
.mst-warehouse-app .mst-metric--alert::before {
    content: "";
    position: absolute;
    top: 16px; right: 16px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--wms-brand);
}

/* ── Tabs (segmented control) ────────────────────────────────────── */
.mst-warehouse-app .mst-tabs {
    gap: 2px;
    padding: 4px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: 12px;
    box-shadow: none;
}
.mst-warehouse-app .mst-tab {
    padding: 8px 16px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 14px;
    color: var(--wms-muted);
}
.mst-warehouse-app .mst-tab:hover { background: var(--wms-surface-2); color: var(--wms-ink); }
.mst-warehouse-app .mst-tab.is-active { background: var(--wms-brand); color: #fff; box-shadow: 0 1px 2px rgba(242,101,7,0.35); }
.mst-warehouse-app .mst-tab-badge { font-weight: 700; }

/* ── Panels ──────────────────────────────────────────────────────── */
.mst-warehouse-app .mst-panel {
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: none;
    overflow: hidden;
}
.mst-warehouse-app .mst-panel__head {
    padding: 15px 18px;
    border-bottom: 1px solid var(--wms-line);
}
.mst-warehouse-app .mst-panel__head h2 {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.01em;
}
.mst-warehouse-app .mst-panel__body { padding: 16px 18px; }

/* ── Buttons (one consistent system) ─────────────────────────────── */
.mst-warehouse-app .mst-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    padding: 10px 16px;
    min-height: 42px;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s, transform .05s;
}
.mst-warehouse-app .mst-button:active { transform: translateY(1px); }
.mst-warehouse-app .mst-button:focus-visible { outline: none; box-shadow: var(--wms-ring); }
.mst-warehouse-app .mst-button { background: var(--wms-ink); color: #fff; border-color: var(--wms-ink); }
.mst-warehouse-app .mst-button:hover { background: #1e293b; border-color: #1e293b; }
.mst-warehouse-app .mst-button--save,
.mst-warehouse-app .mst-button--primary { background: var(--wms-brand); border-color: var(--wms-brand); color: #fff; }
.mst-warehouse-app .mst-button--save:hover,
.mst-warehouse-app .mst-button--primary:hover { background: var(--wms-brand-dark); border-color: var(--wms-brand-dark); }
.mst-warehouse-app .mst-button--secondary { background: var(--wms-surface); color: var(--wms-ink); border-color: var(--wms-line-strong); }
.mst-warehouse-app .mst-button--secondary:hover { background: var(--wms-surface-2); color: var(--wms-ink); border-color: var(--wms-muted); }
.mst-warehouse-app .mst-button--ghost { background: var(--wms-surface); color: var(--wms-muted); border-color: var(--wms-line); }
.mst-warehouse-app .mst-button--ghost:hover { background: var(--wms-surface-2); color: var(--wms-ink); border-color: var(--wms-line-strong); }
.mst-warehouse-app .mst-button--small { min-height: 36px; padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.mst-warehouse-app .mst-button__icon { width: 15px; height: 15px; flex: 0 0 auto; }

/* ── Toolbar / search / filters ──────────────────────────────────── */
.mst-warehouse-app .mst-toolbar {
    background: var(--wms-surface);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: none;
    padding: 14px;
    gap: 12px;
}
.mst-warehouse-app .mst-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--wms-surface-2);
    border: 1px solid var(--wms-line-strong);
    border-radius: 11px;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.mst-warehouse-app .mst-search:focus-within { border-color: var(--wms-brand); box-shadow: var(--wms-ring); background: var(--wms-surface); }
.mst-warehouse-app .mst-search__icon { display: grid; place-items: center; padding-left: 13px; color: var(--wms-muted); }
.mst-warehouse-app .mst-search__input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 11px 12px;
    font-size: 15px;
    color: var(--wms-ink);
    min-height: 44px;
}
.mst-warehouse-app .mst-search__input:focus { outline: none; box-shadow: none; }
.mst-warehouse-app .mst-search__go {
    flex: 0 0 auto;
    border: none;
    background: var(--wms-ink);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 0 18px;
    align-self: stretch;
    cursor: pointer;
    transition: background .15s;
}
.mst-warehouse-app .mst-search__go:hover { background: #1e293b; }
.mst-warehouse-app .mst-control {
    border: 1px solid var(--wms-line-strong);
    border-radius: 11px;
    background: var(--wms-surface);
    min-height: 44px;
    font-size: 14px;
}
.mst-warehouse-app .mst-control:focus { border-color: var(--wms-brand); box-shadow: var(--wms-ring); outline: none; }
.mst-warehouse-app .mst-filter-check {
    border-radius: 11px;
    border: 1px solid var(--wms-line-strong);
    font-weight: 600;
    font-size: 14px;
    color: var(--wms-ink);
    background: var(--wms-surface);
}

/* ── Catalog item accordion ──────────────────────────────────────── */
.mst-warehouse-app .mst-item-list { gap: 8px; }
.mst-warehouse-app .mst-item {
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius);
    box-shadow: none;
    transition: border-color .15s, box-shadow .2s;
}
.mst-warehouse-app .mst-item:hover { border-color: var(--wms-line-strong); }
.mst-warehouse-app .mst-item[open] { border-color: var(--wms-brand); box-shadow: var(--wms-shadow-pop); }
.mst-warehouse-app .mst-item__head { padding: 14px 16px; gap: 13px; }
.mst-warehouse-app .mst-item__code { font-size: 15px; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.mst-warehouse-app .mst-item__title { font-size: 13.5px; color: var(--wms-muted); }
.mst-warehouse-app .mst-item__meta { font-size: 12px; color: var(--wms-muted); }
.mst-warehouse-app .mst-stat {
    min-width: 60px;
    padding: 7px 10px;
    background: var(--wms-surface-2);
    border: 1px solid var(--wms-line);
    border-radius: 10px;
}
.mst-warehouse-app .mst-stat b { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mst-warehouse-app .mst-stat i { font-size: 9.5px; letter-spacing: 0.04em; }
.mst-warehouse-app .mst-stat.is-counted { background: var(--wms-ok-bg); border-color: #bbf7d0; }
.mst-warehouse-app .mst-item__facts div { background: var(--wms-surface-2); border: 1px solid var(--wms-line); }
.mst-warehouse-app .mst-item__facts dt { font-size: 10.5px; letter-spacing: 0.03em; }

/* Status pills */
.mst-warehouse-app .mst-status {
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
}
.mst-warehouse-app .mst-lot-pill {
    padding: 3px 9px;
    border-radius: 7px;
    background: var(--wms-info-bg);
    color: var(--wms-info);
    font-size: 11px;
    font-weight: 600;
}

/* ── Product visibility list (admin) ─────────────────────────────── */
.mst-warehouse-app .mst-prod-stats {
    padding: 12px 2px;
    gap: 6px 18px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--wms-line);
    margin-bottom: 8px;
}
.mst-warehouse-app .mst-prod-list { gap: 0; }
.mst-warehouse-app .mst-prod-row {
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--wms-surface);
    border: none;
    border-bottom: 1px solid var(--wms-line);
    border-radius: 0;
    transition: background .12s;
}
.mst-warehouse-app .mst-prod-list .mst-prod-row:first-child { border-top-left-radius: var(--wms-radius); border-top-right-radius: var(--wms-radius); }
.mst-warehouse-app .mst-prod-list .mst-prod-row:last-child { border-bottom: none; border-bottom-left-radius: var(--wms-radius); border-bottom-right-radius: var(--wms-radius); }
.mst-warehouse-app .mst-prod-list { border: 1px solid var(--wms-line); border-radius: var(--wms-radius); overflow: hidden; }
.mst-warehouse-app .mst-prod-row:hover { background: var(--wms-surface-2); }
.mst-warehouse-app .mst-prod-row.is-hidden-prod { opacity: 1; background: var(--wms-surface-2); }
.mst-warehouse-app .mst-prod-row.is-hidden-prod .mst-prod-row__title { color: var(--wms-muted); }
.mst-warehouse-app .mst-prod-row__code {
    font: 600 11px/1 'ui-monospace', 'SF Mono', Menlo, monospace;
    color: var(--wms-muted);
    letter-spacing: 0.01em;
}
.mst-warehouse-app .mst-prod-row__title { font-size: 14px; font-weight: 600; color: var(--wms-ink); margin-top: 2px; }
.mst-warehouse-app .mst-prod-row__sku { font-size: 12px; color: var(--wms-muted); }
.mst-warehouse-app .mst-prod-tag {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 600;
    background: var(--wms-warn-bg);
    color: var(--wms-warn);
}
.mst-warehouse-app .mst-prod-row__form .mst-button { min-width: 116px; }

/* ── Comments / activity ─────────────────────────────────────────── */
.mst-warehouse-app .mst-comment,
.mst-warehouse-app .mst-activity {
    padding: 12px 14px;
    background: var(--wms-surface-2);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-radius-sm);
}
.mst-warehouse-app .mst-comment strong,
.mst-warehouse-app .mst-activity strong { font-size: 13px; font-weight: 650; }
.mst-warehouse-app .mst-comment p,
.mst-warehouse-app .mst-activity p { color: var(--wms-ink); font-size: 13px; }
.mst-warehouse-app .mst-comment p.mst-muted,
.mst-warehouse-app .mst-activity p.mst-muted { color: var(--wms-muted); }

/* ── Notices ─────────────────────────────────────────────────────── */
.mst-warehouse-app .mst-notice {
    border-radius: var(--wms-radius-sm);
    box-shadow: none;
    border: 1px solid transparent;
    padding: 12px 15px;
    font-size: 14px;
}
.mst-warehouse-app .mst-notice--success { background: var(--wms-ok-bg); color: var(--wms-ok); border-color: #bbf7d0; }
.mst-warehouse-app .mst-notice--error { background: var(--wms-danger-bg); color: var(--wms-danger); border-color: #fecaca; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .mst-warehouse-app .mst-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mst-warehouse-app .mst-admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
    .mst-warehouse-app .mst-metric strong { font-size: 26px; }
    .mst-warehouse-app .mst-prod-row { flex-wrap: wrap; gap: 8px 12px; }
    .mst-warehouse-app .mst-prod-row__info { flex: 1 1 100%; }
    .mst-warehouse-app .mst-prod-row__form { flex: 1 1 auto; }
    .mst-warehouse-app .mst-prod-row__form .mst-button { width: 100%; }
    .mst-warehouse-app .mst-tabs { width: 100%; }
    .mst-warehouse-app .mst-tab { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .mst-warehouse-app *,
    .mst-warehouse-app *::before,
    .mst-warehouse-app *::after { transition-duration: 0.01ms !important; }
}

/* ==================================================================
 * CATALOG TOOLBAR — authoritative override (last in cascade)
 * Stacked layout: prominent full-width search on top, filters wrap
 * below. Overrides the legacy/codex single-row grid+flex that let the
 * long warehouse <select> push the row past the container (overflow).
 * The min-width:0 on flex children is what actually stops the overflow.
 * ================================================================== */
.mst-warehouse-app--catalog .mst-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
}
.mst-warehouse-app--catalog .mst-search {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: 50px;
}
.mst-warehouse-app--catalog .mst-search__input {
    min-height: 50px;
    font-size: 16px;
}
.mst-warehouse-app--catalog .mst-search__go {
    padding: 0 22px;
    font-size: 15px;
}
.mst-warehouse-app--catalog .mst-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    flex: 0 0 auto;
}
.mst-warehouse-app--catalog .mst-filter-row .mst-control {
    flex: 1 1 220px;
    min-width: 0;
    min-height: 44px;
}
.mst-warehouse-app--catalog .mst-filter-row [name="wh_warehouse"] { min-width: 0; }
.mst-warehouse-app--catalog .mst-filter-check {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--wms-line-strong);
    border-radius: 11px;
    background: var(--wms-surface);
    color: var(--wms-ink);
    font-weight: 600;
    white-space: nowrap;
}
/* On wide screens give the search room but keep filters tidy below */
@media (min-width: 720px) {
    .mst-warehouse-app--catalog .mst-filter-row .mst-control { flex: 0 1 240px; }
    .mst-warehouse-app--catalog .mst-filter-check { margin-left: auto; }
}

/* EAN/Barcode shown as a clean line below the title (not a top-row pill) */
.mst-warehouse-app .mst-item__barcode {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    margin-top: 3px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--wms-muted);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mst-warehouse-app .mst-item__barcode svg { flex: 0 0 auto; color: var(--wms-muted); }

/* ================================================================
 * MULTI-WAREHOUSE: pill badge in the code-row + per-warehouse sections
 * ================================================================ */
.mst-warehouse-app .mst-wh-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--wms-bg-alt);
    color: var(--wms-muted);
    border: 1px solid var(--wms-line);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Compact facts list for multi-warehouse products (only shows shared fields) */
.mst-warehouse-app .mst-item__facts--compact {
    margin-bottom: 4px;
}

/* Per-warehouse section divider inside a multi-warehouse product body */
.mst-warehouse-app .mst-wh-section {
    border-top: 1px solid var(--wms-border);
    padding: 14px 0 10px;
}
.mst-warehouse-app .mst-wh-section:first-of-type {
    border-top: none;
    padding-top: 2px;
}
.mst-warehouse-app .mst-wh-section__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--wms-bg-alt);
    border-radius: 8px;
}
.mst-warehouse-app .mst-wh-section__label {
    font-size: 13px;
    font-weight: 700;
    color: var(--wms-ink);
    flex-shrink: 0;
}
.mst-warehouse-app .mst-wh-section__stock {
    font-size: 13px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--wms-ink);
    margin-left: auto;
}
.mst-warehouse-app .mst-wh-section__counted {
    font-size: 12px;
    font-weight: 600;
    color: var(--wms-ok);
    font-variant-numeric: tabular-nums;
}

/* ================================================================
 * TWO-STEP RECORDING: Σωστό / Διαφέρει
 * ================================================================ */

/* Container for the two action buttons */
.mst-warehouse-app .mst-record-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 4px;
}

/* Quick "Σωστό" form occupies full width */
.mst-warehouse-app .mst-record-ok { width: 100%; }

/* The big green OK button */
.mst-warehouse-app .mst-button--ok {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    background: var(--wms-ok-bg);
    color: var(--wms-ok);
    border: 1.5px solid var(--wms-ok);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    letter-spacing: 0.01em;
}
.mst-warehouse-app .mst-button--ok:hover,
.mst-warehouse-app .mst-button--ok:focus-visible {
    background: var(--wms-ok);
    color: #fff;
}

/* "Διαφέρει" expandable */
.mst-warehouse-app .mst-record-diff > summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 44px;
    padding: 0 16px;
    background: transparent;
    color: var(--wms-muted);
    border: 1.5px solid var(--wms-line);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    -webkit-appearance: none;
    transition: color 0.15s, border-color 0.15s;
}
.mst-warehouse-app .mst-record-diff > summary::-webkit-details-marker { display: none; }
.mst-warehouse-app .mst-record-diff[open] > summary {
    color: var(--wms-amber, #d97706);
    border-color: var(--wms-amber, #d97706);
}
.mst-warehouse-app .mst-record-diff__form {
    margin-top: 12px;
}

/* Already recorded: green chip + "Αλλαγή" inline */
.mst-warehouse-app .mst-record-done {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 0 4px;
}
.mst-warehouse-app .mst-record-done__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--wms-ok-bg);
    color: var(--wms-ok);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
}
.mst-warehouse-app .mst-record-done__meta {
    font-size: 12px;
    color: var(--wms-muted);
    font-weight: 500;
}
.mst-warehouse-app .mst-record-redo > summary {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--wms-line);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--wms-muted);
    cursor: pointer;
    list-style: none;
    -webkit-appearance: none;
}
.mst-warehouse-app .mst-record-redo > summary::-webkit-details-marker { display: none; }
.mst-warehouse-app .mst-record-redo > summary:hover { color: var(--wms-ink); border-color: var(--wms-line-strong); }
.mst-warehouse-app .mst-record-redo .mst-record-diff__form { margin-top: 10px; }

/* ── Lot "Σωστό" chip ───────────────────────────────────────────── */
.mst-lot-status--ok { background: var(--wms-ok-bg); color: var(--wms-ok); }
.mst-lot-ok-label { font-weight: 700; letter-spacing: 0.01em; }

/* ── Stats tab ──────────────────────────────────────────────────── */
.mst-stats-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 16px;
}

.mst-gauge-wrap {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.mst-gauge-svg {
    width: 148px;
    height: 148px;
    display: block;
}

.mst-gauge-meta {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mst-gauge-meta dt {
    font-size: 11px;
    color: var(--wms-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.mst-gauge-meta dd {
    font-size: 22px;
    font-weight: 700;
    margin: 2px 0 0;
    color: var(--wms-ink);
    font-variant-numeric: tabular-nums;
}

.mst-gauge-val--ok { color: var(--wms-ok); }
.mst-gauge-val--warn { color: #d97706; }

.mst-prog-bar {
    height: 7px;
    min-width: 80px;
    background: var(--wms-line);
    border-radius: 4px;
    overflow: hidden;
}

.mst-prog-bar__fill {
    height: 100%;
    background: var(--wms-brand);
    border-radius: 4px;
}

@media (max-width: 900px) {
    .mst-stats-grid { grid-template-columns: 1fr; }
    .mst-gauge-wrap { flex-direction: row; align-items: center; }
    .mst-gauge-svg { width: 110px; height: 110px; flex-shrink: 0; }
}
