.wh-page {
    display: grid;
    gap: 12px;
    padding: 16px;
    color: #f4f7f9;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.wh-filters,
.wh-actions,
.wh-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.wh-filters label,
.wh-form label,
.wh-stock-filters label {
    display: grid;
    gap: 4px;
    min-width: 140px;
    flex: 1;
    color: #b7c3ca;
    font-size: 12px;
}

.wh-filters input,
.wh-filters select,
.wh-form input,
.wh-form select,
.wh-form textarea,
.wh-stock-filters input,
.wh-stock-filters select {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: #10202a;
    color: #f4f7f9;
    padding: 10px 12px;
    font: inherit;
}

.wh-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.wh-card {
    min-width: 0;
    padding: 14px;
    background: #08131a;
    border-radius: 16px;
}

.wh-card h1,
.wh-card h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.wh-card p,
.wh-muted {
    margin: 0;
    color: #c5d2da;
    font-size: 13px;
}

.wh-cover {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 10px;
}

.wh-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    margin: 0 0 10px;
}

.wh-facts div {
    display: grid;
    gap: 2px;
}

.wh-facts dt {
    color: #c5d2da;
    font-size: 12px;
}

.wh-facts dd {
    margin: 0;
}

.wh-button {
    border: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: #123044;
    color: #f4f7f9;
    font: inherit;
    cursor: pointer;
}

.wh-button.is-active,
.wh-primary {
    background: #168cff;
}

.wh-button:disabled {
    opacity: 0.45;
    cursor: default;
}

.wh-file input {
    display: none;
}

.wh-table-wrap {
    overflow: auto;
    max-width: 100%;
    min-width: 0;
}

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

.wh-table th,
.wh-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    font-size: 13px;
    border-bottom: 1px solid #16303c;
}

.wh-stock-filters {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(160px, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.wh-stock-filters .wh-actions {
    grid-column: 1 / -1;
}

.wh-stock-scroll {
    overflow: auto;
    max-width: 100%;
}

.wh-stock-table {
    min-width: 760px;
}

.wh-stock-table th:first-child,
.wh-stock-table td:first-child {
    width: 42%;
    min-width: 240px;
}

.wh-stock-layout {
    position: relative;
}

.wh-stock-panel {
    padding: 12px;
    border-radius: 16px;
    background: #10202a;
    overflow: auto;
}

@media (min-width: 901px) and (max-width: 1559px) {
    .wh-stock-layout.has-card .wh-stock-panel {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 6;
        width: 360px;
        max-height: calc(100vh - 24px);
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    }
}

@media (min-width: 1560px) {
    .wh-stock-layout.has-card {
        display: grid;
        grid-template-columns: minmax(760px, 1fr) 360px;
        gap: 12px;
        align-items: start;
    }

    .wh-stock-layout.has-card .wh-stock-panel {
        position: sticky;
        top: 8px;
        max-height: calc(100vh - 16px);
    }
}

.wh-stock-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #10202a;
    padding-bottom: 8px;
}

.wh-issue-card.is-active {
    outline: 2px solid #168cff;
    outline-offset: 2px;
    background: #123044;
}

.wh-stock-panel-head h2 {
    margin: 0;
    flex: 1;
}

.wh-stock-back {
    display: none;
}

.wh-stock-event + .wh-stock-event {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #1c3342;
}

.wh-table tr.is-active td {
    background: #123044;
}

.wh-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.wh-doc-num,
button.wh-doc-num {
    white-space: nowrap;
}

button.wh-doc-num {
    border: 0;
    background: transparent;
    color: #168cff;
    padding: 0;
    font: inherit;
    cursor: pointer;
    text-align: left;
}

.wh-moves-table {
    min-width: 920px;
}

#wh-moves-scroll {
    overflow: auto;
    max-width: 100%;
}

.wh-doc-card p + p {
    margin-top: 4px;
}

.wh-formula {
    margin-top: 8px;
}

.wh-formula summary {
    cursor: pointer;
    color: #8ec8ff;
}

.wh-num.is-zero,
.is-zero {
    color: #8b9aa3;
}

