/* ===========================================
   WMS — Modern UI 2026
   Soft shadows, large radii, gradient accents
   =========================================== */

/* --- Google Fonts — IBM Plex Sans + IBM Plex Mono --- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* --- Design tokens — Direction B (Balanced) --- */
:root,
[data-bs-theme="light"] {
    --wms-font:       'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --wms-font-mono:  'IBM Plex Mono', 'SF Mono', Menlo, monospace;
    --wms-radius:     10px;
    --wms-radius-sm:  8px;
    --wms-radius-lg:  16px;
    --wms-border-w:   1px;

    --wms-bg:            #f5f2ed;
    --wms-surface:       #fbfaf7;
    --wms-surface-alt:   #f0ece4;
    --wms-border:        #e6e1d6;
    --wms-border-strong: #d3cbb9;
    --wms-text:          #1c1917;
    --wms-text-muted:    #57534e;
    --wms-text-dim:      #a8a29e;

    --wms-accent:       #c2410c;
    --wms-accent-fg:    #fffbeb;
    --wms-accent-soft:  #fff7ed;
    --wms-success:      #166534;
    --wms-success-soft: #f0fdf4;
    --wms-warn:         #a16207;
    --wms-warn-soft:    #fefce8;
    --wms-danger:       #9f1239;
    --wms-danger-soft:  #fff1f2;

    --wms-chrome:     #1c1917;
    --wms-chrome-fg:  #fbfaf7;

    --wms-shadow:        0 1px 2px rgba(28,25,23,0.04), 0 1px 1px rgba(28,25,23,0.02);
    --wms-shadow-hover:  0 4px 14px rgba(28,25,23,0.08);
    --wms-shadow-accent: 0 8px 24px rgba(194,65,12,0.25);
}

[data-bs-theme="dark"] {
    --wms-bg:            #1c1917;
    --wms-surface:       #292524;
    --wms-surface-alt:   #1c1917;
    --wms-border:        #44403c;
    --wms-border-strong: #57534e;
    --wms-text:          #fafaf9;
    --wms-text-muted:    #d6d3d1;
    --wms-text-dim:      #a8a29e;

    --wms-accent:       #fb923c;
    --wms-accent-fg:    #1c1917;
    --wms-accent-soft:  #431407;
    --wms-success:      #4ade80;
    --wms-success-soft: #052e16;
    --wms-warn:         #fbbf24;
    --wms-warn-soft:    #451a03;
    --wms-danger:       #fb7185;
    --wms-danger-soft:  #4c0519;

    --wms-chrome:     #0c0a09;
    --wms-chrome-fg:  #fafaf9;

    --wms-shadow:        0 1px 2px rgba(0,0,0,0.3);
    --wms-shadow-hover:  0 4px 14px rgba(0,0,0,0.45);
    --wms-shadow-accent: 0 8px 24px rgba(251,146,60,0.35);
}

/* --- Base --- */
body {
    font-family: var(--wms-font);
    background: var(--wms-bg);
    color: var(--wms-text);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =============================================================
   LAYOUT — desktop shell (≥1024) + mobile stack (<1024)
   ============================================================= */
.wms-shell {
    display: flex;
    min-height: 100vh;
}
.wms-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.wms-content {
    flex: 1;
    padding: 20px 28px 28px;
    overflow-x: hidden;
}

/* Desktop / mobile switch — hidden by default, shown only below 1024px */
.wms-bottom-nav { display: none !important; }
.wms-sidebar-toggle { display: none !important; }
@media (max-width: 1023.98px) {
    .wms-sidebar.offcanvas-lg { display: flex; width: 280px; }
    .wms-topbar { padding: 12px 16px; }
    .wms-content { padding: 14px 16px 96px; }
    .wms-content.wms-content--fullbleed { padding: 0 0 96px; }
    .wms-bottom-nav { display: flex !important; }
    .wms-sidebar-toggle { display: grid !important; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-15px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* --- Smooth transitions on theme change --- */
body, .wms-topbar, .wms-bottom-nav, .wms-card, .wms-sidebar,
.form-control, .btn, .wms-btn, .wms-input {
    transition: background-color 0.25s ease, color 0.2s ease, border-color 0.2s ease;
}

/* --- Scrollbar styling --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(107, 114, 128, 0.3);
    border-radius: 3px;
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.wms-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--wms-surface-alt);
    border-right: var(--wms-border-w) solid var(--wms-border);
    display: flex;
    flex-direction: column;
}
.wms-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
}
.wms-brand-mark {
    width: 32px; height: 32px;
    background: var(--wms-accent);
    color: var(--wms-accent-fg);
    border-radius: var(--wms-radius-sm);
    display: grid; place-items: center;
    font-family: var(--wms-font-mono);
    font-weight: 700; font-size: 14px;
}
.wms-brand-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.wms-brand-sub   { font-size: 11px; color: var(--wms-text-muted); }

.wms-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.wms-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--wms-radius-sm);
    color: var(--wms-text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    transition: background .15s, color .15s;
}
.wms-nav__item i { font-size: 16px; line-height: 1; color: var(--wms-text-muted); }
.wms-nav__item:hover {
    background: var(--wms-surface);
    color: var(--wms-text);
}
.wms-nav__item.is-active {
    background: var(--wms-surface);
    color: var(--wms-text);
    font-weight: 500;
    box-shadow: 0 1px 0 var(--wms-border);
}
.wms-nav__item.is-active i { color: var(--wms-accent); }

.wms-sidebar__foot {
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: var(--wms-border-w) solid var(--wms-border);
}
.wms-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--wms-accent);
    color: var(--wms-accent-fg);
    display: grid; place-items: center;
    font-weight: 600; font-size: 12px;
    flex-shrink: 0;
}
.wms-user { flex: 1; min-width: 0; }
.wms-user__name { font-size: 13px; font-weight: 500; }
.wms-user__role { font-size: 11px; color: var(--wms-text-muted); }
.wms-icon-btn {
    width: 30px; height: 30px;
    border-radius: var(--wms-radius-sm);
    display: grid; place-items: center;
    color: var(--wms-text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.wms-icon-btn:hover { background: var(--wms-surface); color: var(--wms-text); }

/* =============================================================
   TOPBAR
   ============================================================= */
.wms-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px 0;
    flex-shrink: 0;
}
.wms-topbar__titles { min-width: 0; }
.wms-topbar__crumb {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wms-text-muted);
}
.wms-topbar__title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 2px;
    color: var(--wms-text);
}
.wms-topbar__spacer { flex: 1; }
.wms-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wms-inline-form { display: inline; margin: 0; }
.wms-sidebar-toggle {
    width: 36px; height: 36px;
    border: var(--wms-border-w) solid var(--wms-border);
    background: var(--wms-surface);
    border-radius: var(--wms-radius-sm);
    display: grid; place-items: center;
    color: var(--wms-text);
}

