/* Scoped to the warehouse workspace; leave other popup forms untouched. */
#popup-main-content.warehouse-screen {
    --wh-ink: #343957;
    --wh-muted: #69768a;
    --wh-green: #398557;
    --wh-line: #e1e7ee;
    padding: clamp(18px, 3vw, 42px);
    background: radial-gradient(ellipse at top right, #e9f3ee, transparent 55%), #f5f7fa;
    color: var(--wh-ink);
    overflow: auto;
}
.warehouse-screen .wh-view { max-width: 1600px; margin: 0 auto; }
.warehouse-screen .wh-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.warehouse-screen .wh-eyebrow { font-size: 11px; font-weight: 750; color: var(--wh-green); letter-spacing: .14em; margin: 0 0 12px; }
.warehouse-screen .wh-intro h2 { font-size: clamp(25px, 2.3vw, 34px); letter-spacing: -.035em; margin: 0 0 10px; font-weight: 750; color: var(--wh-ink); }
.warehouse-screen .wh-intro p:not(.wh-eyebrow) { margin: 0; color: var(--wh-muted); font-size: 14px; }
.warehouse-screen .wh-button, .wh-confirm .wh-button {
    appearance: none; display: inline-flex; justify-content: center; align-items: center;
    padding: 10px 17px; min-height: 42px; border: 1px solid #dce3eb;
    border-radius: 11px; background: #fff; color: #343957;
    font: inherit; font-size: 13px; font-weight: 650; line-height: 1.4;
    cursor: pointer; box-shadow: none; white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.warehouse-screen .wh-button:hover, .wh-confirm .wh-button:hover { background: #edf1f6; border-color: #bac7d6; color: #343957; transform: none; }
.warehouse-screen .wh-primary { color: #fff; background: var(--wh-green); border-color: var(--wh-green); }
.warehouse-screen .wh-primary:hover { color: #fff; background: #2c6c46; border-color: #2c6c46; }
.warehouse-screen .wh-danger { color: #b24b4b; border-color: #f0dede; background: #fff; }
.warehouse-screen .wh-danger:hover { color: #a33232; background: #fff0f0; border-color: #eabcbc; }
.warehouse-screen .wh-button:disabled, .wh-confirm .wh-button:disabled { opacity: .5; cursor: not-allowed; }
.warehouse-screen :is(button, input, select, a):focus-visible, .wh-confirm button:focus-visible { outline: 3px solid #7aab91; outline-offset: 3px; }
.warehouse-screen [hidden], .wh-confirm [hidden] { display: none !important; }
.warehouse-screen .wh-directory { background: white; border: 1px solid var(--wh-line); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 30px #25314a05; }
.warehouse-screen .wh-toolbar { display: flex; align-items: end; gap: 20px; padding: 24px; }
.warehouse-screen .wh-search { flex: 1; max-width: 520px; }
.warehouse-screen :is(.wh-search, .wh-page-size, .wh-field) { display: flex; flex-direction: column; gap: 8px; color: var(--wh-ink); font-size: 13px; font-weight: 650; margin: 0; }
.warehouse-screen .wh-count { margin-left: auto; align-self: center; background: #eef6f1; color: #34734d; border-radius: 30px; padding: 7px 13px; font-size: 12px; font-weight: 650; }
.warehouse-screen :is(input, select) { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #dce3eb; border-radius: 11px; background: #fbfcfe; padding: 10px 13px; color: var(--wh-ink); font: inherit; font-weight: 450; box-sizing: border-box; box-shadow: none; }
.warehouse-screen input::placeholder { color: #8b97a6; }
.warehouse-screen .wh-page-size { min-width: 94px; }
.warehouse-screen .wh-table-scroll { overflow-x: auto; }
.warehouse-screen .wh-table { width: 100%; border-collapse: collapse; table-layout: auto; margin: 0; font-size: 14px; }
.warehouse-screen .wh-table th { background: #f6f8fa; color: var(--wh-muted); text-align: left; font-weight: 650; font-size: 12px; padding: 14px 24px; border: 0; border-block: 1px solid var(--wh-line); }
.warehouse-screen .wh-table td { padding: 24px; border: 0; border-bottom: 1px solid #edf0f4; vertical-align: middle; background: white; }
.warehouse-screen .wh-table tr:last-child td { border-bottom: 0; }
.warehouse-screen .wh-table th:last-child { width: 190px; }
.warehouse-screen .wh-identity { display: flex; gap: 14px; align-items: center; }
.warehouse-screen .wh-identity strong { display: block; color: var(--wh-ink); font-weight: 650; overflow-wrap: anywhere; }
.warehouse-screen .wh-identity small { display: block; font-size: 12px; color: var(--wh-muted); margin-top: 5px; }
.warehouse-screen .wh-building { width: 44px; height: 48px; border-radius: 12px; background: #edf6f0; color: var(--wh-green); display: grid; place-items: center; flex: 0 0 auto; font-size: 21px; }
.warehouse-screen .wh-map-link { font-weight: 650; color: var(--wh-green); text-decoration: none; }
.warehouse-screen .wh-map-link:hover { text-decoration: underline; }
.warehouse-screen .wh-coordinates { display: block; color: var(--wh-muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.warehouse-screen .wh-row-actions, .warehouse-screen .wh-pagination > div { display: flex; gap: 8px; }
.warehouse-screen :is(.wh-missing, .wh-readonly) { color: var(--wh-muted); font-size: 13px; }
.warehouse-screen .wh-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--wh-line); color: var(--wh-muted); font-size: 12px; }
.warehouse-screen .wh-empty { text-align: center; padding: 48px 24px; background: linear-gradient(120deg,#fbfcfe,#f0f7f3); }
.warehouse-screen .wh-empty h3 { font-size: 23px; color: var(--wh-ink); }
.warehouse-screen .wh-empty p { color: var(--wh-muted); }
.warehouse-screen .wh-message, .wh-confirm .wh-message { padding: 13px 16px; margin: 0 0 20px; border-radius: 12px; background: #e8f3ec; color: #2b6943; font-size: 13px; }
.warehouse-screen .wh-message-error, .wh-confirm .wh-message-error { background: #fff0f0; color: #9e3333; }
.warehouse-screen .wh-editor { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.5fr); gap: 0; padding: 0; margin: 0; background: white; border: 1px solid var(--wh-line); border-radius: 20px; overflow: hidden; }
.warehouse-screen :is(.wh-form-panel, .wh-map-panel) { min-width: 0; padding: clamp(20px, 2.5vw, 36px); }
.warehouse-screen .wh-form-panel { border-right: 1px solid var(--wh-line); }
.warehouse-screen .wh-step { display: block; color: var(--wh-green); font-size: 11px; font-weight: 700; letter-spacing: .1em; margin-bottom: 12px; }
.warehouse-screen .wh-editor h3 { margin: 0 0 12px; font-size: 21px; color: var(--wh-ink); }
.warehouse-screen .wh-form-panel > p { color: var(--wh-muted); font-size: 13px; margin: 0 0 28px; }
.warehouse-screen .wh-field small { font-size: 11px; font-weight: 400; color: var(--wh-muted); }
.warehouse-screen .wh-coordinate-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.warehouse-screen .wh-location-hint { display: flex; gap: 12px; padding: 18px; background: #f2f6fa; border-radius: 12px; color: var(--wh-muted); font-size: 12px; line-height: 1.65; margin-top: 28px; }
.warehouse-screen .wh-location-hint i { color: var(--wh-green); font-size: 18px; }
.warehouse-screen .wh-address { margin: 20px 0 14px; }
.warehouse-screen .wh-map { height: 330px; border-radius: 14px; background: repeating-linear-gradient(45deg,#eef3f0,#eef3f0 20px,#f4f7f5 20px,#f4f7f5 40px); overflow: hidden; border: 1px solid var(--wh-line); }
.warehouse-screen .wh-map-unavailable { height: 200px; }
.warehouse-screen .wh-map-status { color: var(--wh-muted); font-size: 12px; line-height: 1.6; margin: 12px 0 0; }
.warehouse-screen .wh-form-footer { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--wh-line); background: #fafbfd; padding: 20px 30px; }
.warehouse-screen .wh-form-footer .wh-message { flex-basis: 100%; margin: 0; }
.warehouse-screen .wh-save-hint { color: var(--wh-muted); font-size: 12px; }
.warehouse-screen .wh-form-actions, .wh-confirm .wh-form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.wh-autocomplete { z-index: 20000 !important; }
.wh-confirm { position: fixed; inset: 0; margin: auto; width: min(480px,calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); border: 0; border-radius: 20px; background: #fff; color: #343957; padding: 28px; box-shadow: 0 28px 80px #15263b44; }
.wh-confirm::backdrop { background: #18223770; backdrop-filter: blur(4px); }
.wh-confirm h3 { font-size: 22px; color: #343957; margin: 0 0 14px; }
.wh-confirm p { font-size: 14px; color: #65728a; line-height: 1.65; }
.wh-confirm .wh-delete-confirm { color: #fff; background: #b64040; border-color: #b64040; }
.wh-confirm .wh-delete-confirm:hover { color: #fff; background: #963333; }
@media (max-width: 800px) {
    .warehouse-screen .wh-editor { grid-template-columns: 1fr; }
    .warehouse-screen .wh-form-panel { border-right: 0; border-bottom: 1px solid var(--wh-line); }
    .warehouse-screen .wh-map { height: 280px; }
}
@media (max-width: 600px) {
    .warehouse-screen .wh-intro { flex-direction: column; align-items: stretch; gap: 18px; margin-bottom: 22px; }
    .warehouse-screen .wh-toolbar { padding: 18px; flex-wrap: wrap; gap: 14px; }
    .warehouse-screen .wh-search { flex: 1 0 100%; }
    .warehouse-screen .wh-count { margin: 0 auto 0 0; }
    .warehouse-screen .wh-table thead { display: none; }
    .warehouse-screen .wh-table, .warehouse-screen .wh-table tbody, .warehouse-screen .wh-table tr, .warehouse-screen .wh-table td { display: block; width: 100%; box-sizing: border-box; }
    .warehouse-screen .wh-table tr { padding: 18px; border-top: 1px solid var(--wh-line); }
    .warehouse-screen .wh-table td { padding: 8px 0; border: 0; }
    .warehouse-screen .wh-row-actions { margin-top: 6px; }
    .warehouse-screen .wh-row-actions button { flex: 1; }
    .warehouse-screen .wh-pagination { flex-direction: column; padding: 18px; }
    .warehouse-screen .wh-pagination > div { width: 100%; }
    .warehouse-screen .wh-pagination button { flex: 1; }
    .warehouse-screen .wh-form-footer { padding: 20px; }
    .warehouse-screen .wh-form-actions { width: 100%; }
    .warehouse-screen .wh-form-actions button { flex: 1; }
    .warehouse-screen :is(input, select) { font-size: 16px; }
    .wh-confirm .wh-form-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .warehouse-screen .wh-button { transition: none; } }