.is-available:not(.is-zero) {
    color: #8ec8ff;
    font-weight: 700;
}

.wh-linkish {
    border: 0;
    padding: 0;
    background: transparent;
    color: #f4f7f9;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wh-marks,
.wh-stock-more {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.wh-mark {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 2px 8px;
    background: #163044;
    color: #d7e7f4;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.wh-table th {
    color: #c5d2da;
    font-weight: 600;
}

.wh-sub {
    color: #c5d2da;
    font-size: 12px;
}

.wh-message {
    margin: 8px 0 0;
    color: #8ec8ff;
    font-size: 13px;
}

.wh-message.is-error {
    color: #ffb020;
}

.wh-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.wh-rail-passport .wh-form {
    grid-template-columns: 1fr;
}

.wh-card textarea {
    min-height: 52px;
    resize: vertical;
}

.wh-form .wh-wide {
    grid-column: 1 / -1;
}

.wh-check {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 0;
}

.wh-check input {
    width: auto;
}

.ff-summary,
.ff-docs {
    padding: 8px 10px;
    border-radius: 10px;
    background: #0c1b24;
}

.ff-docs {
    margin-top: 8px;
}

.wh-lines {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.wh-line {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: #10181f;
}

@media (max-width: 1400px) {
    .wh-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.wh-issue {
    width: 100%;
    text-align: left;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.wh-issue small,
.wh-sub {
    display: block;
    color: #c5d2da;
}

.wh-issue span {
    min-width: 0;
}

.wh-issue small {
    overflow-wrap: anywhere;
}

.wh-issue-card .wh-table {
    min-width: 720px;
}

.wh-issue-lines {
    display: none;
}

.wh-issue-lines small {
    display: block;
    color: #c5d2da;
}

@media (max-width: 700px) {
    .wh-issue-table {
        display: none;
    }

    .wh-issue-lines {
        display: grid;
        gap: 8px;
    }
}

.wh-issue-card {
    margin-top: 12px;
}

.wh-error {
    color: #ffb4a8;
}

.wh-request-grid {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.wh-request-grid > * {
    min-width: 0;
}

.wh-request-grid > .wh-lines {
    max-height: calc(100vh - 180px);
    overflow: auto;
    align-content: start;
}

.wh-request-title {
    margin: 6px 0 10px;
    font-size: 18px;
    line-height: 1.35;
}

.wh-request-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
    margin: 0 0 12px;
}

.wh-request-meta div {
    min-width: 0;
}

.wh-request-meta dt {
    color: #8ea0aa;
    font-size: 12px;
}

.wh-request-meta dd {
    margin: 0;
}

.wh-request-brief {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    align-items: start;
}

.wh-request-progress {
    margin: 0 0 6px;
}

.wh-next {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(22, 140, 255, 0.45);
    border-radius: 12px;
    background: #10202a;
}

.wh-next p:first-child {
    margin-top: 0;
    color: #8ec8ff;
    font-size: 12px;
}

.wh-form.is-active {
    outline: 2px solid #168cff;
    outline-offset: 2px;
}

.wh-plan-table {
    min-width: 880px;
}

.wh-plan-table th:first-child,
.wh-plan-table td:first-child {
    min-width: 200px;
    white-space: normal;
}

.wh-plan-table th:last-child,
.wh-plan-table td:last-child {
    min-width: 9.5rem;
    white-space: nowrap;
}

.rq-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.rq-source {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rq-choice {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 120px;
    gap: 8px;
    align-items: end;
}

.rq-choice label,
.rq-choice .rq-name {
    min-width: 0;
}

.rq-choice .rq-name {
    display: grid;
    gap: 4px;
    color: #b7c3ca;
    font-size: 12px;
}

.rq-choice .rq-name strong {
    color: #f4f7f9;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.rq-decision {
    display: grid;
    gap: 8px;
    margin: 0 0 14px;
}

.rq-reason {
    display: grid;
    gap: 4px;
    color: #b7c3ca;
    font-size: 12px;
}

.rq-reason textarea {
    width: 100%;
    min-height: 96px;
    border: 0;
    border-radius: 10px;
    background: #10202a;
    color: #f4f7f9;
    padding: 10px 12px;
    font: inherit;
    resize: vertical;
}

.wh-fold {
    margin: 10px 0;
}

.wh-fold summary {
    cursor: pointer;
    color: #d7e7f4;
    font-size: 15px;
}

#notifications-card {
    position: relative;
}

.wh-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #168cff;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
}

.wh-notices {
    position: fixed;
    top: 72px;
    right: 12px;
    z-index: 30;
    width: min(380px, calc(100vw - 24px));
    max-height: min(70vh, 520px);
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: #12161c;
}

.wh-kpis,
.wh-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.wh-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.wh-kpi,
.wh-overview-block {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: #10181f;
    color: inherit;
    text-align: left;
    font: inherit;
}

button.wh-kpi,
button.wh-line,
button.wh-record {
    cursor: pointer;
}

.wh-kpi-static {
    cursor: default;
}

.wh-kpi-lines {
    display: grid;
    gap: 2px;
    margin: 6px 0 4px;
}

.wh-kpi-lines button {
    border: 0;
    padding: 3px 0;
    background: transparent;
    color: #e7eef2;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wh-record {
    display: grid;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: #10181f;
    color: #e7eef2;
    text-align: left;
    font: inherit;
}

.wh-record.is-active {
    border-color: #168cff;
    background: #123044;
    box-shadow: inset 3px 0 0 #168cff;
}

.wh-stock-row {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.wh-stock-row .wh-issue-card {
    margin-top: 0;
    min-width: 0;
    max-width: 100%;
}

.wh-stock-row .wh-issue-card .wh-table {
    min-width: 0;
}

.wh-stock-row .wh-issue-card .wh-table td,
.wh-stock-row .wh-issue-card p {
    overflow-wrap: anywhere;
}

#wh-stock-card h2,
[data-writeoff-decision] {
    scroll-margin-top: 16px;
}

.wh-record-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wh-record-head .wh-sub {
    display: inline;
}

.wh-status {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #163044;
    color: #d7e7f4;
    font-size: 12px;
    line-height: 1.4;
}

.wh-page :focus-visible {
    outline: 2px solid #168cff;
    outline-offset: 2px;
}

.wh-kpi strong {
    display: block;
    margin: 4px 0;
    color: #f4f7f9;
    font-size: 22px;
}

.wh-kpi span,
.wh-kpi small,
.wh-overview-block h2,
.wh-overview-block h3 {
    color: #b7c3ca;
}

.wh-overview-block h2,
.wh-overview-block h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.wh-overview-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.wh-kpi small,
.wh-overview-block .wh-sub {
    display: block;
}

@media (min-width: 1600px) {
    .wh-kpis {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.wh-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.wh-rail {
    display: grid;
    gap: 4px;
    align-content: start;
}

.wh-rail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    background: #08131a;
    color: #f4f7f9;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wh-rail-item.is-active {
    background: #168cff;
}

.wh-board-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wh-board-tabs .wh-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wh-board-search {
    margin-bottom: 12px;
}

.wh-board-search label {
    display: grid;
    gap: 4px;
    color: #b7c3ca;
    font-size: 12px;
}

.wh-board-search input {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: #10202a;
    color: #f4f7f9;
    padding: 10px 12px;
    font: inherit;
}

.wh-board-table {
    min-width: 760px;
}

.wh-photo {
    display: inline-block;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #10202a;
}

.wh-table tr.is-attention td,
.wh-table tr.is-selected td {
    background: rgba(22, 140, 255, 0.12);
}

.wh-table tr.is-attention td {
    background: rgba(226, 59, 59, 0.16);
}

.wh-link {
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.wh-asset-card,
.wh-label-preview {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.wh-asset-card .wh-form {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    margin-top: 0;
}

.wh-direct {
    display: grid;
    gap: 12px;
    margin: 12px 0 16px;
}

.wh-direct > label,
.wh-direct .wh-actions label {
    display: grid;
    gap: 4px;
    flex: 1 1 240px;
}

.wh-direct > label input,
.wh-direct .wh-actions input {
    width: 100%;
    box-sizing: border-box;
}

.wh-direct .wh-actions {
    align-items: end;
}

.wh-label-sheet {
    display: flex;
    flex-wrap: wrap;
    gap: 4mm;
}

.wh-label {
    width: 30mm;
    height: 20mm;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 1mm;
    padding: 1mm;
    background: #fff;
    color: #111;
    overflow: hidden;
}

.wh-label strong,
.wh-label span {
    display: block;
    font-size: 7px;
    line-height: 1.15;
}

.wh-label-qr {
    width: 16mm;
    height: 16mm;
    flex: 0 0 16mm;
}

.wh-label-qr img,
.wh-label-qr canvas {
    width: 16mm;
    height: 16mm;
}

@media print {
    body * {
        visibility: hidden;
    }

    .wh-label-sheet,
    .wh-label-sheet * {
        visibility: visible;
    }

    .wh-label-sheet {
        position: absolute;
        left: 0;
        top: 0;
    }
}

@media (max-width: 900px) {
    .wh-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .wh-rail {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .wh-rail-item {
        width: auto;
        white-space: nowrap;
    }

    .wh-main,
    .wh-form,
    .wh-request-grid,
    .wh-request-meta,
    .rq-line,
    .wh-stock-layout.has-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .wh-request-grid > .wh-lines {
        max-height: 280px;
    }

    .rq-choice {
        grid-template-columns: minmax(0, 1fr) minmax(6.5rem, 8rem);
    }

    .rq-choice .rq-name {
        grid-column: 1 / -1;
    }

    .wh-stock-layout.has-card .wh-stock-board {
        display: none;
    }

    .wh-stock-panel {
        position: static;
        max-height: none;
        padding: 0;
        background: transparent;
    }

    .wh-stock-back {
        display: inline-flex;
    }

    .wh-filters label,
    .wh-kpis,
    .wh-overview-grid,
    .wh-stock-filters {
        min-width: 0;
        flex-basis: 100%;
        grid-template-columns: minmax(0, 1fr);
    }
}

.at-panel {
    margin: 18px 18px 28px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 16px;
    background: rgba(8, 22, 34, .72);
    min-width: 0;
}

.at-panel h3,
.at-panel p {
    margin: 0 0 8px;
}

.at-panel .wh-form {
    grid-template-columns: minmax(0, 1fr);
}

.at-panel .at-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.at-qr-pop {
    margin-top: 12px;
    padding: 12px;
    width: fit-content;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
}

.at-qr-pop p {
    color: #10202a;
}

.at-status {
    display: grid;
    gap: 4px;
    margin: 8px 0 12px;
}

.at-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    background: #e0a106;
    vertical-align: middle;
}

.at-dot.is-done { background: #3ecf8e; }

.wh-notices .wh-notice.is-unread {
    background: #122c43;
    border-color: #2c6593;
    border-inline-start: 3px solid #56b1ff;
}

.wh-notices .wh-notice.is-read {
    background: #101920;
    border-inline-start: 3px solid transparent;
    color: #bdcbd6;
}

.wh-notice-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.wh-notice-state {
    flex: none;
    color: #adbfcd;
    font-size: 0.75rem;
}

.is-unread .wh-notice-state { color: #9ed7ff; }
.is-unread .wh-notice-state::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-inline-end: 5px;
    border-radius: 50%;
    background: #56b1ff;
    vertical-align: 0.12em;
}

.wh-rail-entry { min-width: 0; }
.wh-rail-passport { margin: 4px 0 8px; }
.wh-rail-passport .wh-facts { grid-template-columns: minmax(0, 1fr); }
.wh-rail-passport .wh-facts dd { overflow-wrap: anywhere; }

@media (max-width: 900px) {
    .wh-rail:has(.wh-rail-passport:not([hidden])) {
        display: grid;
        overflow-x: visible;
    }

    .wh-rail:has(.wh-rail-passport:not([hidden])) .wh-rail-item {
        width: 100%;
        white-space: normal;
    }
}