/* =============================================================
   BUTTONS (new naming; Bootstrap .btn kept for legacy forms)
   ============================================================= */
.wms-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--wms-font);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-sm);
    background: var(--wms-surface);
    color: var(--wms-text);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.wms-btn:hover { background: var(--wms-surface-alt); }
.wms-btn--primary {
    background: var(--wms-accent);
    border-color: var(--wms-accent);
    color: var(--wms-accent-fg);
}
.wms-btn--primary:hover {
    background: var(--wms-accent);
    box-shadow: var(--wms-shadow-accent);
    color: var(--wms-accent-fg);
}
.wms-btn--ghost {
    background: transparent;
    border-color: transparent;
    color: var(--wms-text-muted);
}
.wms-btn--ghost:hover { color: var(--wms-text); background: var(--wms-surface-alt); }
.wms-btn--danger {
    background: var(--wms-danger);
    border-color: var(--wms-danger);
    color: #fff;
}
.wms-btn--sm { padding: 6px 10px; font-size: 12px; }
.wms-btn--lg { padding: 12px 18px; font-size: 14px; min-height: 44px; }
.wms-btn--block { width: 100%; justify-content: center; }
.wms-btn i { font-size: 14px; }

/* =============================================================
   BOTTOM NAV (mobile)
   ============================================================= */
.wms-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1030;
    background: var(--wms-surface);
    border-top: var(--wms-border-w) solid var(--wms-border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.wms-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    color: var(--wms-text-muted);
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
    transition: color .15s;
}
.wms-bottom-nav__item i { font-size: 20px; line-height: 1; }
.wms-bottom-nav__item.is-active { color: var(--wms-accent); font-weight: 600; }
.wms-bottom-nav__item:hover { color: var(--wms-accent); }

/* =============================================================
   PRIMITIVES — Card, Field, Badge, Table, Alert
   ============================================================= */

/* --- Cards --- */
.wms-card {
    background: var(--wms-surface);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-lg);
    overflow: hidden;
}
.wms-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
}
.wms-card__title { font-size: 15px; font-weight: 600; margin: 0; }
.wms-card__body { padding: 20px; }
.wms-card__foot {
    padding: 14px 18px;
    border-top: var(--wms-border-w) solid var(--wms-border);
    background: var(--wms-surface-alt);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Fields (form-row) --- */
.wms-field { display: block; }
.wms-field__label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wms-text-muted);
    margin-bottom: 7px;
    display: block;
}
.wms-field__input,
.wms-field input[type=text],
.wms-field input[type=number],
.wms-field input[type=password],
.wms-field input[type=email],
.wms-field textarea,
.wms-field select,
.wms-input {
    width: 100%;
    background: var(--wms-surface-alt);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-sm);
    padding: 10px 14px;
    font-family: var(--wms-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--wms-text);
    transition: border-color .15s, box-shadow .15s;
}
.wms-field__input.is-mono,
.wms-input.is-mono { font-family: var(--wms-font-mono); letter-spacing: 0.01em; }
.wms-field input:focus,
.wms-field textarea:focus,
.wms-field select:focus,
.wms-input:focus {
    outline: none;
    border-color: var(--wms-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-accent) 15%, transparent);
}
.wms-field__hint { font-size: 11px; color: var(--wms-text-muted); margin-top: 6px; }
.wms-field__hint.is-ok { color: var(--wms-success); }
.wms-field__hint.is-error { color: var(--wms-danger); }

/* --- Bootstrap overrides — legacy templates --- */
.form-control, .form-select {
    background: var(--wms-surface-alt);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-sm);
    color: var(--wms-text);
    padding: 10px 14px;
    font-family: var(--wms-font);
    font-size: 14px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--wms-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-accent) 15%, transparent);
    background: var(--wms-surface-alt);
    color: var(--wms-text);
}
.form-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--wms-text-muted);
    margin-bottom: 7px;
}
.form-control-lg { padding: 12px 16px; font-size: 15px; }

.btn {
    border-radius: var(--wms-radius-sm);
    font-family: var(--wms-font);
    font-weight: 500;
    font-size: 13px;
    padding: 8px 14px;
}
.btn-primary, .btn-primary:disabled {
    background: var(--wms-accent);
    border-color: var(--wms-accent);
    color: var(--wms-accent-fg);
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--wms-accent);
    border-color: var(--wms-accent);
    color: var(--wms-accent-fg);
    box-shadow: var(--wms-shadow-accent);
}
.btn-outline-primary {
    background: transparent;
    border-color: var(--wms-accent);
    color: var(--wms-accent);
}
.btn-outline-primary:hover { background: var(--wms-accent); color: var(--wms-accent-fg); }
.btn-secondary, .btn-outline-secondary {
    background: var(--wms-surface);
    border-color: var(--wms-border);
    color: var(--wms-text);
}
.btn-outline-secondary:hover { background: var(--wms-surface-alt); color: var(--wms-text); }
.btn-danger { background: var(--wms-danger); border-color: var(--wms-danger); color: #fff; }
.btn-outline-danger { color: var(--wms-danger); border-color: var(--wms-danger); background: transparent; }
.btn-outline-danger:hover { background: var(--wms-danger); color: #fff; }
.btn-success { background: var(--wms-success); border-color: var(--wms-success); color: #fff; }

.btn-warehouse {
    min-height: 48px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--wms-radius);
    letter-spacing: 0;
}

/* --- Badges --- */
.wms-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--wms-font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.4;
}
.wms-badge--accent  { background: var(--wms-accent-soft);  color: var(--wms-accent); }
.wms-badge--success { background: var(--wms-success-soft); color: var(--wms-success); }
.wms-badge--warn    { background: var(--wms-warn-soft);    color: var(--wms-warn); }
.wms-badge--danger  { background: var(--wms-danger-soft);  color: var(--wms-danger); }
.wms-badge--muted   { background: var(--wms-surface-alt);  color: var(--wms-text-muted); }

.badge {
    font-family: var(--wms-font-mono);
    font-size: 10px;
    font-weight: 700;
    border-radius: 4px;
    padding: 3px 8px;
    letter-spacing: 0.05em;
}
.badge.bg-secondary { background: var(--wms-surface-alt) !important; color: var(--wms-text-muted) !important; }

/* --- Alerts --- */
.wms-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--wms-radius);
    border: var(--wms-border-w) solid var(--wms-border);
    background: var(--wms-surface);
    font-size: 13px;
    color: var(--wms-text);
}
.wms-alert--success { border-color: var(--wms-success); background: var(--wms-success-soft); color: var(--wms-success); }
.wms-alert--warn,
.wms-alert--warning { border-color: var(--wms-warn);    background: var(--wms-warn-soft);    color: var(--wms-warn); }
.wms-alert--danger  { border-color: var(--wms-danger);  background: var(--wms-danger-soft);  color: var(--wms-danger); }
.wms-alert--error   { border-color: var(--wms-danger);  background: var(--wms-danger-soft);  color: var(--wms-danger); }
.wms-alert--info    { border-color: var(--wms-accent);  background: var(--wms-accent-soft);  color: var(--wms-accent); }
.wms-alert--debug   { border-color: var(--wms-border);  background: var(--wms-surface-alt);  color: var(--wms-text-muted); }

.alert {
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius);
    font-size: 13px;
    background: var(--wms-surface);
    color: var(--wms-text);
}
.alert-success { border-color: var(--wms-success); background: var(--wms-success-soft); color: var(--wms-success); }
.alert-danger  { border-color: var(--wms-danger);  background: var(--wms-danger-soft);  color: var(--wms-danger); }
.alert-warning { border-color: var(--wms-warn);    background: var(--wms-warn-soft);    color: var(--wms-warn); }

.soft-alert {
    position: fixed;
    top: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1050;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: var(--wms-shadow-hover);
    animation: slideIn 0.3s ease, fadeOut 0.4s ease 2.6s forwards;
}

/* --- Tables --- */
.wms-table, .table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    color: var(--wms-text);
}
.wms-table thead th, .table thead th {
    background: var(--wms-surface-alt);
    color: var(--wms-text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 10px 14px;
    text-align: left;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
}
.wms-table tbody td, .table tbody td {
    padding: 12px 14px;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
    vertical-align: middle;
    background: var(--wms-surface);
}
.wms-table tbody tr:hover td, .table tbody tr:hover td { background: var(--wms-surface-alt); }
.table-danger td, .table-danger { background: var(--wms-danger-soft) !important; }
.table-success td, .table-success { background: var(--wms-success-soft) !important; }

/* --- Checkboxes / radios --- */
.form-check {
    padding: 8px 8px 8px 2.2rem;
    border-radius: var(--wms-radius-sm);
    transition: background .15s;
}
.form-check:hover { background: var(--wms-surface-alt); }
.form-check-input:checked {
    background-color: var(--wms-accent);
    border-color: var(--wms-accent);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-accent) 15%, transparent);
    border-color: var(--wms-accent);
}

/* --- Utility --- */
.wms-mono { font-family: var(--wms-font-mono); }
.wms-muted { color: var(--wms-text-muted); }
.wms-dim { color: var(--wms-text-dim); }
.wms-crumb {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wms-text-muted);
}
.wms-section-title {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wms-text-muted);
    font-weight: 600;
    margin: 18px 4px 10px;
}
.wms-divider { height: 1px; background: var(--wms-border); margin: 12px 0; }

h5, .h5 { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin-bottom: 12px; }
h6, .h6 { font-weight: 600; font-size: 15px; margin-bottom: 8px; }

/* =============================================================
   RECEPTION
   ============================================================= */
.wms-reception-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 14px;
}
@media (max-width: 1023.98px) {
    .wms-reception-grid { grid-template-columns: 1fr; }
}
.wms-form-grid {
    display: grid;
    gap: 16px;
}
.wms-form-grid__row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}
@media (max-width: 640px) {
    .wms-form-grid__row { grid-template-columns: 1fr; }
}
.wms-form-grid__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.wms-steps { display: flex; gap: 5px; }
.wms-steps__dot {
    width: 24px; height: 4px; border-radius: 2px;
    background: var(--wms-border);
}
.wms-steps__dot.is-active { background: var(--wms-accent); }
.wms-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--wms-font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--wms-success);
    letter-spacing: 0.05em;
}
.wms-live__dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wms-success);
    animation: wms-pulse 1.6s ease-in-out infinite;
}
@keyframes wms-pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.wms-empty {
    padding: 24px;
    text-align: center;
    color: var(--wms-text-muted);
    font-size: 13px;
}
.wms-op-row {
    padding: 14px 20px;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.wms-op-row:last-child { border-bottom: 0; }
.wms-op-row__badge {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-family: var(--wms-font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}
.wms-op-row__badge--rcv { background: rgba(22,101,52,0.13);  color: var(--wms-success); }
.wms-op-row__badge--shp { background: rgba(194,65,12,0.13);  color: var(--wms-accent); }
.wms-op-row__badge--mov { background: rgba(161,98,7,0.13);   color: var(--wms-warn); }
.wms-op-row__badge--inv { background: rgba(87,83,78,0.13);   color: var(--wms-text-muted); }
.wms-op-row__main { flex: 1; min-width: 0; }
.wms-op-row__label { font-size: 13px; font-weight: 500; }
.wms-op-row__meta {
    font-family: var(--wms-font-mono);
    font-size: 12px;
    color: var(--wms-text-muted);
    margin-top: 2px;
}
.wms-op-row__time {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    color: var(--wms-text-dim);
    flex-shrink: 0;
}

/* =============================================================
   SHIPMENT
   ============================================================= */
.wms-search-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}
.wms-search-row__field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wms-surface-alt);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-sm);
    padding: 0 14px;
}
.wms-search-row__field i { color: var(--wms-text-muted); font-size: 15px; }
.wms-search-row__field input {
    flex: 1;
    background: transparent;
    border: 0;
    padding: 11px 0;
    font-family: var(--wms-font-mono);
    font-size: 14px;
    color: var(--wms-text);
}
.wms-search-row__field input:focus { outline: none; }

.wms-pallet-card {
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius);
    overflow: hidden;
}
.wms-pallet-card__status {
    padding: 14px 18px;
    background: var(--wms-success-soft);
    border-bottom: var(--wms-border-w) solid var(--wms-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.wms-pallet-card__status--warn {
    background: var(--wms-warn-soft);
}
.wms-pallet-card__check {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: #fff;
    flex-shrink: 0;
}
.wms-pallet-card__check--ok   { background: var(--wms-success); }
.wms-pallet-card__check--warn { background: var(--wms-warn); }
.wms-pallet-card__text { flex: 1; min-width: 0; }
.wms-pallet-card__heading { font-size: 13px; font-weight: 600; color: var(--wms-success); }
.wms-pallet-card__heading--warn { color: var(--wms-warn); }
.wms-pallet-card__sub { font-size: 11px; color: var(--wms-text-muted); margin-top: 2px; }
.wms-pallet-card__fields {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 768px) {
    .wms-pallet-card__fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .wms-pallet-card__fields { grid-template-columns: 1fr; }
}
.wms-pallet-card__foot {
    padding: 14px 18px;
    border-top: var(--wms-border-w) solid var(--wms-border);
    background: var(--wms-surface-alt);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wms-list { display: flex; flex-direction: column; }
.wms-list__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
}
.wms-list__row:last-child { border-bottom: 0; }

/* =============================================================
   STORAGE MAP
   ============================================================= */
.wms-map-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 14px;
}
@media (max-width: 1279.98px) {
    .wms-map-grid { grid-template-columns: 1fr; }
}
.wms-map-grid__main { display: flex; flex-direction: column; gap: 14px; }
.wms-map-grid__side { display: flex; flex-direction: column; gap: 14px; }

.wms-map-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 0;
}
@media (max-width: 640px) { .wms-map-summary { grid-template-columns: 1fr 1fr; } }
.wms-map-summary__cell {
    padding: 16px 18px;
    border-right: var(--wms-border-w) solid var(--wms-border);
}
.wms-map-summary__cell:last-child { border-right: 0; }
.wms-map-summary__label { font-size: 11px; color: var(--wms-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.wms-map-summary__value {
    font-family: var(--wms-font-mono);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 6px;
}
.wms-map-summary__sub { font-size: 11px; color: var(--wms-text-muted); margin-top: 4px; }

.wms-legend { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--wms-text-muted); }
.wms-legend__chip { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }

.wms-heatmap { display: flex; flex-direction: column; gap: 4px; }
.wms-heatmap__row { display: flex; align-items: center; gap: 4px; }
.wms-heatmap__alley {
    width: 32px; flex-shrink: 0;
    font-family: var(--wms-font-mono);
    font-size: 11px; font-weight: 600;
    color: var(--wms-text-muted);
    text-align: center;
}
.wms-heatmap__cell {
    flex: 1;
    aspect-ratio: 1 / 1;
    border: 0;
    border-radius: 3px;
    font-family: var(--wms-font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--wms-text);
    cursor: pointer;
    transition: outline .15s, transform .15s;
    max-width: 64px;
}
.wms-heatmap__cell:hover { outline: 2px solid var(--wms-accent); transform: scale(1.05); z-index: 1; }
.wms-heatmap__cell--b0 { background: var(--wms-surface-alt); color: var(--wms-text-muted); }
.wms-heatmap__cell--b1 { background: #bbf7d0; color: #14532d; }
.wms-heatmap__cell--b2 { background: #fde68a; color: #713f12; }
.wms-heatmap__cell--b3 { background: #fdba74; color: #7c2d12; }
.wms-heatmap__cell--b4 { background: #fca5a5; color: #7f1d1d; }
.wms-heatmap__cell--b5 { background: #7f1d1d; color: #fff; }

.wms-channel-grid { width: 100%; border-collapse: collapse; }
.wms-channel-grid th {
    font-size: 10px; font-weight: 600;
    color: var(--wms-text-muted);
    padding: 6px 8px;
    font-family: var(--wms-font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
}
.wms-channel-grid td { padding: 3px; text-align: center; }
.wms-cell {
    width: 100%; min-width: 44px;
    aspect-ratio: 1.4 / 1;
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: 4px;
    font-family: var(--wms-font-mono);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    background: var(--wms-surface);
    color: var(--wms-text-muted);
    transition: outline .15s, transform .15s;
}
.wms-cell:hover { outline: 2px solid var(--wms-accent); }
.wms-cell--empty { background: var(--wms-surface-alt); }
.wms-cell--occupied { background: #fdba74; color: #7c2d12; }
.wms-cell--reserved { background: #fde68a; color: #713f12; }
.wms-cell--full { background: #fca5a5; color: #7f1d1d; }
.wms-cell.is-front { outline: 2px solid var(--wms-accent); }

.wms-hotspot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
}
.wms-hotspot:last-child { border-bottom: 0; }
.wms-hotspot__loc { font-family: var(--wms-font-mono); font-size: 12px; font-weight: 600; width: 110px; }
.wms-hotspot__bar {
    flex: 1;
    height: 6px;
    background: var(--wms-surface-alt);
    border-radius: 3px;
    overflow: hidden;
}
.wms-hotspot__fill { height: 100%; border-radius: 3px; }
.wms-hotspot__fill--b3 { background: var(--wms-warn); }
.wms-hotspot__fill--b4 { background: var(--wms-accent); }
.wms-hotspot__fill--b5 { background: var(--wms-danger); }

.wms-alley-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: var(--wms-border-w) solid var(--wms-border);
}
.wms-alley-row:last-child { border-bottom: 0; }
.wms-alley-row__name { font-family: var(--wms-font-mono); font-size: 12px; font-weight: 600; width: 48px; }
.wms-alley-row__bar { flex: 1; height: 6px; background: var(--wms-surface-alt); border-radius: 3px; overflow: hidden; }
.wms-alley-row__fill { height: 100%; background: var(--wms-accent); border-radius: 3px; }
.wms-alley-row__pct { font-family: var(--wms-font-mono); font-size: 12px; color: var(--wms-text-muted); width: 40px; text-align: right; }

.wms-cell-info { padding: 0; }
.wms-cell-info__head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: var(--wms-border-w) solid var(--wms-border); }
.wms-cell-info__grid { padding: 14px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 13px; }
.wms-cell-info__grid > div { display: flex; justify-content: space-between; }
.wms-cell-info__actions { padding: 12px 18px; border-top: var(--wms-border-w) solid var(--wms-border); display: flex; justify-content: flex-end; }

/* =============================================================
   SCANNER VIEWFINDER
   ============================================================= */
.wms-scanner {
    max-width: 520px;
    margin: 0 auto;
}
.wms-scanner__viewfinder {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--wms-radius-lg);
    background: #1a1410;
    overflow: hidden;
    box-shadow: 0 10px 30px color-mix(in srgb, var(--wms-accent) 20%, transparent);
}
.wms-scanner__video {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
}
.wms-scanner__video video,
.wms-scanner__video canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    border-radius: var(--wms-radius-lg);
}
/* Hide html5-qrcode's own white scan-box — we draw our own guide */
#scanner-reader #qr-shaded-region,
#scanner-reader img[alt="Info icon"] { display: none !important; }
/* Zoom slider + torch button — give them a visible surface */
#scanner-reader__dashboard_section {
    background: rgba(0,0,0,0.4);
    padding: 8px 12px !important;
    backdrop-filter: blur(4px);
}
#scanner-reader__dashboard_section input[type="range"] {
    width: 100%;
    accent-color: var(--wms-accent);
}
#scanner-reader__dashboard_section span,
#scanner-reader__dashboard_section button,
#scanner-reader__dashboard_section div {
    color: #fff;
    font-family: var(--wms-font);
    font-size: 12px;
}

/* Our own guide frame — matches the adaptive qrbox (≈90% × 60% of viewfinder) */
.wms-scanner__frame {
    position: absolute;
    inset: 20% 5%;
    pointer-events: none;
}
.wms-scanner__corner {
    position: absolute;
    width: 28px; height: 28px;
    border: 3px solid var(--wms-accent);
    border-radius: 4px;
}
.wms-scanner__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.wms-scanner__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.wms-scanner__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.wms-scanner__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.wms-scanner__line {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 2px;
    background: var(--wms-accent);
    box-shadow: 0 0 12px var(--wms-accent);
    animation: wms-scan 2.4s ease-in-out infinite;
}
@keyframes wms-scan {
    0%, 100% { transform: translateY(-45%); }
    50%      { transform: translateY(45%); }
}
.wms-scanner__hint {
    position: absolute; bottom: 16px; left: 0; right: 0;
    text-align: center;
    font-family: var(--wms-font-mono);
    font-size: 11px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 0.08em;
    pointer-events: none;
}
.wms-scanner__manual {
    margin-top: 12px;
    display: flex;
    gap: 10px;
}
.wms-scanner__manual .wms-input { flex: 1; }

/* =============================================================
   HOME (mobile-first worker dashboard)
   ============================================================= */
.wms-home { max-width: 680px; margin: 0 auto; }
.wms-home__greeting { padding: 0 0 14px; }
.wms-home__hello { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 4px 0 0; }
.wms-home__primary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--wms-accent);
    color: var(--wms-accent-fg);
    border-radius: var(--wms-radius-lg);
    text-decoration: none;
    box-shadow: var(--wms-shadow-accent);
}
.wms-home__primary-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: grid; place-items: center;
    font-size: 24px;
    flex-shrink: 0;
}
.wms-home__primary-text { flex: 1; }
.wms-home__primary-title { font-size: 16px; font-weight: 600; }
.wms-home__primary-sub { font-size: 12px; opacity: 0.85; margin-top: 3px; }
.wms-home__primary i.bi-chevron-right { font-size: 18px; opacity: 0.8; }

.wms-task {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--wms-surface);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius);
    padding: 14px;
    margin-bottom: 10px;
}
.wms-task__icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--wms-accent-soft);
    color: var(--wms-accent);
    display: grid; place-items: center;
    font-size: 18px;
    flex-shrink: 0;
}
.wms-task__main { flex: 1; min-width: 0; }
.wms-task__label { font-size: 14px; font-weight: 600; }
.wms-task__sub { font-size: 11px; color: var(--wms-text-muted); margin-top: 2px; }
.wms-task__bar { height: 3px; background: var(--wms-surface-alt); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.wms-task__fill { height: 100%; background: var(--wms-accent); border-radius: 2px; }
.wms-task__count {
    font-family: var(--wms-font-mono);
    font-size: 14px;
    font-weight: 600;
    min-width: 44px;
    text-align: right;
}

.wms-search-kind {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: var(--wms-surface-alt);
    border-radius: var(--wms-radius-sm);
}
.wms-search-kind label {
    padding: 6px 12px;
    border-radius: var(--wms-radius-sm);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.wms-search-kind input { display: none; }
.wms-search-kind label:has(input:checked) {
    background: var(--wms-surface);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
    color: var(--wms-text);
}

/* =============================================================
   REPORTS
   ============================================================= */
.wms-report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.wms-report-cell {
    background: var(--wms-surface-alt);
    border-radius: var(--wms-radius);
    padding: 16px 18px;
    border: var(--wms-border-w) solid var(--wms-border);
}
.wms-report-cell__value {
    font-family: var(--wms-font-mono);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 8px;
}

/* =============================================================
   AUTH SHELL (login page — warm stone bg, brand header, footer)
   ============================================================= */
.wms-auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--wms-bg);
    color: var(--wms-text);
    font-family: var(--wms-font);
}
.wms-auth-shell__head {
    padding: 22px 32px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.wms-auth-shell__brand-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.wms-auth-shell__spacer { flex: 1; }
.wms-auth-shell__version {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wms-text-muted);
}
.wms-auth-shell__main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 32px 20px;
}
.wms-auth-shell__foot {
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    font-family: var(--wms-font-mono);
    font-size: 11px;
    color: var(--wms-text-dim);
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.wms-auth-shell__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.wms-auth-shell__status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wms-success);
}

/* Auth card */
.wms-auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--wms-surface);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-lg);
    padding: 36px 36px 32px;
    box-shadow: 0 1px 0 rgba(28,25,23,0.03), 0 10px 30px rgba(28,25,23,0.06);
    display: flex;
    flex-direction: column;
    gap: 22px;
}
[data-bs-theme="dark"] .wms-auth-card {
    box-shadow: 0 1px 0 rgba(255,255,255,0.02), 0 20px 60px rgba(0,0,0,0.4);
}
.wms-auth-form__kicker {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wms-accent);
    font-weight: 600;
    margin-bottom: -14px;
}
.wms-auth-form__title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0;
}
.wms-auth-form__sub {
    font-size: 14px;
    color: var(--wms-text-muted);
    line-height: 1.5;
    margin: -14px 0 0;
}

/* Lock banner */
.wms-auth-banner {
    background: var(--wms-danger-soft);
    border: 1px solid color-mix(in srgb, var(--wms-danger) 30%, transparent);
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.wms-auth-banner__icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--wms-danger);
    color: #fff;
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 14px;
}
.wms-auth-banner__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--wms-danger);
}
.wms-auth-banner__body {
    font-size: 12px;
    color: var(--wms-text);
    margin-top: 4px;
    line-height: 1.5;
}

/* Fields */
.wms-auth-field {
    display: block;
}
.wms-auth-field__label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--wms-text-muted);
    margin-bottom: 7px;
}
.wms-auth-field__control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--wms-surface);
    border: 1px solid var(--wms-border);
    border-radius: 10px;
    padding: 11px 14px;
    transition: border-color .15s, box-shadow .15s;
}
.wms-auth-field__control:focus-within {
    border-color: var(--wms-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-accent) 18%, transparent);
}
.wms-auth-field.is-error .wms-auth-field__control {
    border-color: var(--wms-danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-danger) 18%, transparent);
}
.wms-auth-field__icon {
    font-size: 16px;
    color: var(--wms-text-muted);
    line-height: 1;
}
.wms-auth-field__control input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 0;
    font-family: var(--wms-font);
    font-size: 14px;
    font-weight: 500;
    color: var(--wms-text);
    min-width: 0;
}
.wms-auth-field__control input:focus { outline: none; }
.wms-auth-field__control input::placeholder {
    color: var(--wms-text-dim);
    font-weight: 400;
}
.wms-auth-field__control input[type=password] { letter-spacing: 0.2em; }
.wms-auth-field__control input[type=password]::placeholder { letter-spacing: 0; }
.wms-auth-field__control input:disabled {
    cursor: not-allowed;
    color: var(--wms-text-muted);
}
.wms-auth-field__control:has(input:disabled) { background: var(--wms-surface-alt); }
.wms-auth-field__trail {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--wms-text-muted);
    background: var(--wms-surface-alt);
    padding: 3px 7px;
    border-radius: 4px;
    border: 0;
    cursor: pointer;
}
.wms-auth-field__trail:hover { color: var(--wms-text); }
.wms-auth-field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--wms-danger);
    margin-top: 7px;
}

/* Remember + forgot row */
.wms-auth-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wms-auth-check {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 13px;
}
.wms-auth-check input { position: absolute; opacity: 0; pointer-events: none; }
.wms-auth-check__mark {
    width: 18px; height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--wms-border-strong);
    background: var(--wms-surface);
    display: grid; place-items: center;
    flex-shrink: 0;
    position: relative;
    transition: background .15s, border-color .15s;
}
.wms-auth-check input:checked + .wms-auth-check__mark {
    background: var(--wms-accent);
    border-color: var(--wms-accent);
}
.wms-auth-check input:checked + .wms-auth-check__mark::after {
    content: "";
    width: 10px;
    height: 5px;
    border-left: 2.5px solid var(--wms-accent-fg);
    border-bottom: 2.5px solid var(--wms-accent-fg);
    transform: rotate(-45deg) translate(1px, -1px);
}
.wms-auth-forgot {
    font-size: 13px;
    color: var(--wms-accent);
    font-weight: 500;
    text-decoration: none;
}
.wms-auth-forgot:hover { text-decoration: underline; }
.wms-auth-forgot.is-disabled { opacity: 0.5; pointer-events: none; }

/* Submit */
.wms-auth-submit {
    background: var(--wms-accent);
    color: var(--wms-accent-fg);
    border: 1px solid var(--wms-accent);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.005em;
    font-family: var(--wms-font);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    transition: box-shadow .15s, background .15s;
}
.wms-auth-submit:hover:not(:disabled) { box-shadow: var(--wms-shadow-accent); }
.wms-auth-submit:disabled {
    background: var(--wms-surface-alt);
    color: var(--wms-text-dim);
    border-color: var(--wms-border);
    cursor: not-allowed;
}
.wms-auth-submit__idle,
.wms-auth-submit__loading {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.wms-auth-submit__loading { display: none; }
.wms-auth-submit.is-loading .wms-auth-submit__idle { display: none; }
.wms-auth-submit.is-loading .wms-auth-submit__loading { display: inline-flex; }
.wms-auth-spinner {
    width: 16px; height: 16px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--wms-accent-fg) 30%, transparent);
    border-top-color: var(--wms-accent-fg);
    animation: wms-spin .8s linear infinite;
}
@keyframes wms-spin { to { transform: rotate(360deg); } }

/* Mobile tweaks */
@media (max-width: 640px) {
    .wms-auth-shell__head,
    .wms-auth-shell__main,
    .wms-auth-shell__foot { padding-left: 18px; padding-right: 18px; }
    .wms-auth-shell__main { padding-top: 8px; padding-bottom: 16px; }
    .wms-auth-card {
        padding: 22px 20px 20px;
        border-radius: 14px;
        gap: 18px;
    }
    .wms-auth-form__title { font-size: 24px; }
    .wms-auth-form__sub { font-size: 13px; }
    .wms-auth-shell__foot {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
    }
}

/* =============================================================
   METRICS STRIP (reception dashboard)
   ============================================================= */
.wms-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 1023.98px) {
    .wms-metrics { grid-template-columns: 1fr 1fr; }
}
.wms-metric {
    background: var(--wms-surface);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-lg);
    padding: 18px 20px;
}
.wms-metric__label {
    font-size: 12px;
    color: var(--wms-text-muted);
    margin-bottom: 10px;
}
.wms-metric__value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--wms-font-mono);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.03em;
}
.wms-metric__total {
    font-size: 14px;
    font-weight: 500;
    color: var(--wms-text-dim);
}
.wms-metric__bar {
    height: 4px;
    background: var(--wms-surface-alt);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}
.wms-metric__fill {
    height: 100%;
    background: var(--wms-accent);
    border-radius: 2px;
}
.wms-metric__sub {
    font-size: 11px;
    color: var(--wms-text-muted);
    margin-top: 8px;
}

/* =============================================================
   ADDRESS BUILDER (cell location: A1 · K01 · G01 · U1)
   ============================================================= */
.wms-address { border: 0; padding: 0; margin: 0; }
.wms-address legend { padding: 0; }
.wms-address__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 640px) {
    .wms-address__row { grid-template-columns: 1fr 1fr; }
}
.wms-address__seg {
    background: var(--wms-surface-alt);
    border: var(--wms-border-w) solid var(--wms-border);
    border-radius: var(--wms-radius-sm);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 48px;
    transition: border-color .15s, box-shadow .15s;
}
.wms-address__seg:focus-within {
    border-color: var(--wms-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wms-accent) 15%, transparent);
}
.wms-address__tag {
    font-size: 10px;
    color: var(--wms-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.wms-address__prefix {
    font-family: var(--wms-font-mono);
    font-weight: 600;
    font-size: 14px;
    color: var(--wms-text);
    flex-shrink: 0;
}
.wms-address__seg input,
.wms-address__seg select {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 4px 0;
    font-family: var(--wms-font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--wms-text);
    text-align: right;
}
.wms-address__seg input:focus,
.wms-address__seg select:focus { outline: none; }
.wms-address__seg select {
    appearance: none;
    -webkit-appearance: none;
    text-align: left;
    cursor: pointer;
}
#location-preview { margin-top: 8px; }

/* Scanner failure state (camera blocked / unavailable) */
.wms-scanner__fail {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
    color: #fff;
    background: #1a1410;
    z-index: 5;
}
.wms-scanner__fail i { font-size: 28px; color: var(--wms-accent); margin-bottom: 4px; }
.wms-scanner__fail-title { font-size: 14px; font-weight: 600; }
.wms-scanner__fail-body { font-size: 12px; opacity: 0.85; font-family: var(--wms-font-mono); }
.wms-scanner__fail-hint { font-size: 11px; opacity: 0.65; margin-top: 6px; max-width: 260px; line-height: 1.4; }

/* Scanner zoom panel — overlaid on the viewfinder bottom */
.wms-scanner__zoom {
    position: absolute;
    left: 12px; right: 12px; bottom: 36px;
    z-index: 4;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.wms-scanner__zoom-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.wms-scanner__zoom-label {
    font-family: var(--wms-font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    min-width: 34px;
}
.wms-scanner__zoom-slider {
    flex: 1;
    accent-color: var(--wms-accent);
    height: 4px;
    cursor: pointer;
}
.wms-scanner__zoom-presets {
    display: flex;
    gap: 6px;
}
.wms-scanner__zoom-presets button {
    flex: 1;
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    padding: 6px 0;
    font-family: var(--wms-font-mono);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.wms-scanner__zoom-presets button:hover,
.wms-scanner__zoom-presets button:active {
    background: var(--wms-accent);
    border-color: var(--wms-accent);
}

/* Scanner resolution badge — top-right diagnostic pill */
.wms-scanner__res {
    position: absolute;
    top: 10px; right: 10px;
    z-index: 4;
    font-family: var(--wms-font-mono);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    pointer-events: none;
}

/* Scanner shutter button — forces full-resolution capture via ImageCapture.takePhoto() */
.wms-scanner__shutter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 60px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 5;
    display: grid;
    place-items: center;
    transition: transform .1s ease;
}
.wms-scanner__shutter-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    opacity: 0.85;
}
.wms-scanner__shutter-core {
    position: absolute; inset: 6px;
    border-radius: 50%;
    background: #fff;
    transition: background .15s;
}
.wms-scanner__shutter:hover .wms-scanner__shutter-core { background: var(--wms-accent); }
.wms-scanner__shutter:active { transform: translateX(-50%) scale(0.92); }
.wms-scanner__shutter.is-busy .wms-scanner__shutter-core {
    background: var(--wms-accent);
    animation: wms-shutter-pulse .6s ease-in-out infinite;
}
.wms-scanner__shutter.is-fail .wms-scanner__shutter-ring {
    border-color: var(--wms-danger);
    animation: wms-shake .4s;
}
@keyframes wms-shutter-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(0.7); opacity: 0.7; }
}
@keyframes wms-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-3px); }
    75%      { transform: translateX(3px); }
}

/* When zoom panel is present, lift the shutter above it */
.wms-scanner__viewfinder:has(.wms-scanner__zoom) .wms-scanner__shutter {
    bottom: 108px;
}

/* Autoplay-blocked overlay — big centered "tap to play" button */
.wms-scanner__tap-play {
    position: absolute; inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 0;
    cursor: pointer;
    font-family: var(--wms-font);
    font-size: 14px;
    font-weight: 500;
}
.wms-scanner__tap-play i { font-size: 48px; color: var(--wms-accent); }
.wms-scanner__tap-play:hover i { opacity: 0.85; }

/* Cycle-rear-camera button — top-left of the viewfinder */
.wms-scanner__camswitch {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 5;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    display: grid; place-items: center;
    cursor: pointer;
    transition: background .15s;
}
.wms-scanner__camswitch:hover { background: var(--wms-accent); }
.wms-scanner__camswitch i { font-size: 16px; }

/* Rear-camera switch counter + toast */
.wms-scanner__camswitch {
    width: 40px; height: 40px;
    flex-direction: column;
    gap: 0;
}
.wms-scanner__camswitch i { font-size: 14px; line-height: 1; }
.wms-scanner__camswitch-count {
    font-family: var(--wms-font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.9);
    line-height: 1;
    margin-top: 2px;
}
.wms-scanner__camtoast {
    position: absolute;
    top: 56px; left: 50%;
    transform: translate(-50%, -10px);
    z-index: 5;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-family: var(--wms-font-mono);
    font-size: 11px;
    letter-spacing: 0.03em;
    padding: 6px 12px;
    border-radius: 8px;
    max-width: 80%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}
.wms-scanner__camtoast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}
