/*
 * WMS responsive hardening
 * Reversible, screen-only production overlay. Keep this file loaded last.
 * It intentionally does not change application logic or printable documents.
 */

:root {
    --wms-touch-target: 44px;
    --wms-focus-color: #38bdf8;
    --wms-focus-halo: rgba(56, 189, 248, 0.18);
    --wms-cancelled-text: #ff8a86;
    --wms-cancelled-bg: rgba(255, 138, 134, 0.14);
}

.requisition-cancel-warning {
    margin: 12px 0 14px;
    padding: 11px 12px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-orange);
    font-weight: 700;
    line-height: 1.5;
}

.requisition-cancel-modal textarea {
    min-height: 112px;
    resize: vertical;
}

.requisition-preview__status--cancelled {
    color: var(--wms-cancelled-text);
    background: var(--wms-cancelled-bg);
    border-color: rgba(239, 111, 108, 0.32);
}

body.light-theme {
    --wms-focus-color: #075985;
    --wms-focus-halo: rgba(7, 89, 133, 0.20);
    --wms-cancelled-text: #9f1239;
    --wms-cancelled-bg: rgba(159, 18, 57, 0.10);
}

/* Generated panels still carry the legacy cancellation colour inline. React
   serializes it to rgb(), so target the cancellation icon semantics instead. */
#root #panel-outbound :is(div, span):has(> i.fa-ban),
#root #panel-requisitions-history .status-badge:has(> i.fa-ban) {
    color: var(--wms-cancelled-text) !important;
    background-color: var(--wms-cancelled-bg) !important;
}

/* Keep nested grid and flex content shrinkable without hiding overflow. */
#root .app-container,
#root .main-content,
#root .panel-container,
#root .page-panel,
#root .workspace-panel-slot,
#root :is(.card-glass, .dashboard-card, .workflow-scan-panel, .workflow-form-panel),
#root :is(.wms-form-grid-2, .wms-form-grid-3, .wms-form-grid-4) > * {
    min-width: 0;
}

/* ========================================================
   💎 ULTRA-VIBRANT PREMIUM BUTTON DESIGN SYSTEM (2026)
   ======================================================== */

/* 1. Primary Button (Vivid Electric Sky Blue) */
#root .btn-primary,
.central-login-screen .btn-primary,
body > .modal-overlay.modal-overlay--open .btn-primary,
.btn-primary {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.6) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.38) !important;
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
#root .btn-primary:hover:not(:disabled),
.central-login-screen .btn-primary:hover:not(:disabled),
body > .modal-overlay.modal-overlay--open .btn-primary:hover:not(:disabled),
.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%) !important;
    border-color: rgba(125, 211, 252, 0.8) !important;
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.55) !important;
    transform: translateY(-2px) !important;
    filter: brightness(1.08) !important;
}
#root .btn-primary:active:not(:disabled),
.btn-primary:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}

/* 2. Success Button & Stocktake Submit (Vivid Mint / Emerald Green) */
#root .btn-success,
.central-login-screen .btn-success,
body > .modal-overlay.modal-overlay--open .btn-success,
.btn-success,
.stocktake-submit {
    color: #ffffff !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1.5px solid rgba(52, 211, 153, 0.6) !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.38) !important;
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
#root .btn-success:hover:not(:disabled),
.central-login-screen .btn-success:hover:not(:disabled),
body > .modal-overlay.modal-overlay--open .btn-success:hover:not(:disabled),
.btn-success:hover:not(:disabled),
.stocktake-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399 0%, #047857 100%) !important;
    border-color: rgba(167, 243, 208, 0.8) !important;
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55) !important;
    transform: translateY(-2px) !important;
    filter: brightness(1.08) !important;
}
#root .btn-success:active:not(:disabled),
.btn-success:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3) !important;
}

/* 3. Danger / Delete Button (Vivid Rose / Crimson Red) */
#root .btn-danger,
body > .modal-overlay.modal-overlay--open .btn-danger,
.btn-danger,
.btn-delete-row {
    color: #ffffff !important;
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
    border: 1.5px solid rgba(251, 113, 133, 0.6) !important;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.38) !important;
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
#root .btn-danger:hover:not(:disabled),
body > .modal-overlay.modal-overlay--open .btn-danger:hover:not(:disabled),
.btn-danger:hover:not(:disabled),
.btn-delete-row:hover:not(:disabled) {
    background: linear-gradient(135deg, #fb7185 0%, #be123c 100%) !important;
    border-color: rgba(254, 205, 211, 0.8) !important;
    box-shadow: 0 6px 22px rgba(244, 63, 94, 0.55) !important;
    transform: translateY(-2px) !important;
    filter: brightness(1.08) !important;
}
#root .btn-danger:active:not(:disabled),
.btn-danger:active:not(:disabled) {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.3) !important;
}

/* 4. Warning Button (Radiant Sunset Amber / Orange) */
#root .btn-warning,
.btn-warning {
    color: #ffffff !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    border: 1.5px solid rgba(251, 191, 36, 0.6) !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.38) !important;
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
#root .btn-warning:hover:not(:disabled),
.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #fbbf24 0%, #b45309 100%) !important;
    border-color: rgba(254, 240, 138, 0.8) !important;
    box-shadow: 0 6px 22px rgba(245, 158, 11, 0.55) !important;
    transform: translateY(-2px) !important;
}

/* 5. Accent & Camera Trigger Button (Electric Purple / Cyber Violet) */
#root .btn-accent,
body > .modal-overlay.modal-overlay--open .btn-accent,
.btn-accent,
.btn-camera-trigger {
    color: #ffffff !important;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    border: 1.5px solid rgba(196, 181, 253, 0.6) !important;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.38) !important;
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}
#root .btn-accent:hover:not(:disabled),
body > .modal-overlay.modal-overlay--open .btn-accent:hover:not(:disabled),
.btn-accent:hover:not(:disabled),
.btn-camera-trigger:hover:not(:disabled) {
    background: linear-gradient(135deg, #a78bfa 0%, #4f46e5 100%) !important;
    border-color: rgba(233, 213, 255, 0.8) !important;
    box-shadow: 0 6px 22px rgba(139, 92, 246, 0.55) !important;
    transform: translateY(-2px) !important;
}

/* 6. Secondary & Action Filter Buttons (Crisp & High-Contrast in Light & Dark Mode) */
#root .btn-secondary,
.btn-secondary {
    font-weight: 700 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
body:not(.light-theme) #root .btn-secondary,
body:not(.light-theme) .btn-secondary {
    background: rgba(2, 132, 199, 0.12) !important;
    color: #38bdf8 !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
body:not(.light-theme) #root .btn-secondary:hover:not(:disabled),
body:not(.light-theme) .btn-secondary:hover:not(:disabled) {
    background: rgba(2, 132, 199, 0.24) !important;
    color: #7dd3fc !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35) !important;
    transform: translateY(-1.5px) !important;
}
body.light-theme #root .btn-secondary,
body.light-theme .btn-secondary {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1.5px solid #38bdf8 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.14) !important;
}
body.light-theme #root .btn-secondary:hover:not(:disabled),
body.light-theme .btn-secondary:hover:not(:disabled) {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #0284c7 !important;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.25) !important;
    transform: translateY(-1.5px) !important;
}

/* 7. Active State for Filter Pills and Selected Buttons */
.btn-secondary.active-btn,
.btn-secondary.active {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45) !important;
    font-weight: 800 !important;
}

/* 8. Table Action Buttons (Restock, Edit, Delete, Receipt, Barcode Print) */
.table .btn-secondary {
    border-radius: 8px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
}

/* 9. Ultra-Vibrant Department Preset Pill Buttons */
.dept-preset-btn {
    font-size: 11.5px !important;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
.dept-preset-btn:hover {
    transform: translateY(-2px) scale(1.03) !important;
    filter: brightness(1.12) !important;
}
.dept-preset-btn:active {
    transform: translateY(0) scale(0.97) !important;
}
.dept-preset-btn--central {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.38) !important;
}
.dept-preset-btn--bar {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%) !important;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.38) !important;
}
.dept-preset-btn--office {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.38) !important;
}
.dept-preset-btn--kitchen {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.38) !important;
}
.dept-preset-btn--maid {
    background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%) !important;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.38) !important;
}
.dept-preset-btn--engineering {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.38) !important;
}
.dept-preset-btn--rooms {
    background: linear-gradient(135deg, #f43f5e 0%, #be123c 100%) !important;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.38) !important;
}
.dept-preset-btn--activity {
    background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%) !important;
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.38) !important;
}
.dept-preset-btn--lounge {
    background: linear-gradient(135deg, #fb923c 0%, #c2410c 100%) !important;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.38) !important;
}
.dept-preset-btn--service {
    background: linear-gradient(135deg, #eab308 0%, #a16207 100%) !important;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.38) !important;
}
.dept-preset-btn--fixed_assets {
    background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%) !important;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.38) !important;
}

/* A real outline remains visible in both themes and at high zoom. */
#root :is(button, a[href], input, select, textarea, [role="button"]):focus-visible,
.central-login-screen :is(button, a[href], input, select, textarea, [role="button"]):focus-visible,
body > .modal-overlay.modal-overlay--open
:is(button, a[href], input, select, textarea, [role="button"]):focus-visible {
    outline: 3px solid var(--wms-focus-color) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px var(--wms-focus-halo) !important;
}

.central-login-screen .central-login-input:focus-within {
    outline: 0 !important;
    border-color: var(--color-blue) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-blue) 18%, transparent) !important;
}

#root .central-login-screen .central-login-form .central-login-input > input:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
}

#root input::placeholder,
#root textarea::placeholder,
.central-login-screen input::placeholder,
body > .modal-overlay.modal-overlay--open input::placeholder,
body > .modal-overlay.modal-overlay--open textarea::placeholder {
    color: var(--text-muted) !important;
    opacity: 1 !important;
}

/* Wide tables scroll locally; the page itself remains stable. */
#root .table-responsive {
    max-width: 100%;
    overflow-x: auto !important;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--text-muted) 58%, transparent) transparent;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

#root .table-responsive::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#root .table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted) 58%, transparent);
}

/* Dialog frames always fit the visual viewport; document/image canvases keep their own sizing. */
#root .modal-overlay.modal-overlay--open,
body > .modal-overlay.modal-overlay--open {
    padding:
        max(10px, env(safe-area-inset-top))
        max(10px, env(safe-area-inset-right))
        max(10px, env(safe-area-inset-bottom))
        max(10px, env(safe-area-inset-left)) !important;
}

#root .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document),
body > .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document) {
    display: flex !important;
    width: min(720px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    flex-direction: column !important;
    margin: 0 !important;
    overflow: hidden !important;
}

#root .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document) > .modal-body,
#root .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document) > form > .modal-body,
body > .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document) > .modal-body,
body > .modal-overlay.modal-overlay--open
> .modal-card:not(.modal-card--image):not(.modal-card--document) > form > .modal-body {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 1 auto;
    overflow: auto !important;
    overscroll-behavior: contain;
}

#root :is(
    .close-btn,
    .btn-close-sidebar,
    .system-notification__close,
    .notification-center-modal__close,
    .notification-center-modal__item-close
) ,
body > .modal-overlay.modal-overlay--open :is(
    .close-btn,
    .system-notification__close,
    .notification-center-modal__close,
    .notification-center-modal__item-close
) {
    min-width: var(--wms-touch-target) !important;
    min-height: var(--wms-touch-target) !important;
}

/* Touch screens and compact viewports. */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    body .notification-center__clear {
        min-height: var(--wms-touch-target) !important;
        touch-action: manipulation;
    }

    #root input:is([type="checkbox"], [type="radio"]),
    .central-login-screen input:is([type="checkbox"], [type="radio"]),
    body > .modal-overlay.modal-overlay--open
    input:is([type="checkbox"], [type="radio"]) {
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        flex: 0 0 24px;
    }

    #root label:has(input:is([type="checkbox"], [type="radio"])),
    .central-login-screen label:has(input:is([type="checkbox"], [type="radio"])),
    body > .modal-overlay.modal-overlay--open
    label:has(input:is([type="checkbox"], [type="radio"])),
    .central-login-screen #central-login-remember + label {
        min-height: var(--wms-touch-target) !important;
        align-items: center;
    }

    #root .main-content button {
        min-width: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        touch-action: manipulation;
    }

    body > .modal-overlay.modal-overlay--open button {
        min-width: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        touch-action: manipulation;
    }

    #root :is(
        .btn-primary,
        .btn-secondary,
        .btn-success,
        .btn-danger,
        .btn-accent,
        .nav-btn,
        .mobile-nav-btn
    ),
    .central-login-screen button {
        min-width: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        touch-action: manipulation;
    }

    #root input:not([type="checkbox"]):not([type="radio"]),
    #root select,
    #root textarea,
    .central-login-screen input:not([type="checkbox"]):not([type="radio"]),
    body > .modal-overlay.modal-overlay--open input:not([type="checkbox"]):not([type="radio"]),
    body > .modal-overlay.modal-overlay--open select,
    body > .modal-overlay.modal-overlay--open textarea {
        min-height: var(--wms-touch-target) !important;
        font-size: 16px !important;
    }

    #root :is(
        .btn-mobile-menu,
        .btn-close-sidebar,
        .header-account-action,
        .mobile-nav-btn,
        .qty-btn,
        .preset-btn,
        .stocktake-remove-button,
        .sidebar-control-button,
        .system-notification__close,
        .notification-center-modal__tab,
        .notification-center-modal__clear,
        .notification-center-modal__item-action
    ) {
        min-width: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
    }
}

/* Mobile and iPad: compact header, but keep real labels for assistive technology. */
@media (max-width: 1024px) {
    #root .sidebar:not(.sidebar-open):not(.active) {
        visibility: hidden !important;
        pointer-events: none !important;
    }

    #root .sidebar.sidebar-open,
    #root .sidebar.active {
        visibility: visible !important;
        pointer-events: auto !important;
    }

    #root .header-account-summary {
        display: none !important;
    }

    #root .header-account-action-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
        display: block !important;
    }

    #root .btn-mobile-menu,
    #root .top-header__account-actions .header-account-action {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 11px !important;
    }

    #root .top-header__account-actions .header-account-action {
        font-size: 0 !important;
    }

    #root .header-account-action > i {
        margin: 0 !important;
        font-size: 16px !important;
    }

    #root .header-account-action--logout::after {
        content: none !important;
    }

    /* Undo the old blanket icon rule for destructive or state-changing actions. */
    #root button.mobile-icon-button,
    #root button:has(> .btn-label-text),
    #root .btn-camera-trigger {
        width: auto !important;
        min-width: var(--wms-touch-target) !important;
        height: auto !important;
        min-height: var(--wms-touch-target) !important;
        flex: 0 1 auto !important;
        padding: 9px 12px !important;
        gap: 7px !important;
        font-size: 12px !important;
        white-space: normal !important;
    }

    #root button > .btn-label-text {
        position: static !important;
        display: inline !important;
        width: auto !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
        clip-path: none !important;
        white-space: normal !important;
    }

    /* Compact only safe, repeatable view/print/history/camera actions. */
    #root #panel-requisitions-history button.mobile-icon-button,
    #root .btn-camera-trigger,
    #root #panel-outbound button.mobile-icon-button:has(> i.fa-arrows-rotate),
    #root #panel-stocktake .stocktake-result-actions button.mobile-icon-button,
    #root #panel-products button:is(:has(> i.fa-print), :has(> i.fa-pen-to-square)) {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        flex: 0 0 var(--wms-touch-target) !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
        font-size: 0 !important;
        white-space: nowrap !important;
    }

    #root #panel-requisitions-history button.mobile-icon-button > i,
    #root .btn-camera-trigger > i,
    #root #panel-outbound button.mobile-icon-button:has(> i.fa-arrows-rotate) > i,
    #root #panel-stocktake .stocktake-result-actions button.mobile-icon-button > i,
    #root #panel-products button:is(:has(> i.fa-print), :has(> i.fa-pen-to-square)) > i {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1 !important;
    }

    #root #panel-products
    button:is(:has(> i.fa-print), :has(> i.fa-pen-to-square)) > .btn-label-text {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
        display: block !important;
    }

    #root .panel-header > div:last-child:has(> button) {
        display: grid !important;
        width: 100% !important;
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)) !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    #root .panel-header > div:last-child:has(> button) > button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: var(--wms-touch-target) !important;
    }

    #root :is(
        .swipe-pills-container,
        .category-filter-pills,
        .scroll-x-no-scrollbar,
        .operations-tabs
    ) {
        overflow-x: auto !important;
        overscroll-behavior-inline: contain;
        scrollbar-width: thin !important;
        scrollbar-color: color-mix(in srgb, var(--text-muted) 55%, transparent) transparent;
        -webkit-overflow-scrolling: touch;
    }

    #root :is(
        .swipe-pills-container,
        .category-filter-pills,
        .scroll-x-no-scrollbar,
        .operations-tabs
    )::-webkit-scrollbar {
        display: block !important;
        height: 4px;
    }

    #root :is(
        .swipe-pills-container,
        .category-filter-pills,
        .scroll-x-no-scrollbar,
        .operations-tabs
    )::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: color-mix(in srgb, var(--text-muted) 55%, transparent);
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #root .top-header__layout {
        grid-template-columns: minmax(0, 1fr) auto auto !important;
        align-items: center !important;
    }

    #root .top-header__brand {
        grid-column: 1 !important;
        grid-row: 1 !important;
        justify-self: start;
    }

    #root .top-header__status {
        grid-column: 2 !important;
        grid-row: 1 !important;
        justify-self: center;
    }

    #root .top-header__account-actions {
        grid-column: 3 !important;
        grid-row: 1 !important;
        justify-self: end;
    }

    #root .header-scanner-status {
        display: none !important;
    }

    #root .main-content {
        padding-inline:
            max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-left))
            max(clamp(16px, 2.5vw, 28px), env(safe-area-inset-right)) !important;
    }
}

/* Large iPad / touch-only landscape keeps the compact account header. */
@media (min-width: 1025px) and (hover: none) and (pointer: coarse) {
    #root .header-account-summary {
        display: none !important;
    }

    #root .header-account-action-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
        display: block !important;
    }

    #root .top-header__account-actions .header-account-action {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 11px !important;
        font-size: 0 !important;
    }

    #root .header-account-action > i {
        margin: 0 !important;
        font-size: 16px !important;
    }

    #root .header-account-action--logout::after {
        content: none !important;
    }
}

/* Phone and iPad queue rows use compact, accessible icon actions. Full labels
   remain visible inside detail and cancellation modals. */
@media (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
    #root .requisition-queue-table .requisition-queue-actions > button {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        flex: 0 0 var(--wms-touch-target) !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
        font-size: 0 !important;
        white-space: nowrap !important;
    }

    #root .requisition-queue-table
    .requisition-queue-actions > button > .btn-label-text {
        position: absolute !important;
        display: block !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    #root .requisition-queue-table .requisition-queue-actions > button > i {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1 !important;
    }
}

@media (max-width: 640px) {
    #root .top-header__layout {
        display: grid !important;
        grid-template-areas: "brand actions" !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
    }

    #root .top-header__brand,
    #root .header-search {
        min-width: 0 !important;
        overflow: hidden;
    }

    #root .top-header__brand {
        flex-shrink: 1 !important;
        overflow: visible;
    }

    #root .top-header__status {
        display: none !important;
    }

    #root .main-content {
        padding-left: max(10px, env(safe-area-inset-left)) !important;
        padding-right: max(10px, env(safe-area-inset-right)) !important;
        padding-bottom: calc(var(--mobile-nav-height) + 28px + env(safe-area-inset-bottom)) !important;
    }

    #root .panel-header > div:last-child:has(> button)
    > button:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Product creation tools are safe icon actions on phones; their text remains
       in the accessibility tree while all three controls share one compact row. */
    #root #panel-products > .panel-header > div:last-child:has(> button) {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    #root #panel-products > .panel-header > div:last-child:has(> button) > button {
        grid-column: auto !important;
        padding: 0 !important;
        font-size: 0 !important;
        justify-content: center !important;
    }

    #root #panel-products > .panel-header > div:last-child:has(> button) > button > i {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1 !important;
    }

    #root #panel-products > .panel-header + div {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    #root #panel-products > .panel-header + div > .card-glass {
        padding: 11px 10px !important;
    }

    #root :is(
        .requisition-queue-table,
        .stocktake-queue-table,
        .stocktake-report-table
    ) {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Queue actions are icon-only on phones and iPads to preserve row space.
       Full labels remain visible in the confirmation modal to prevent mistakes. */
    #root .requisition-queue-table .requisition-queue-actions > button {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        flex: 0 0 var(--wms-touch-target) !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
        font-size: 0 !important;
        white-space: nowrap !important;
    }

    #root .requisition-queue-table
    .requisition-queue-actions > button > .btn-label-text {
        position: absolute !important;
        display: block !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip-path: inset(50%) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    #root .requisition-queue-table .requisition-queue-actions > button > i {
        margin: 0 !important;
        font-size: 16px !important;
        line-height: 1 !important;
    }

    #root #panel-inbound .inbound-queue-item {
        grid-template-columns: 48px minmax(0, 1fr) 44px !important;
    }

    #root #panel-inbound .inbound-queue-item-remove {
        width: var(--wms-touch-target) !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        padding: 0 !important;
    }

    #root .modal-overlay.modal-overlay--open
    > .modal-card:not(.modal-card--image):not(.modal-card--document) .modal-footer,
    body > .modal-overlay.modal-overlay--open
    > .modal-card:not(.modal-card--image):not(.modal-card--document) .modal-footer {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
        gap: 8px !important;
    }

    #root .modal-overlay.modal-overlay--open
    > .modal-card:not(.modal-card--image):not(.modal-card--document) .modal-footer > button,
    body > .modal-overlay.modal-overlay--open
    > .modal-card:not(.modal-card--image):not(.modal-card--document) .modal-footer > button {
        width: 100% !important;
        min-width: 0 !important;
    }

    body > .modal-overlay.modal-overlay--open
    > .modal-card:not(.modal-card--image):not(.modal-card--document)
    .modal-body [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* Inventory history ------------------------------------------------------
   Eleven ledger columns cannot stay readable when squeezed into an iPad.
   Keep a useful column width and scroll only inside the table surface. */
#root #panel-requisitions-history .history-ledger-table-wrap {
    max-width: 100%;
    scrollbar-gutter: stable;
}

#root #panel-requisitions-history .history-ledger-table {
    width: 100% !important;
    min-width: 1320px !important;
    table-layout: fixed !important;
}

#root #panel-requisitions-history .history-ledger-table :is(th, td) {
    overflow-wrap: normal !important;
    word-break: normal !important;
}

#root #panel-requisitions-history .history-ledger-table th {
    white-space: nowrap !important;
}

#root #panel-requisitions-history .history-ledger-table :is(th, td):nth-child(3) {
    width: 190px !important;
    min-width: 190px !important;
    line-height: 1.45;
}

#root #panel-requisitions-history .history-ledger-table
td:is(:nth-child(2), :nth-child(7), :nth-child(8), :nth-child(9)) {
    overflow-wrap: anywhere !important;
}

#root #panel-requisitions-history .history-ledger-table-wrap:focus-visible {
    outline: 3px solid var(--wms-focus-color) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 5px var(--wms-focus-halo) !important;
}

/* The four history views become stable, equal icon controls on phones and
   iPads. Their full Thai names remain available through aria-label/title. */
@media (max-width: 1024px),
       (min-width: 1025px) and (max-width: 1366px) and (hover: none) and (pointer: coarse) {
    #root #panel-requisitions-history .history-view-header {
        display: grid !important;
        grid-template-columns: minmax(220px, 304px) minmax(0, 1fr);
        align-items: center !important;
        gap: 10px !important;
    }

    #root #panel-requisitions-history .history-view-switcher {
        display: grid !important;
        width: 100% !important;
        min-width: 0 !important;
        grid-template-columns: repeat(4, minmax(44px, 1fr));
        gap: 6px !important;
    }

    #root #panel-requisitions-history .history-view-switcher__button {
        width: 100% !important;
        min-width: var(--wms-touch-target) !important;
        height: var(--wms-touch-target) !important;
        min-height: var(--wms-touch-target) !important;
        padding: 0 !important;
        gap: 0 !important;
        justify-content: center !important;
        overflow: visible !important;
        font-size: 0 !important;
        line-height: 1 !important;
    }

    #root #panel-requisitions-history .history-view-switcher__button > i {
        margin: 0 !important;
        font-size: 17px !important;
        line-height: 1 !important;
    }

    #root #panel-requisitions-history .history-result-count {
        justify-self: end;
        text-align: right;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    #root #panel-requisitions-history .history-view-header {
        grid-template-columns: minmax(0, 1fr);
    }

    #root #panel-requisitions-history .history-result-count {
        width: 100%;
    }
}

/* Sign-in preference ------------------------------------------------------
   Give the remember-device choice its own calm, tappable surface. The input
   remains native form state; this layer only improves visual hierarchy. */
.central-login-form > div:has(> #central-login-remember) {
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center !important;
    gap: 11px !important;
    min-height: 54px;
    box-sizing: border-box;
    margin: 7px 0 12px !important;
    padding: 5px 12px !important;
    border: 1px solid color-mix(in srgb, var(--color-green) 34%, var(--border-color));
    border-radius: 12px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--color-green) 9%, transparent),
        color-mix(in srgb, var(--color-blue) 4%, transparent)
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.central-login-form > div:has(> #central-login-remember):hover {
    border-color: color-mix(in srgb, var(--color-green) 58%, var(--border-color));
    background-color: color-mix(in srgb, var(--color-green) 5%, transparent);
}

.central-login-form > div:has(> #central-login-remember:focus-visible) {
    border-color: var(--wms-focus-color);
    box-shadow: 0 0 0 3px var(--wms-focus-halo);
}

.central-login-screen #central-login-remember {
    position: relative;
    display: grid;
    width: 22px !important;
    min-width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    margin: 0;
    padding: 0;
    place-content: center;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid color-mix(in srgb, var(--text-muted) 72%, transparent);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-main) 72%, transparent);
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.central-login-screen #central-login-remember::after {
    content: "";
    width: 5px;
    height: 10px;
    margin-top: -2px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    opacity: 0;
    transform: rotate(45deg) scale(0.65);
    transition: opacity 120ms ease, transform 120ms ease;
}

.central-login-screen #central-login-remember:checked {
    border-color: #34d399;
    background: #059669;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.12);
}

.central-login-screen #central-login-remember:checked::after {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

.central-login-screen #central-login-remember + label {
    display: flex;
    min-width: 0;
    min-height: 44px !important;
    margin: 0 !important;
    align-items: center !important;
    color: var(--text-main) !important;
    font-size: 13px;
    font-weight: 650 !important;
    line-height: 1.45;
    text-wrap: pretty;
    cursor: pointer;
}

.central-login-form > div:has(> #central-login-remember:disabled) {
    opacity: 0.62;
}

.central-login-screen #central-login-remember:disabled,
.central-login-screen #central-login-remember:disabled + label {
    cursor: not-allowed;
}

@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
    .central-login-form > div:has(> #central-login-remember) {
        grid-template-columns: 24px minmax(0, 1fr);
        gap: 12px !important;
        min-height: 58px;
    }

    .central-login-screen #central-login-remember {
        width: 24px !important;
        min-width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
    }
}

@media (max-width: 420px) {
    .central-login-form > div:has(> #central-login-remember) {
        padding-inline: 10px !important;
    }

    .central-login-screen #central-login-remember + label {
        font-size: 12.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #root *,
    #root *::before,
    #root *::after,
    .central-login-screen *,
    .central-login-screen *::before,
    .central-login-screen *::after,
    body > .modal-overlay.modal-overlay--open *,
    body > .modal-overlay.modal-overlay--open *::before,
    body > .modal-overlay.modal-overlay--open *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (forced-colors: active) {
    #root :is(button, input, select, textarea, .card-glass, .table-responsive),
    .central-login-screen :is(button, input, select, textarea),
    body > .modal-overlay.modal-overlay--open :is(button, input, select, textarea, .modal-card) {
        border: 1px solid CanvasText !important;
        box-shadow: none !important;
        forced-color-adjust: auto;
    }

    #root :is(button, a[href], input, select, textarea, [role="button"]):focus-visible,
    .central-login-screen :is(button, a[href], input, select, textarea):focus-visible,
    body > .modal-overlay.modal-overlay--open
    :is(button, a[href], input, select, textarea, [role="button"]):focus-visible {
        outline: 3px solid Highlight !important;
        outline-offset: 2px !important;
    }
}

/* ==========================================================================
   ENFORCED UNIFIED SETTINGS PANEL STYLING (Dual-Theme Dark & Light Support)
   ========================================================================== */
#root #panel-database-settings .settings-unified-container {
    width: 100% !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* 1. Capsule Navigation Bar */
#root #panel-database-settings .settings-capsule-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 16px !important;
    padding: 8px !important;
    margin-bottom: 22px !important;
    box-sizing: border-box !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

body.light-theme #root #panel-database-settings .settings-capsule-nav {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06) !important;
}

#root #panel-database-settings .settings-capsule-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    white-space: nowrap !important;
    outline: none !important;
    user-select: none !important;
}

body.light-theme #root #panel-database-settings .settings-capsule-btn {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border: 1px solid #e2e8f0 !important;
}

#root #panel-database-settings .settings-capsule-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

body.light-theme #root #panel-database-settings .settings-capsule-btn:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

#root #panel-database-settings .settings-capsule-btn.active {
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.38) !important;
}

body.light-theme #root #panel-database-settings .settings-capsule-btn.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
}

/* 2. Main Section Card */
#root #panel-database-settings .settings-section-card {
    background: rgba(17, 24, 39, 0.90) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 18px !important;
    padding: 26px !important;
    box-sizing: border-box !important;
    text-align: left !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
    max-width: 100% !important;
    color: #f8fafc !important;
}

body.light-theme #root #panel-database-settings .settings-section-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06) !important;
}

/* 3. Section Header */
#root #panel-database-settings .settings-section-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 14px !important;
    margin-bottom: 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}

body.light-theme #root #panel-database-settings .settings-section-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

#root #panel-database-settings .settings-section-header h3 {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

body.light-theme #root #panel-database-settings .settings-section-header h3 {
    color: #0f172a !important;
}

#root #panel-database-settings .settings-section-header p {
    margin: 4px 0 0 0 !important;
    font-size: 12px !important;
    color: #94a3b8 !important;
}

body.light-theme #root #panel-database-settings .settings-section-header p {
    color: #64748b !important;
}

/* 4. Form Inputs & Textareas */
#root #panel-database-settings input.input-text,
#root #panel-database-settings .settings-input-flex,
#root #panel-database-settings .settings-input-dept,
#root #panel-database-settings .settings-input-emoji {
    background: rgba(15, 23, 42, 0.7) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    outline: none !important;
}

body.light-theme #root #panel-database-settings input.input-text,
body.light-theme #root #panel-database-settings .settings-input-flex,
body.light-theme #root #panel-database-settings .settings-input-dept,
body.light-theme #root #panel-database-settings .settings-input-emoji {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

#root #panel-database-settings input:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

/* 5. Toggles & Feature Rows */
#root #panel-database-settings .settings-toggle-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 18px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
    user-select: none !important;
    margin-bottom: 10px !important;
    box-sizing: border-box !important;
    color: #f8fafc !important;
}

body.light-theme #root #panel-database-settings .settings-toggle-row {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

#root #panel-database-settings .settings-toggle-row strong {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #f8fafc !important;
}

body.light-theme #root #panel-database-settings .settings-toggle-row strong {
    color: #0f172a !important;
}

#root #panel-database-settings .settings-toggle-row div.subtitle {
    font-size: 12px !important;
    color: #94a3b8 !important;
    margin-top: 2px !important;
}

body.light-theme #root #panel-database-settings .settings-toggle-row div.subtitle {
    color: #64748b !important;
}

#root #panel-database-settings .settings-toggle-row input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
    accent-color: #0284c7 !important;
}

/* 6. Item Rows (Products / Requisitions / Endpoints) */
#root #panel-database-settings .settings-item-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin-bottom: 8px !important;
}

body.light-theme #root #panel-database-settings .settings-item-row {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

/* 7. Product Type Live Preview Badges */
#root #panel-database-settings .settings-preview-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 16px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f1f5f9 !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12) !important;
    user-select: none !important;
}

body.light-theme #root #panel-database-settings .settings-preview-badge {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
}

#root #panel-database-settings .settings-preview-badge.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.38) !important;
}

body.light-theme #root #panel-database-settings .settings-preview-badge.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border: 1px solid #0284c7 !important;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3) !important;
}

/* 8. Emoji Picker Component */
#root #panel-database-settings .settings-emoji-btn {
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    border-radius: 10px !important;
    font-size: 22px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(15, 23, 42, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    user-select: none !important;
    position: relative !important;
}

body.light-theme #root #panel-database-settings .settings-emoji-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

#root #panel-database-settings .settings-emoji-btn:hover {
    border-color: #38bdf8 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
}

#root #panel-database-settings .settings-emoji-popover {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    z-index: 1050 !important;
    width: 330px !important;
    max-width: 90vw !important;
    max-height: 380px !important;
    overflow-y: auto !important;
    background: rgba(15, 23, 42, 0.96) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5) !important;
    padding: 14px !important;
    box-sizing: border-box !important;
}

body.light-theme #root #panel-database-settings .settings-emoji-popover {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16) !important;
}

#root #panel-database-settings .emoji-category-title {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    margin: 8px 0 4px 0 !important;
    text-align: left !important;
}

body.light-theme #root #panel-database-settings .emoji-category-title {
    color: #64748b !important;
}

#root #panel-database-settings .emoji-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 5px !important;
    margin-bottom: 8px !important;
}

#root #panel-database-settings .emoji-grid-item {
    font-size: 20px !important;
    height: 38px !important;
    border-radius: 8px !important;
    border: 1px solid transparent !important;
    background: rgba(255, 255, 255, 0.05) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
    user-select: none !important;
}

body.light-theme #root #panel-database-settings .emoji-grid-item {
    background: #f1f5f9 !important;
}

#root #panel-database-settings .emoji-grid-item:hover {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: #38bdf8 !important;
    transform: scale(1.15) !important;
}

/* =========================================================================
   COMPREHENSIVE 3-DEVICE RESPONSIVE SYSTEM: PC · IPAD · MOBILE
========================================================================= */

/* Base & Safe Areas */
#panel-operations {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

/* Operations Panel Header & Refresh Button */
.operations-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    margin-bottom: 16px !important;
}

.operations-header h2 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
    font-size: clamp(18px, 2.2vw, 24px) !important;
    font-weight: 800 !important;
}

/* Operations Navigation Tabs Bar */
.operations-tabs {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px !important;
    background: rgba(15, 23, 42, 0.45) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    margin-bottom: 20px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.operations-tabs::-webkit-scrollbar {
    display: none !important;
}

.operations-tabs button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 10px 16px !important;
    min-height: 42px !important;
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--text-muted, #94a3b8) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-shrink: 0 !important;
}

.operations-tabs button:hover {
    color: var(--text-main, #f8fafc) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.operations-tabs button.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.22) 0%, rgba(14, 165, 233, 0.12) 100%) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15) !important;
}

body.light-theme .operations-tabs {
    background: #e2e8f0 !important;
}

body.light-theme .operations-tabs button.active {
    background: #ffffff !important;
    color: #0284c7 !important;
    border-color: #bae6fd !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

/* =========================================================================
   DEVICE SPECIFIC: 1. MOBILE PHONE (<= 640px)
========================================================================= */
@media (max-width: 640px) {
    .operations-header {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .operations-header .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        min-height: 42px !important;
    }

    .operations-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        width: 100% !important;
    }

    .operations-user-card,
    .operations-report-card,
    .operations-backup-card,
    .operations-alert-card,
    .operations-progress-card,
    .operations-tip-card {
        padding: 16px !important;
        border-radius: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Tabs snap on swipe */
    .operations-tabs {
        padding: 4px !important;
        gap: 4px !important;
        scroll-snap-type: x mandatory !important;
    }

    .operations-tabs button {
        padding: 8px 12px !important;
        min-height: 38px !important;
        font-size: 12.5px !important;
        scroll-snap-align: center !important;
    }

    /* Reports Metrics Grid on Mobile */
    .operations-metrics {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .operations-metrics > div:last-child {
        grid-column: span 2 !important;
    }

    /* User Action Grid on Mobile - Balanced 3 Columns */
    .operations-user-list__actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .btn-user-action {
        height: 38px !important;
        min-height: 38px !important;
        font-size: 12px !important;
        padding: 0 4px !important;
        gap: 4px !important;
    }

    /* Checklist Step on Mobile */
    .operations-step {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .operations-step .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* =========================================================================
   DEVICE SPECIFIC: 2. TABLET & IPAD (641px - 1024px)
========================================================================= */
@media (min-width: 641px) and (max-width: 1024px) {
    .operations-layout {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
        width: 100% !important;
    }

    .operations-wide-card,
    .operations-password-reset-card {
        grid-column: span 2 !important;
    }

    .operations-tabs button {
        padding: 9px 14px !important;
        font-size: 13px !important;
    }

    .operations-metrics {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px !important;
    }

    .operations-user-list__item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .operations-user-list__actions {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
    }
}

/* =========================================================================
   DEVICE SPECIFIC: 3. PC & DESKTOP (>= 1025px)
========================================================================= */
@media (min-width: 1025px) {
    .operations-layout {
        display: grid !important;
        grid-template-columns: minmax(360px, 420px) minmax(0, 1fr) !important;
        gap: 20px !important;
        align-items: start !important;
        width: 100% !important;
    }

    .operations-wide-card {
        grid-column: span 2 !important;
    }

    /* Reports tab desktop layout: 3-column dashboard grid */
    #panel-operations .operations-layout:has(.operations-metrics) {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 20px !important;
        align-items: stretch !important;
        width: 100% !important;
    }

    /* 1. Top KPI Summary Card: Spans full width across all 3 columns */
    #panel-operations .operations-layout:has(.operations-metrics) > .operations-report-card:first-child {
        grid-column: 1 / -1 !important;
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.85) 100%) !important;
        border: 1px solid rgba(56, 189, 248, 0.25) !important;
        border-radius: 16px !important;
        padding: 22px 24px !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
    }

    body.light-theme #panel-operations .operations-layout:has(.operations-metrics) > .operations-report-card:first-child {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.95) 100%) !important;
        border: 1px solid rgba(186, 230, 253, 0.9) !important;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
    }

    /* 2. 5 KPI Stat Metrics */
    .operations-metrics {
        display: grid !important;
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
        gap: 14px !important;
        margin-bottom: 16px !important;
    }

    .operations-metrics > div {
        padding: 16px 14px !important;
        border-radius: 12px !important;
        background: var(--bg-card, rgba(255, 255, 255, 0.04)) !important;
        border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
        text-align: center !important;
        transition: all 0.2s ease !important;
        position: relative !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .operations-metrics > div:hover {
        transform: translateY(-2px) !important;
        border-color: var(--color-blue, #38bdf8) !important;
        box-shadow: 0 6px 18px rgba(56, 189, 248, 0.15) !important;
    }

    .operations-metrics span {
        font-size: 12px !important;
        font-weight: 700 !important;
        color: var(--text-muted, #94a3b8) !important;
        letter-spacing: 0.02em !important;
    }

    .operations-metrics strong {
        font-size: 26px !important;
        font-weight: 900 !important;
        color: var(--text-primary, #ffffff) !important;
        margin-top: 6px !important;
        font-family: var(--font-number, monospace) !important;
    }

    /* Colored accents per metric */
    .operations-metrics > div:nth-child(1) strong { color: #38bdf8 !important; }
    .operations-metrics > div:nth-child(2) strong { color: #f59e0b !important; }
    .operations-metrics > div:nth-child(3) strong { color: #a855f7 !important; }
    .operations-metrics > div:nth-child(4) strong { color: #10b981 !important; }
    .operations-metrics > div:nth-child(5) strong { color: #06b6d4 !important; }

    /* 3. Report Action Buttons */
    .operations-report-actions {
        display: flex !important;
        justify-content: flex-end !important;
        gap: 12px !important;
        padding-top: 14px !important;
        border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    }

    .operations-report-actions .btn-secondary,
    .operations-report-actions .btn-success {
        padding: 9px 20px !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        border-radius: 9px !important;
        min-height: 40px !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 8px !important;
        cursor: pointer !important;
    }

    /* 4. Report Cards below Top KPI */
    .operations-layout:has(.operations-metrics) > .operations-report-card {
        border-radius: 16px !important;
        padding: 20px !important;
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .operations-layout:has(.operations-metrics) > .operations-report-card h3 {
        font-size: 15px !important;
        font-weight: 800 !important;
        margin: 0 0 14px 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        color: var(--text-main) !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 10px !important;
    }

    /* 5. Top Outbound Ranking Polish */
    .operations-ranking {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        max-height: 460px !important;
        overflow-y: auto !important;
        padding-right: 4px !important;
    }

    .operations-ranking > div {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid var(--border-color) !important;
        transition: all 0.15s ease-in-out !important;
    }

    .operations-ranking > div:hover {
        background: rgba(56, 189, 248, 0.06) !important;
        border-color: rgba(56, 189, 248, 0.3) !important;
    }

    .operations-ranking > div > span {
        width: 26px !important;
        height: 26px !important;
        flex: 0 0 26px !important;
        font-size: 11.5px !important;
        font-weight: 900 !important;
        border-radius: 8px !important;
    }

    .operations-ranking > div:nth-child(1) > span {
        background: linear-gradient(135deg, #fbbf24, #d97706) !important;
        color: #ffffff !important;
        box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35) !important;
    }
    .operations-ranking > div:nth-child(2) > span {
        background: linear-gradient(135deg, #94a3b8, #64748b) !important;
        color: #ffffff !important;
    }
    .operations-ranking > div:nth-child(3) > span {
        background: linear-gradient(135deg, #b45309, #78350f) !important;
        color: #ffffff !important;
    }

    .operations-ranking strong {
        font-size: 12.5px !important;
        font-weight: 700 !important;
        color: var(--text-main) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex: 1 1 auto !important;
    }

    .operations-ranking em {
        margin-left: auto !important;
        font-size: 12px !important;
        font-weight: 800 !important;
        color: var(--color-blue, #38bdf8) !important;
        background: rgba(56, 189, 248, 0.1) !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        flex-shrink: 0 !important;
    }

    /* 6. Location & Lot Reports Polish */
    .operations-location-report {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        max-height: 460px !important;
        overflow-y: auto !important;
        padding-right: 4px !important;
    }

    .operations-location-report > div {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 10px 12px !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border: 1px solid var(--border-color) !important;
        transition: all 0.15s ease !important;
    }

    .operations-location-report > div:hover {
        background: rgba(255, 255, 255, 0.06) !important;
        border-color: rgba(56, 189, 248, 0.3) !important;
    }

    .operations-location-report strong {
        font-size: 12.5px !important;
        font-weight: 800 !important;
        color: var(--text-main) !important;
    }

    .operations-location-report span {
        font-size: 11px !important;
        color: var(--text-muted) !important;
    }

    .operations-location-report em {
        font-size: 12px !important;
        font-weight: 800 !important;
        padding: 3px 8px !important;
        border-radius: 6px !important;
        background: rgba(16, 185, 129, 0.1) !important;
        color: #10b981 !important;
        flex-shrink: 0 !important;
    }

    .operations-user-list__item {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 16px !important;
        padding: 14px 18px !important;
    }

    .operations-user-list__identity {
        flex: 1 1 auto !important;
    }

    .operations-user-list__actions {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        width: auto !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
        flex-shrink: 0 !important;
    }

    .btn-user-action {
        width: auto !important;
        min-width: 90px !important;
        height: 36px !important;
        padding: 0 12px !important;
    }
    
    .operations-user-list__item:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18) !important;
    }
}

/* =========================================================================
   INBOUND RECEIVING PANEL (รับสินค้าเข้าคลัง) - 3-DEVICE RESPONSIVE SYSTEM
========================================================================= */

#panel-inbound {
    width: 100% !important;
    max-width: 1440px !important;
    margin: 0 auto !important;
}

.inbound-grid-container {
    display: grid !important;
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr) !important;
    gap: 20px !important;
    margin-top: 16px !important;
    align-items: start !important;
}

/* Scanner Card Styling */
.workflow-scan-panel {
    background: var(--bg-card, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 18px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

.scanner-panel-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

.scanner-panel-header h3 {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: var(--text-main, #f8fafc) !important;
}

.scanner-actions-group {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.scanner-actions-group .btn-secondary,
.scanner-actions-group .btn-accent {
    height: 38px !important;
    min-height: 38px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    transition: all 0.15s ease-in-out !important;
}

.scanner-actions-group .btn-accent {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

.scanner-actions-group .btn-accent:hover {
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45) !important;
    transform: translateY(-1px) !important;
}

/* Input Scanner Bar */
.input-scanner-wrapper {
    display: flex !important;
    gap: 8px !important;
}

.input-scanner-wrapper input.input-barcode {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
    padding: 0 14px !important;
    background: var(--bg-main, #0f172a) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main, #ffffff) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.input-scanner-wrapper input.input-barcode:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

.input-scanner-wrapper button.btn-primary {
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 16px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

/* Inbound Queue Card & Items */
.inbound-queue-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px !important;
    padding: 18px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

.inbound-queue-header h3 {
    font-size: 15.5px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 0 !important;
}

.inbound-queue-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    transition: all 0.15s ease-in-out !important;
}

.inbound-queue-item:hover {
    border-color: rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

.inbound-queue-item-media {
    width: 46px !important;
    height: 46px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    background: rgba(0, 0, 0, 0.25) !important;
    border: 1px solid var(--border-color) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.inbound-queue-item-name {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--text-main, #f8fafc) !important;
    margin: 2px 0 !important;
    line-height: 1.3 !important;
}

.inbound-queue-item-meta {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: var(--text-muted, #94a3b8) !important;
}

.inbound-queue-item-meta code {
    font-family: monospace !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
}

.inbound-queue-item-controls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

.inbound-queue-item-controls button.btn-secondary {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.inbound-queue-quantity-input {
    width: 52px !important;
    height: 34px !important;
    min-height: 34px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    padding: 0 4px !important;
    border-radius: 8px !important;
}

.inbound-queue-item-remove {
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
    color: #f87171 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    font-size: 16px !important;
}

.inbound-queue-item-remove:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ffffff !important;
}

/* Inbound Submit Button */
.inbound-queue-submit {
    width: 100% !important;
    height: 48px !important;
    min-height: 48px !important;
    border-radius: 12px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(5, 150, 105, 0.35) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.inbound-queue-submit:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.5) !important;
}

/* =========================================================================
   DEVICE SPECIFIC ADAPTATIONS FOR INBOUND (PC / IPAD / MOBILE)
========================================================================= */

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
    .inbound-grid-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .scanner-panel-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .scanner-actions-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .scanner-actions-group .btn-secondary,
    .scanner-actions-group .btn-accent {
        width: 100% !important;
        padding: 0 6px !important;
        font-size: 11.5px !important;
    }

    .inbound-queue-item {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }

    .inbound-queue-item-info {
        flex: 1 1 calc(100% - 60px) !important;
    }

    .inbound-queue-item-controls {
        margin-left: auto !important;
    }
}

/* Tablets & iPad (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .inbound-grid-container {
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }

    .inbound-queue-item-controls button.btn-secondary {
        width: 38px !important;
        height: 38px !important;
    }
    
    .inbound-queue-quantity-input {
        width: 58px !important;
        height: 38px !important;
    }
}

/* PC & Desktop (>= 1025px) */
@media (min-width: 1025px) {
    .inbound-queue-card {
        position: sticky !important;
        top: 20px !important;
    }
}

/* =========================================================================
   REQUISITION FAVORITE SETS & TEMPLATES (ชุดสินค้าเบิกประจำ & สต๊อกเรียลไทม์)
========================================================================= */

.requisition-template-card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    transition: all 0.2s ease-in-out !important;
}

.template-pills-container {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
}

.template-pills-container::-webkit-scrollbar {
    display: none !important;
}

.template-pill-item {
    display: inline-flex !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.template-pill-item:hover {
    background: rgba(56, 189, 248, 0.12) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

body.light-theme .template-pill-item {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .template-pill-item:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
}

.btn-tpl-apply {
    background: none !important;
    border: none !important;
    padding: 6px 10px 6px 12px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--text-main, #f8fafc) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

body.light-theme .btn-tpl-apply {
    color: #0f172a !important;
}

.tpl-count {
    font-size: 10.5px !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
    padding: 1px 6px !important;
    border-radius: 10px !important;
}

.btn-tpl-delete {
    background: none !important;
    border: none !important;
    border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    color: var(--text-muted, #94a3b8) !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}

body.light-theme .btn-tpl-delete {
    border-left-color: #e2e8f0 !important;
}

.btn-tpl-delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

body.light-theme .requisition-template-card {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* =========================================================================
   REQUISITION BASKET & UI REDESIGN (ตะกร้าและรายการขอเบิกปรับโฉมใหม่)
========================================================================= */

.requisition-basket-item {
    padding: 12px 14px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    text-align: left !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.requisition-basket-item:hover {
    border-color: rgba(56, 189, 248, 0.35) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    transform: translateY(-1px) !important;
}

.requisition-basket-item-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 10px !important;
}

.requisition-basket-item-info {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.requisition-basket-item-name {
    font-weight: 700 !important;
    font-size: 14px !important;
    color: var(--text-main, #f8fafc) !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
}

.requisition-basket-item-meta {
    font-size: 11.5px !important;
    color: var(--text-muted, #94a3b8) !important;
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

.requisition-basket-item-meta .meta-bc {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.requisition-basket-item-meta .meta-bc code {
    font-family: monospace !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
}

.requisition-basket-item-meta .meta-stock-pill {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(16, 185, 129, 0.25) !important;
    padding: 1px 8px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 11px !important;
}

.btn-basket-remove {
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #f87171 !important;
    cursor: pointer !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 10px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.btn-basket-remove:hover {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    transform: scale(1.03) !important;
}

/* Stepper & Unit Row */
.requisition-basket-item-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    background: rgba(0, 0, 0, 0.22) !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.basket-stepper-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.basket-stepper-group .btn-stepper {
    width: 34px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main, #ffffff) !important;
    transition: all 0.15s ease !important;
}

.basket-stepper-group .btn-stepper:hover {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

.basket-stepper-group .input-stepper {
    width: 58px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 4px !important;
    text-align: center !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-color) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #38bdf8 !important;
    background: rgba(15, 23, 42, 0.7) !important;
}

.basket-unit-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    white-space: nowrap !important;
}

body.light-theme .requisition-basket-item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .requisition-basket-item-controls {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .basket-stepper-group .input-stepper {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

body.light-theme .basket-stepper-group .btn-stepper {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

/* =========================================================================
   3-DEVICE RESPONSIVE BREAKPOINTS FOR REQUISITIONS (PC / IPAD / MOBILE)
========================================================================= */

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
    .product-catalog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .requisition-basket-item {
        padding: 10px 12px !important;
        gap: 8px !important;
    }

    .requisition-basket-item-name {
        font-size: 13px !important;
    }

    .requisition-basket-item-controls {
        padding: 4px 8px !important;
    }

    .basket-stepper-group .btn-stepper {
        width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
    }

    .basket-stepper-group .input-stepper {
        width: 50px !important;
        height: 32px !important;
        min-height: 32px !important;
        font-size: 14px !important;
    }

    .basket-unit-badge {
        font-size: 11px !important;
        padding: 3px 8px !important;
    }
}

/* Tablets & iPad (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .product-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 12px !important;
    }

    .basket-stepper-group .btn-stepper {
        width: 36px !important;
        height: 36px !important;
    }

    .basket-stepper-group .input-stepper {
        width: 56px !important;
        height: 36px !important;
    }
}

/* PC & Desktop (>= 1025px) */
@media (min-width: 1025px) {
    .product-catalog-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 14px !important;
    }
}

/* =========================================================================
   REQUISITION 2-STEP WIZARD & COMPACT TABLE ROWS (PC, IPAD & MOBILE)
========================================================================= */

/* 1. Wizard Stepper Breadcrumbs */
.requisition-wizard-stepper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
    background: var(--bg-card, rgba(15, 23, 42, 0.65)) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    padding: 10px 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .requisition-wizard-stepper {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
}

.wizard-step-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 14px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none !important;
    flex: 1 1 auto !important;
}

.wizard-step-pill .step-number {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 800 !important;
    font-size: 14px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-muted, #94a3b8) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.2s ease !important;
}

.wizard-step-pill .step-label-group {
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
    text-align: left !important;
}

.wizard-step-pill .step-title {
    font-size: 13.5px !important;
    font-weight: 700 !important;
    color: var(--text-muted, #94a3b8) !important;
    white-space: nowrap !important;
}

.wizard-step-pill .step-sub {
    font-size: 11px !important;
    color: var(--text-muted, #64748b) !important;
    white-space: nowrap !important;
}

/* Active Step */
.wizard-step-pill.step-active {
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.wizard-step-pill.step-active .step-number {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    color: #ffffff !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

.wizard-step-pill.step-active .step-title {
    color: #38bdf8 !important;
    font-weight: 800 !important;
}

.wizard-step-pill.step-active .step-sub {
    color: #bae6fd !important;
}

body.light-theme .wizard-step-pill.step-active .step-sub {
    color: #0369a1 !important;
}

/* Done Step */
.wizard-step-pill.step-done .step-number {
    background: rgba(16, 185, 129, 0.18) !important;
    color: #10b981 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.wizard-step-pill.step-done .step-title {
    color: var(--text-main, #f8fafc) !important;
}

body.light-theme .wizard-step-pill.step-done .step-title {
    color: #0f172a !important;
}

/* Available / Disabled Step */
.wizard-step-pill.step-available:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.wizard-step-pill.step-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.wizard-step-divider {
    width: 28px !important;
    height: 2px !important;
    background: var(--border-color) !important;
    flex-shrink: 0 !important;
}

/* 2. Step 1 Grid Layout (Catalog left, Sticky compact cart right) */
.requisition-wizard-step1-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 360px !important;
    gap: 20px !important;
    align-items: start !important;
}

.catalog-workspace-column {
    min-width: 0 !important;
    width: 100% !important;
}

.basket-sidebar-column {
    width: 100% !important;
}

.basket-sidebar-card {
    display: flex !important;
    flex-direction: column !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    padding: 16px !important;
    min-height: 480px !important;
    background: var(--bg-card, rgba(15, 23, 42, 0.75)) !important;
}

.basket-sidebar-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.btn-clear-cart {
    font-size: 11.5px !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    background: rgba(239, 68, 68, 0.06) !important;
    cursor: pointer !important;
}

/* 3. Compact Cart Table Rows (Ultra Space-Efficient) */
.compact-cart-table-container {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    margin: 12px 0 !important;
    max-height: calc(100vh - 320px) !important;
}

.compact-cart-empty-state {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 48px 16px !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

.compact-cart-empty-state i {
    font-size: 40px !important;
    margin-bottom: 12px !important;
    color: var(--border-color) !important;
    opacity: 0.6 !important;
}

.compact-cart-empty-state p {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

.compact-cart-empty-state span {
    font-size: 12px !important;
    margin-top: 4px !important;
    opacity: 0.8 !important;
}

.compact-cart-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* 3. Compact Cart Card (2-Row Structured Layout) */
.compact-cart-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.025) !important;
    border: 1px solid var(--border-color) !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.compact-cart-row:hover {
    background: rgba(255, 255, 255, 0.045) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
}

body.light-theme .compact-cart-row {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .compact-cart-row:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

/* Row 1: Product Name & Delete Button */
.compact-cart-row-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
}

.compact-cart-prod-info {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    text-align: left !important;
}

.compact-prod-name {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--text-main, #f8fafc) !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
}

body.light-theme .compact-prod-name {
    color: #0f172a !important;
}

.compact-prod-meta {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    font-size: 11px !important;
    color: var(--text-muted, #94a3b8) !important;
    margin-top: 3px !important;
}

.compact-bc {
    font-family: monospace !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
    font-size: 10.5px !important;
}

.compact-stock-badge {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 10.5px !important;
}

.btn-remove-sm {
    width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #f87171 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.btn-remove-sm:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
}

/* Row 2: Controls Row (Stepper & Unit Badge) */
.compact-cart-controls-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    background: rgba(0, 0, 0, 0.22) !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-sizing: border-box !important;
}

body.light-theme .compact-cart-controls-row {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

.compact-stepper {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.btn-step-sm {
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border: 1px solid var(--border-color) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-main, #ffffff) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
}

body.light-theme .btn-step-sm {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

.btn-step-sm:hover {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

.input-step-sm {
    width: 48px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    text-align: center !important;
    border-radius: 6px !important;
    border: 1px solid var(--border-color) !important;
    background: rgba(15, 23, 42, 0.7) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #38bdf8 !important;
}

body.light-theme .input-step-sm {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0284c7 !important;
}

.compact-unit-pill {
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    white-space: nowrap !important;
}

body.light-theme .compact-unit-pill {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}

/* Proceed to Step 2 Button */
.btn-wizard-next {
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 10px !important;
    border: none !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    margin-top: 10px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3) !important;
    transition: all 0.2s ease !important;
}

.btn-wizard-next:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.45) !important;
}

.btn-wizard-next:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

/* 4. Wizard Step 2: Review & Requester Form */
.requisition-wizard-step2-container {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    animation: fadeIn 0.25s ease-in-out !important;
}

.step2-two-column-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr) !important;
    gap: 20px !important;
    align-items: start !important;
}

.step2-review-card,
.step2-form-card {
    border: 1px solid var(--border-color) !important;
    border-radius: 16px !important;
    padding: 20px !important;
    background: var(--bg-card, rgba(15, 23, 42, 0.75)) !important;
    text-align: left !important;
}

.step2-card-header {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding-bottom: 12px !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: var(--text-main, #f8fafc) !important;
}

body.light-theme .step2-card-header {
    color: #0f172a !important;
}

.btn-submit-requisition {
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 10px !important;
    font-size: 14.5px !important;
    font-weight: 800 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 10px !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.35) !important;
    cursor: pointer !important;
}

.input-locked {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #e2e8f0 !important;
    cursor: not-allowed !important;
    user-select: none !important;
    box-shadow: none !important;
}

body.light-theme .input-locked {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

/* 5. 3-Device Breakpoints (PC / iPad / Mobile) */

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
    /* Prevent any horizontal page overflow */
    html, body, #root, .app-layout, .main-content, .page-panel, #panel-outbound, .panel-container {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    #panel-outbound, .panel-container {
        padding: 10px 8px 110px 8px !important; /* extra bottom padding for bottom navigation bar */
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Top Header & Tabs */
    .panel-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        margin-bottom: 12px !important;
    }

    .outbound-main-tabs {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        width: 100% !important;
    }

    .outbound-main-tabs .btn-secondary {
        padding: 8px 4px !important;
        font-size: 11.5px !important;
        text-align: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
        border-radius: 8px !important;
    }

    /* Wizard Step Stepper on Mobile */
    .requisition-wizard-stepper {
        padding: 6px 8px !important;
        gap: 4px !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        justify-content: space-between !important;
    }

    .wizard-step-pill {
        padding: 4px 6px !important;
        gap: 6px !important;
        flex: 1 1 0 !important;
        min-width: 0 !important;
        border-radius: 8px !important;
    }

    .wizard-step-pill .step-number {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        font-size: 11px !important;
        font-weight: 800 !important;
    }

    .wizard-step-pill .step-label-group {
        min-width: 0 !important;
        flex: 1 1 auto !important;
    }

    .wizard-step-pill .step-title {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .wizard-step-pill .step-sub {
        display: none !important; /* Hide subtext on small screens to prevent overflow */
    }

    .wizard-step-divider {
        width: 8px !important;
        margin: 0 !important;
    }

    /* Scanner Card & Favorite Template Bar */
    .card-glass {
        padding: 10px 12px !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }

    .template-pills-container {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        padding-bottom: 4px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .template-pill-item {
        flex-shrink: 0 !important;
    }

    /* 2-Column Product Catalog Grid (Zero Overflow, 100% Screen Fitted) */
    .requisition-wizard-step1-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .catalog-workspace-column {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .product-catalog-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .product-card-interactive {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px !important;
        border-radius: 10px !important;
        overflow: hidden !important;
    }

    .product-card-interactive > div:first-of-type {
        height: 75px !important; /* Compact product image placeholder */
        border-radius: 6px !important;
    }

    .product-card-interactive h4 {
        font-size: 11.5px !important;
        line-height: 1.25 !important;
        margin-top: 6px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .product-card-interactive div[style*="justify-content: space-between"] {
        margin-top: 4px !important;
        font-size: 10px !important;
    }

    /* Basket Section on Mobile */
    .basket-sidebar-column {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .basket-sidebar-card {
        min-height: auto !important;
        padding: 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Floating Quick Action Bar on Mobile */
    .mobile-floating-basket-bar {
        display: block !important;
        position: fixed !important;
        bottom: 65px !important;
        left: 10px !important;
        right: 10px !important;
        z-index: 1050 !important;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45) !important;
        animation: slideUp 0.25s ease-out !important;
    }

    .btn-floating-next {
        width: 100% !important;
        min-height: 46px !important;
        padding: 8px 16px !important;
        border-radius: 12px !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
        color: #ffffff !important;
        cursor: pointer !important;
        box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
    }

    .floating-cart-badge {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        background: rgba(0, 0, 0, 0.25) !important;
        padding: 4px 10px !important;
        border-radius: 20px !important;
        font-size: 12px !important;
    }

    .floating-action-text {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }

    /* Step 2 Review & Form on Mobile */
    .requisition-wizard-step2-container {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .step2-two-column-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .step2-review-card,
    .step2-form-card {
        padding: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Tablets & iPad (641px - 1024px) */
@media (min-width: 641px) and (max-width: 1024px) {
    .requisition-wizard-step1-grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr) !important;
        gap: 16px !important;
    }

    .step2-two-column-layout {
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
    }
}

/* PC & Desktop (>= 1025px) */
@media (min-width: 1025px) {
    .basket-sidebar-card {
        position: sticky !important;
        top: 20px !important;
    }
}

/* Stocktake Pro Mobile Hardening */
@media (max-width: 768px) {
    #panel-stocktake .stocktake-form input,
    #panel-stocktake .stocktake-form button {
        font-size: 14px !important;
    }
    
    #panel-stocktake .mobile-only-quick-action-bar {
        display: flex !important;
    }

    #panel-stocktake .stocktake-queue-card .stocktake-submit {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #panel-stocktake .mobile-only-quick-action-bar {
        display: none !important;
    }

    #panel-stocktake .stocktake-queue-card .stocktake-submit {
        display: flex !important;
    }
}

/* ==========================================================================
   Requisition Details Document Modal & Item Table Enhancement
   Fixes cramped/overlapping item names, Part No., and quantities
   ========================================================================== */
.modal-card--document {
    width: 720px !important;
    max-width: 95vw !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3) !important;
}

.modal-card--document .modal-body {
    padding: 18px 20px !important;
}

.requisition-preview {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

.requisition-preview__meta {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.requisition-preview__meta > div {
    background: var(--bg-card, rgba(255, 255, 255, 0.04)) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
}

.requisition-preview__meta dt {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--text-muted, #94a3b8) !important;
    margin-bottom: 4px !important;
}

.requisition-preview__meta dd {
    font-size: 13.5px !important;
    font-weight: 800 !important;
    color: var(--text-main, #ffffff) !important;
    margin: 0 !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.requisition-preview__table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid var(--border-color-subtle, rgba(255, 255, 255, 0.06)) !important;
    border-radius: 12px !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 4px 0 !important;
}
body.light-theme .requisition-preview__table-wrap {
    border: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

.requisition-preview__table {
    width: 100% !important;
    min-width: 100% !important;
    border-collapse: collapse !important;
    table-layout: auto !important;
    font-size: 12.5px !important;
}

.requisition-preview__table thead {
    background: rgba(56, 189, 248, 0.08) !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.12)) !important;
}

body.light-theme .requisition-preview__table thead {
    background: rgba(2, 132, 199, 0.06) !important;
}

.requisition-preview__table th {
    padding: 12px 14px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: var(--text-muted, #94a3b8) !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
}

.requisition-preview__table th:nth-child(1) {
    text-align: left !important;
    min-width: 160px !important;
}

.requisition-preview__table th:nth-child(2) {
    text-align: left !important;
    min-width: 150px !important;
}

.requisition-preview__table th:nth-child(3) {
    text-align: right !important;
    min-width: 90px !important;
    padding-right: 18px !important;
}

.requisition-preview__table td {
    padding: 12px 14px !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.06)) !important;
    vertical-align: middle !important;
    white-space: normal !important;
    line-height: 1.45 !important;
}

.requisition-preview__table tr:last-child td {
    border-bottom: none !important;
}

.requisition-preview__table tbody tr {
    transition: background 0.15s ease !important;
}

.requisition-preview__table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

body.light-theme .requisition-preview__table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

/* 1. Item Name Column */
.requisition-preview__table td:nth-child(1) {
    text-align: left !important;
}

.requisition-preview__table td:nth-child(1) strong {
    display: block !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: var(--text-main, #ffffff) !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.4 !important;
}

body.light-theme .requisition-preview__table td:nth-child(1) strong {
    color: #0f172a !important;
}

/* 2. Part No. / SKU Code Column */
.requisition-preview__table td:nth-child(2) {
    text-align: left !important;
}

.requisition-preview__table td:nth-child(2) code {
    display: inline-block !important;
    font-family: var(--font-mono, "SF Mono", Menlo, Consolas, monospace) !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    color: #38bdf8 !important;
    word-break: break-all !important;
    letter-spacing: 0.02em !important;
}

body.light-theme .requisition-preview__table td:nth-child(2) code {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.25) !important;
    color: #0284c7 !important;
}

/* 3. Quantity Column */
.requisition-preview__table td:nth-child(3) {
    text-align: right !important;
    font-size: 13.5px !important;
    font-weight: 800 !important;
    color: #10b981 !important;
    white-space: nowrap !important;
    padding-right: 18px !important;
}

body.light-theme .requisition-preview__table td:nth-child(3) {
    color: #059669 !important;
}

.requisition-preview__note {
    margin: 0 !important;
    padding: 12px 16px !important;
    border-left: 4px solid var(--color-orange, #f59e0b) !important;
    border-radius: 0 10px 10px 0 !important;
    background: rgba(245, 158, 11, 0.08) !important;
    color: var(--text-main, #ffffff) !important;
    font-size: 12.5px !important;
    line-height: 1.5 !important;
}

body.light-theme .requisition-preview__note {
    color: #334155 !important;
    background: rgba(245, 158, 11, 0.12) !important;
}

/* ==========================================================================
   WMS REFINEMENTS: STATUS COLORS, BORDERLESS LOGO, BREATHABLE SIDEBAR & NOTIFICATIONS
   ========================================================================== */

/* 1. Status "สินค้าหมด (Out)" to be explicit bold red everywhere */
.status-badge.error,
.status-badge--error,
.status-badge.badge-out-of-stock,
.table td .status-badge.error {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
}

body.light-theme .status-badge.error,
body.light-theme .status-badge--error,
body.light-theme .table td .status-badge.error {
    color: #dc2626 !important;
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}

/* 2. Document & Header Logos: Pure logo with NO box/border */
.brand-logo-img,
.wms-logo,
.po-document img,
.requisition-document img,
.report-document img,
img.logo-img,
img[src*="logo.png"] {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

/* 3. Left Sidebar Layout Overhaul (Breathable, No Clipping, Sleek) */
.sidebar {
    width: 275px !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    padding: 16px 14px 12px !important;
    box-sizing: border-box !important;
}

.sidebar-header {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 2px 4px 12px !important;
    margin-bottom: 6px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.light-theme .sidebar-header {
    border-bottom: 1px solid #e2e8f0 !important;
}

.sidebar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    min-width: 0 !important;
}

.brand-logo-img {
    width: 38px !important;
    height: 38px !important;
    flex-shrink: 0 !important;
    object-fit: contain !important;
}

.logo-text h2 {
    font-size: 15px !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}

.logo-text span {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    display: block !important;
    margin-top: 1px !important;
}

.sidebar-nav {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 4px 4px 6px 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px !important;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
}

.nav-btn {
    min-height: 36px !important;
    padding: 7px 12px !important;
    font-size: 12.5px !important;
    border-radius: 8px !important;
    gap: 10px !important;
}

.sidebar-footer {
    flex-shrink: 0 !important;
    margin-top: auto !important;
    padding-top: 10px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

body.light-theme .sidebar-footer {
    border-top: 1px solid #e2e8f0 !important;
}

.sidebar-system-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 8px 10px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 10px !important;
    margin-bottom: 0 !important;
}

body.light-theme .sidebar-system-controls {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
}

.sidebar-role-status-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
}

.sidebar-role-badge {
    min-height: 24px !important;
    padding: 2px 8px !important;
    font-size: 10.5px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    width: auto !important;
    margin: 0 !important;
}

.sidebar-connection-badge {
    min-height: 24px !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    width: auto !important;
    margin: 0 !important;
}

.sidebar-quick-actions {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6px !important;
}

.sidebar-quick-btn {
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1)) !important;
    background: var(--bg-card, rgba(255,255,255,0.05)) !important;
    color: var(--text-secondary, #94a3b8) !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.sidebar-quick-btn:hover {
    color: var(--text-main, #ffffff) !important;
    border-color: var(--color-blue, #38bdf8) !important;
    background: rgba(56, 189, 248, 0.1) !important;
    transform: translateY(-1px) !important;
}

.active-user-badge {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
    background: transparent !important;
    border: none !important;
}

/* 4. Notification Center Modal Overhaul (Spacious, Clean, Multi-Screen Responsive for Mobile, iPad, PC) */
.notification-center-modal {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    background: rgba(10, 15, 29, 0.65) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px !important;
    animation: fadeIn 0.2s ease-out !important;
}

body.light-theme .notification-center-modal {
    background: rgba(15, 23, 42, 0.4) !important;
}

.notification-center-modal__card {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: var(--bg-main, #0f172a) !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12)) !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.light-theme .notification-center-modal__card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.2), 0 0 0 1px #e2e8f0 !important;
}

/* Header */
.notification-center-modal__header {
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    background: color-mix(in srgb, var(--surface-soft) 85%, var(--bg-card)) !important;
}

body.light-theme .notification-center-modal__header {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

.notification-center-modal__icon {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    border-radius: 12px !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    display: grid !important;
    place-items: center !important;
    color: #38bdf8 !important;
    font-size: 18px !important;
}

body.light-theme .notification-center-modal__icon {
    background: rgba(2, 132, 199, 0.1) !important;
    border-color: rgba(2, 132, 199, 0.25) !important;
    color: #0284c7 !important;
}

.notification-center-modal__unread-count {
    display: inline-flex !important;
    align-items: center !important;
    padding: 3px 10px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35) !important;
}

.notification-center-modal__clear {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background: rgba(34, 197, 94, 0.12) !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    color: #22c55e !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

.notification-center-modal__clear:hover {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
    transform: translateY(-1px) !important;
}

.notification-center-modal__close {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    border: none !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--text-muted) !important;
    font-size: 20px !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.notification-center-modal__close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    transform: rotate(90deg) !important;
}

/* Tabs Bar */
.notification-center-modal__tabs {
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    background: var(--bg-card, rgba(255, 255, 255, 0.02)) !important;
}

body.light-theme .notification-center-modal__tabs {
    background: #f1f5f9 !important;
    border-bottom-color: #e2e8f0 !important;
}

.notification-center-modal__tab {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    border: 1px solid transparent !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: var(--text-muted, #94a3b8) !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    user-select: none !important;
}

.notification-center-modal__tab:hover {
    color: var(--text-main, #ffffff) !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

body.light-theme .notification-center-modal__tab:hover {
    background: #e2e8f0 !important;
    color: #1e293b !important;
}

.notification-center-modal__tab.is-active {
    background: rgba(56, 189, 248, 0.15) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.15) !important;
}

body.light-theme .notification-center-modal__tab.is-active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

.notification-center-modal__tab-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 6px !important;
    border-radius: 999px !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: inherit !important;
}

.notification-center-modal__tab.is-active .notification-center-modal__tab-count {
    background: rgba(56, 189, 248, 0.25) !important;
    color: #38bdf8 !important;
}

body.light-theme .notification-center-modal__tab.is-active .notification-center-modal__tab-count {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
}

/* List Items Container */
.notification-center-modal__list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.notification-center-modal__list::-webkit-scrollbar {
    width: 6px !important;
}
.notification-center-modal__list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 4px !important;
}

/* Notification Item Card */
.notification-center-modal__item {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    min-width: 0 !important;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
    border-left: 4px solid var(--notice-color, #38bdf8) !important;
    border-radius: 14px !important;
    background: var(--bg-card, rgba(255, 255, 255, 0.03)) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.light-theme .notification-center-modal__item {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04) !important;
}

.notification-center-modal__item:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1) !important;
    border-color: color-mix(in srgb, var(--notice-color, #38bdf8) 45%, var(--border-color)) !important;
    transform: translateY(-1px) !important;
}

.notification-center-modal__item.is-read {
    opacity: 0.6 !important;
    background: transparent !important;
}

.notification-center-modal__item-main {
    flex: 1 1 auto !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.notification-center-modal__item-icon {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    flex: 0 0 40px !important;
    border-radius: 12px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 16px !important;
    background: var(--notice-background, rgba(56, 189, 248, 0.12)) !important;
    color: var(--notice-color, #38bdf8) !important;
}

.notification-center-modal__item-copy {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.notification-center-modal__item-title {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
}

.notification-center-modal__item-label {
    padding: 2px 8px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    background: var(--notice-background, rgba(56, 189, 248, 0.12)) !important;
    color: var(--notice-color, #38bdf8) !important;
}

.notification-center-modal__item-title strong {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: var(--text-main, #ffffff) !important;
    line-height: 1.35 !important;
}

body.light-theme .notification-center-modal__item-title strong {
    color: #0f172a !important;
}

.notification-center-modal__item-time {
    font-size: 11.5px !important;
    font-weight: 600 !important;
    color: var(--text-muted, #94a3b8) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    padding: 2px 8px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-left: auto !important;
}

body.light-theme .notification-center-modal__item-time {
    background: #f1f5f9 !important;
    color: #64748b !important;
}

.notification-center-modal__item-copy > p {
    font-size: 13px !important;
    line-height: 1.55 !important;
    color: var(--text-muted, #94a3b8) !important;
    margin: 6px 0 10px !important;
    word-break: break-word !important;
}

body.light-theme .notification-center-modal__item-copy > p {
    color: #475569 !important;
}

.notification-center-modal__item-action {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    padding: 6px 14px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    background: rgba(56, 189, 248, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    color: #38bdf8 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

body.light-theme .notification-center-modal__item-action {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    color: #0284c7 !important;
}

.notification-center-modal__item-action:hover {
    background: rgba(56, 189, 248, 0.2) !important;
    border-color: #38bdf8 !important;
    transform: translateX(2px) !important;
}

.notification-center-modal__item-close {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 50% !important;
    border: none !important;
    background: transparent !important;
    color: var(--text-muted, #64748b) !important;
    font-size: 16px !important;
    display: grid !important;
    place-items: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    flex-shrink: 0 !important;
}

.notification-center-modal__item-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--text-main, #ffffff) !important;
}

/* Empty State */
.notification-center-modal__empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 48px 24px !important;
    margin: auto 0 !important;
}

.notification-center-modal__empty-icon {
    width: 68px !important;
    height: 68px !important;
    border-radius: 50% !important;
    background: rgba(56, 189, 248, 0.08) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    display: grid !important;
    place-items: center !important;
    font-size: 28px !important;
    color: #38bdf8 !important;
    margin-bottom: 16px !important;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.1) !important;
}

body.light-theme .notification-center-modal__empty-icon {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.2) !important;
    color: #0284c7 !important;
}

.notification-center-modal__empty h4 {
    font-size: 16px !important;
    font-weight: 800 !important;
    color: var(--text-main, #ffffff) !important;
    margin: 0 0 6px !important;
}

body.light-theme .notification-center-modal__empty h4 {
    color: #0f172a !important;
}

.notification-center-modal__empty p {
    font-size: 13px !important;
    color: var(--text-muted, #94a3b8) !important;
    margin: 0 !important;
    line-height: 1.5 !important;
    max-width: 360px !important;
}

/* ==========================================================================
   MULTI-DEVICE SCREEN BREAKPOINTS (MOBILE, IPAD, PC)
   ========================================================================== */

/* 1. 📱 MOBILE (< 640px) */
@media (max-width: 639.98px) {
    .notification-center-modal {
        padding: 8px !important;
        align-items: flex-end !important;
    }

    .notification-center-modal__card {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 90vh !important;
        border-radius: 20px 20px 12px 12px !important;
    }

    .notification-center-modal__header {
        padding: 14px 16px 12px !important;
    }

    .notification-center-modal__tabs {
        padding: 8px 14px 10px !important;
        gap: 6px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }

    .notification-center-modal__tabs::-webkit-scrollbar {
        display: none !important;
    }

    .notification-center-modal__tab {
        padding: 6px 12px !important;
        font-size: 11.5px !important;
    }

    .notification-center-modal__list {
        padding: 12px 14px 20px !important;
        gap: 10px !important;
        max-height: 58vh !important;
    }

    .notification-center-modal__item {
        padding: 12px 14px !important;
        gap: 10px !important;
    }

    .notification-center-modal__item-icon {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        flex: 0 0 34px !important;
        font-size: 14px !important;
    }

    .notification-center-modal__item-title {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .notification-center-modal__item-time {
        margin-left: 0 !important;
        font-size: 10.5px !important;
    }
}

/* 2. 📱 IPAD & TABLET (640px - 1024px) */
@media (min-width: 640px) and (max-width: 1024px) {
    .notification-center-modal {
        padding: 24px !important;
    }

    .notification-center-modal__card {
        width: min(680px, 92vw) !important;
        max-width: 680px !important;
        max-height: 84vh !important;
        border-radius: 20px !important;
    }

    .notification-center-modal__header {
        padding: 18px 24px 14px !important;
    }

    .notification-center-modal__tabs {
        padding: 10px 24px 12px !important;
        gap: 8px !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
    }

    .notification-center-modal__tab {
        padding: 7px 14px !important;
        font-size: 12px !important;
    }

    .notification-center-modal__list {
        padding: 16px 24px 24px !important;
        gap: 12px !important;
        max-height: 62vh !important;
    }

    .notification-center-modal__item {
        padding: 14px 18px !important;
        gap: 14px !important;
    }
}

/* 3. 💻 PC & DESKTOP (> 1024px) */
@media (min-width: 1024.02px) {
    .notification-center-modal {
        padding: 32px !important;
    }

    .notification-center-modal__card {
        width: 740px !important;
        max-width: 740px !important;
        max-height: 84vh !important;
        border-radius: 22px !important;
    }

    .notification-center-modal__header {
        padding: 20px 28px 16px !important;
    }

    .notification-center-modal__tabs {
        padding: 12px 28px 14px !important;
        gap: 10px !important;
        flex-wrap: wrap !important;
    }

    .notification-center-modal__tab {
        padding: 8px 16px !important;
        font-size: 12.5px !important;
    }

    .notification-center-modal__list {
        padding: 20px 28px 28px !important;
        gap: 12px !important;
        max-height: 64vh !important;
    }

    .notification-center-modal__item {
        padding: 16px 20px !important;
        gap: 16px !important;
    }
}



/* ==========================================================================
   SECTION 5: ENTERPRISE THEME & THAI TYPOGRAPHY HARDENING (LIGHT / DARK)
   ========================================================================== */

/* 1. Global Thai Typography Smoothing & Font Definition */
html, body, #root, .modal-card, .wms-document, .page-panel, button, input, select, textarea {
    font-family: 'Sarabun', 'Leelawadee UI', 'Tahoma', 'Noto Sans Thai', sans-serif !important;
    letter-spacing: normal !important;
    text-rendering: geometricPrecision !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* 2. Light Theme System-Wide Legibility Overhaul */
body.light-theme {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme #root,
body.light-theme .app-layout {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-theme .sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04) !important;
}

body.light-theme .sidebar .nav-btn {
    color: #334155 !important;
}

body.light-theme .sidebar .nav-btn:hover {
    background: #f1f5f9 !important;
    color: #0284c7 !important;
}

body.light-theme .sidebar .nav-btn.active {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 700 !important;
}

body.light-theme .top-header,
body.light-theme .header-container {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme .panel-header h1,
body.light-theme .panel-header h2,
body.light-theme .panel-header h3,
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.light-theme p,
body.light-theme .text-muted,
body.light-theme .panel-header p {
    color: #64748b !important;
}

body.light-theme .card,
body.light-theme .card-glass,
body.light-theme .page-panel .card,
body.light-theme .operations-user-card,
body.light-theme .operations-report-card,
body.light-theme .operations-progress-card,
body.light-theme .operations-tip-card,
body.light-theme .settings-section-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 10px 25px -5px rgba(15, 23, 42, 0.03) !important;
    color: #0f172a !important;
}

body.light-theme .table,
body.light-theme table {
    color: #0f172a !important;
}

body.light-theme thead th,
body.light-theme .table thead th {
    background: #f8fafc !important;
    color: #334155 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
}

body.light-theme tbody tr {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme tbody tr:hover {
    background: #f8fafc !important;
}

body.light-theme input.input-text,
body.light-theme select.input-text,
body.light-theme textarea.input-text,
body.light-theme .search-input,
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="number"],
body.light-theme select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-theme input.input-text:focus,
body.light-theme select.input-text:focus,
body.light-theme textarea.input-text:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

body.light-theme .modal-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16) !important;
}

/* 3. Dark Theme Polish for Consistent Depth */
body:not(.light-theme) {
    background-color: #0b1120 !important;
    color: #f8fafc !important;
}

body:not(.light-theme) .card,
body:not(.light-theme) .card-glass,
body:not(.light-theme) .page-panel .card {
    background: rgba(17, 24, 39, 0.90) !important;
    border: 1px solid rgba(203, 213, 225, 0.12) !important;
}

body:not(.light-theme) input.input-text,
body:not(.light-theme) select.input-text,
body:not(.light-theme) textarea.input-text {
    background: rgba(15, 23, 42, 0.75) !important;
    color: #f8fafc !important;
    border: 1px solid rgba(203, 213, 225, 0.20) !important;
}

/* 4. Elimination of Cluttered Duplicate Icons */
.btn-clean-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}


/* ==========================================================================
   SECTION 6: ULTRA HIGH-CONTRAST LIGHT & DEEP MIDNIGHT DARK MODE WITH GRID
   User Selected: 
   - Light Mode: High-Contrast Pure White (#ffffff) + Jet Black text
   - Dark Mode: Deep Midnight Slate (#0b1120) + Sharp White text
   - Tables & Data: Grid lines around every cell + Bold High Legibility
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBAL TYPOGRAPHY & GRID SYSTEM
   -------------------------------------------------------------------------- */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   2. LIGHT MODE (HIGH-CONTRAST PURE WHITE + BLACK TEXT + CRISP GRID)
   -------------------------------------------------------------------------- */
:root:has(body.light-theme),
body.light-theme {
    --bg-main: #ffffff !important;
    --bg-sidebar: #ffffff !important;
    --bg-card: #ffffff !important;
    --bg-card-hover: #f8fafc !important;
    --bg-card-elevated: #ffffff !important;
    --surface-soft: #f1f5f9 !important;
    --surface-glass: #ffffff !important;
    --input-bg: #ffffff !important;
    
    --border-color: #cbd5e1 !important;
    --border-color-subtle: #e2e8f0 !important;
    --border-color-hover: #0284c7 !important;
    --border-color-glow: rgba(2, 132, 199, 0.40) !important;
    
    --text-main: #000000 !important;
    --text-primary: #000000 !important;
    --text-secondary: #1e293b !important;
    --text-muted: #334155 !important;
    --text-disabled: #64748b !important;

    background-color: #ffffff !important;
    color: #000000 !important;
}

body.light-theme #root,
body.light-theme .app-layout,
body.light-theme .main-content,
body.light-theme .page-panel {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Light Mode: Sidebar & Top Header */
body.light-theme .sidebar {
    background-color: #ffffff !important;
    border-right: 2px solid #cbd5e1 !important;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05) !important;
}

body.light-theme .top-header,
body.light-theme .header-container {
    background-color: #ffffff !important;
    border-bottom: 2px solid #cbd5e1 !important;
    color: #000000 !important;
}

body.light-theme .sidebar .nav-btn {
    color: #0f172a !important;
    font-weight: 700 !important;
}

body.light-theme .sidebar .nav-btn:hover {
    background-color: #f1f5f9 !important;
    color: #0369a1 !important;
}

body.light-theme .sidebar .nav-btn.active {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

body.light-theme .sidebar .nav-btn.active i {
    color: #ffffff !important;
}

/* Light Mode: Headings, Paragraphs & Labels */
body.light-theme h1, body.light-theme h2, body.light-theme h3, body.light-theme h4, body.light-theme h5, body.light-theme h6,
body.light-theme .panel-header h1, body.light-theme .panel-header h2, body.light-theme .panel-header h3 {
    color: #000000 !important;
    font-weight: 900 !important;
}

body.light-theme p, 
body.light-theme span, 
body.light-theme .panel-header p,
body.light-theme .text-muted {
    color: #1e293b !important;
    font-weight: 600 !important;
}

body.light-theme label {
    color: #000000 !important;
    font-weight: 800 !important;
}

/* Light Mode: Cards with Defined High-Contrast Borders */
body.light-theme .card,
body.light-theme .card-glass,
body.light-theme .page-panel .card,
body.light-theme .operations-user-card,
body.light-theme .operations-report-card,
body.light-theme .operations-progress-card,
body.light-theme .operations-tip-card,
body.light-theme .operations-alert-card,
body.light-theme .settings-section-card,
body.light-theme .requisition-template-card,
body.light-theme .requisition-step-card,
body.light-theme .stat-card,
body.light-theme .metric-card {
    background-color: #ffffff !important;
    border: 1px solid #94a3b8 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
    color: #000000 !important;
}

/* Light Mode: Table Grid with Crisp Visible Cell Borders */
body.light-theme table,
body.light-theme .table,
body.light-theme .data-table,
body.light-theme .requisition-preview__table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    background-color: transparent !important;
    color: #0f172a !important;
}

body.light-theme table thead th,
body.light-theme .table thead th,
body.light-theme .data-table thead th,
body.light-theme .requisition-preview__table thead th {
    background-color: #f8fafc !important;
    color: #475569 !important;
    font-weight: 700 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 11px 12px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

body.light-theme table tbody td,
body.light-theme .table tbody td,
body.light-theme .data-table tbody td,
body.light-theme .requisition-preview__table tbody td {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #1e293b !important;
    font-weight: 600 !important;
    padding: 11px 12px !important;
    font-size: 12.5px !important;
}

body.light-theme table tbody tr:hover,
body.light-theme .table tbody tr:hover,
body.light-theme .data-table tbody tr:hover {
    background-color: #f8fafc !important;
}

body.light-theme td strong,
body.light-theme td b {
    color: #000000 !important;
    font-weight: 900 !important;
}

/* Light Mode: Form Inputs with Crisp High-Contrast Borders */
body.light-theme input.input-text,
body.light-theme select.input-text,
body.light-theme textarea.input-text,
body.light-theme .search-input,
body.light-theme input[type="text"],
body.light-theme input[type="password"],
body.light-theme input[type="number"],
body.light-theme select,
body.light-theme textarea {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1.5px solid #64748b !important;
    font-weight: 700 !important;
}

body.light-theme input.input-text:focus,
body.light-theme select.input-text:focus,
body.light-theme textarea.input-text:focus {
    border-color: #0284c7 !important;
    outline: 2px solid #0284c7 !important;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.20) !important;
}

/* Light Mode: Status Badges & Pills */
body.light-theme .status-badge,
body.light-theme .badge {
    font-weight: 800 !important;
    border: 1px solid currentColor !important;
}

body.light-theme .status-badge.success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
    border-color: #86efac !important;
}

body.light-theme .status-badge.danger,
body.light-theme .status-badge.error,
body.light-theme .status-badge.rejected,
body.light-theme .badge-count-red {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
}

body.light-theme .status-badge.warning,
body.light-theme .status-badge.pending {
    background-color: #fef3c7 !important;
    color: #b45309 !important;
    border-color: #fde68a !important;
}

body.light-theme .status-badge.info {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #7dd3fc !important;
}

/* --------------------------------------------------------------------------
   3. DARK MODE (DEEP MIDNIGHT SLATE + SHARP WHITE TEXT + CRISP GRID)
   -------------------------------------------------------------------------- */
body:not(.light-theme) {
    --bg-main: #0b1120 !important;
    --bg-sidebar: #0f172a !important;
    --bg-card: #111827 !important;
    --bg-card-hover: #1e293b !important;
    --bg-card-elevated: #1f2937 !important;
    --surface-soft: rgba(255, 255, 255, 0.05) !important;
    --surface-glass: rgba(17, 24, 39, 0.85) !important;
    --input-bg: #0f172a !important;
    
    --border-color: rgba(203, 213, 225, 0.22) !important;
    --border-color-subtle: rgba(203, 213, 225, 0.12) !important;
    --border-color-hover: #38bdf8 !important;
    --border-color-glow: rgba(56, 189, 248, 0.45) !important;
    
    --text-main: #ffffff !important;
    --text-primary: #ffffff !important;
    --text-secondary: #cbd5e1 !important;
    --text-muted: #94a3b8 !important;
    --text-disabled: #64748b !important;

    background-color: #0b1120 !important;
    color: #ffffff !important;
}

body:not(.light-theme) #root,
body:not(.light-theme) .app-layout,
body:not(.light-theme) .main-content,
body:not(.light-theme) .page-panel {
    background-color: #0b1120 !important;
    color: #ffffff !important;
}

/* Dark Mode: Sidebar & Top Header */
body:not(.light-theme) .sidebar {
    background-color: #0f172a !important;
    border-right: 1px solid rgba(203, 213, 225, 0.18) !important;
}

body:not(.light-theme) .top-header,
body:not(.light-theme) .header-container {
    background-color: #0f172a !important;
    border-bottom: 1px solid rgba(203, 213, 225, 0.18) !important;
}

body:not(.light-theme) .sidebar .nav-btn {
    color: #cbd5e1 !important;
    font-weight: 700 !important;
}

body:not(.light-theme) .sidebar .nav-btn:hover {
    background-color: #1e293b !important;
    color: #38bdf8 !important;
}

body:not(.light-theme) .sidebar .nav-btn.active {
    background-color: #0284c7 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* Dark Mode: Headings, Paragraphs & Labels */
body:not(.light-theme) #root h1, body:not(.light-theme) #root h2, body:not(.light-theme) #root h3, body:not(.light-theme) #root h4,
body:not(.light-theme) .modal-card h1, body:not(.light-theme) .modal-card h2, body:not(.light-theme) .modal-card h3, body:not(.light-theme) .modal-card h4,
body:not(.light-theme) .panel-header h1, body:not(.light-theme) .panel-header h2, body:not(.light-theme) .panel-header h3 {
    color: #ffffff !important;
    font-weight: 900 !important;
}

body:not(.light-theme) #root p, 
body:not(.light-theme) #root span:not(.wms-chip):not(.badge):not(.status-badge), 
body:not(.light-theme) .modal-card p,
body:not(.light-theme) .panel-header p,
body:not(.light-theme) .text-muted {
    color: #cbd5e1 !important;
    font-weight: 600 !important;
}

body:not(.light-theme) #root label,
body:not(.light-theme) .modal-card label {
    color: #ffffff !important;
    font-weight: 800 !important;
}

/* Dark Mode: Cards with Deep Midnight Slate */
body:not(.light-theme) .card,
body:not(.light-theme) .card-glass,
body:not(.light-theme) .page-panel .card,
body:not(.light-theme) .operations-user-card,
body:not(.light-theme) .operations-report-card,
body:not(.light-theme) .operations-progress-card,
body:not(.light-theme) .operations-tip-card,
body:not(.light-theme) .operations-alert-card,
body:not(.light-theme) .settings-section-card,
body:not(.light-theme) .requisition-template-card,
body:not(.light-theme) .requisition-step-card,
body:not(.light-theme) .stat-card,
body:not(.light-theme) .metric-card {
    background-color: #111827 !important;
    border: 1px solid rgba(203, 213, 225, 0.20) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
    color: #ffffff !important;
}

/* Dark Mode: Table Grid with Crisp Visible Cell Borders */
body:not(.light-theme) #root table:not(.wms-table):not(.wms-meta-table):not(.wms-signatures),
body:not(.light-theme) .table:not(.wms-table):not(.wms-meta-table):not(.wms-signatures),
body:not(.light-theme) .data-table,
body:not(.light-theme) .requisition-preview__table {
    width: 100% !important;
    border-collapse: collapse !important;
    border: none !important;
    background-color: transparent !important;
    color: #f8fafc !important;
}

body:not(.light-theme) #root table:not(.wms-table) thead th,
body:not(.light-theme) .table:not(.wms-table) thead th,
body:not(.light-theme) .data-table thead th,
body:not(.light-theme) .requisition-preview__table thead th {
    background-color: rgba(30, 41, 59, 0.6) !important;
    color: #94a3b8 !important;
    font-weight: 700 !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.08) !important;
    padding: 11px 12px !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

body:not(.light-theme) #root table:not(.wms-table):not(.wms-meta-table):not(.wms-signatures) tbody td,
body:not(.light-theme) .table:not(.wms-table):not(.wms-meta-table):not(.wms-signatures) tbody td,
body:not(.light-theme) .data-table tbody td,
body:not(.light-theme) .requisition-preview__table tbody td {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: #f1f5f9 !important;
    font-weight: 600 !important;
    padding: 11px 12px !important;
    font-size: 12.5px !important;
}

body:not(.light-theme) #root table:not(.wms-table) tbody tr:hover,
body:not(.light-theme) .table:not(.wms-table) tbody tr:hover,
body:not(.light-theme) .data-table tbody tr:hover {
    background-color: #1e293b !important;
}

body:not(.light-theme) #root td strong,
body:not(.light-theme) #root td b,
body:not(.light-theme) .modal-card td strong {
    color: #ffffff !important;
    font-weight: 900 !important;
}

/* Dark Mode: Form Inputs */
body:not(.light-theme) input.input-text,
body:not(.light-theme) select.input-text,
body:not(.light-theme) textarea.input-text,
body:not(.light-theme) .search-input,
body:not(.light-theme) input[type="text"],
body:not(.light-theme) input[type="password"],
body:not(.light-theme) input[type="number"],
body:not(.light-theme) select,
body:not(.light-theme) textarea {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(203, 213, 225, 0.25) !important;
    font-weight: 700 !important;
}

body:not(.light-theme) input.input-text:focus,
body:not(.light-theme) select.input-text:focus,
body:not(.light-theme) textarea.input-text:focus {
    border-color: #38bdf8 !important;
    outline: 2px solid #38bdf8 !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.25) !important;
}

/* --------------------------------------------------------------------------
   4. MODALS & DIALOGS IN BOTH THEMES
   -------------------------------------------------------------------------- */
body.light-theme .modal-card,
body.light-theme .modal-container {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 2px solid #64748b !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body:not(.light-theme) .modal-card,
body:not(.light-theme) .modal-container {
    background-color: #111827 !important;
    color: #ffffff !important;
    border: 2px solid rgba(203, 213, 225, 0.30) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.60) !important;
}


/* ==========================================================================
   SECTION 7: COLOR-CODED DATA SETS & STRICT TEXT LENGTH CONTROLS
   User Request:
   1. แยกสีในแต่ละชุดข้อมูลให้ชัดเจน ดูง่าย สบายตา (Status, Categories, KPIs, Zones)
   2. คุมจำนวนข้อความในแต่ละหัวข้อ ไม่ให้ยาวหรือล้นจอ (Text Truncation & Clamp)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOR-CODED STATUS BADGES & SETS (ชัดเจน สดใส ทุกโหมด)
   -------------------------------------------------------------------------- */

/* 1.1 Status: PENDING (รออนุมัติ / รอพิจารณา / รอดำเนินการ) -> สีทอง/ส้มอำพัน */
.status-badge.pending,
.status-badge.status-pending,
.status-badge.tone-pending,
.badge-pending,
[data-status="PENDING"] {
    color: #b45309 !important;
    background: #fef3c7 !important;
    border: 1.5px solid #f59e0b !important;
    font-weight: 800 !important;
}
body:not(.light-theme) .status-badge.pending,
body:not(.light-theme) .status-badge.status-pending,
body:not(.light-theme) .status-badge.tone-pending,
body:not(.light-theme) .badge-pending,
body:not(.light-theme) [data-status="PENDING"] {
    color: #fbbf24 !important;
    background: rgba(245, 158, 11, 0.18) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
}

/* 1.2 Status: APPROVED (อนุมัติแล้ว / พร้อมจัดเตรียม) -> สีฟ้า/น้ำเงินสดใส */
.status-badge.approved,
.status-badge.status-approved,
.status-badge.tone-approved,
.badge-approved,
[data-status="APPROVED"] {
    color: #0369a1 !important;
    background: #e0f2fe !important;
    border: 1.5px solid #38bdf8 !important;
    font-weight: 800 !important;
}
body:not(.light-theme) .status-badge.approved,
body:not(.light-theme) .status-badge.status-approved,
body:not(.light-theme) .status-badge.tone-approved,
body:not(.light-theme) .badge-approved,
body:not(.light-theme) [data-status="APPROVED"] {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.18) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

/* 1.3 Status: DISPATCHED (จ่ายสินค้าแล้ว / กำลังนำส่ง) -> สีม่วงสดใส */
.status-badge.dispatched,
.status-badge.status-dispatched,
.status-badge.tone-dispatched,
.badge-dispatched,
[data-status="DISPATCHED"] {
    color: #6d28d9 !important;
    background: #ede9fe !important;
    border: 1.5px solid #a78bfa !important;
    font-weight: 800 !important;
}
body:not(.light-theme) .status-badge.dispatched,
body:not(.light-theme) .status-badge.status-dispatched,
body:not(.light-theme) .status-badge.tone-dispatched,
body:not(.light-theme) .badge-dispatched,
body:not(.light-theme) [data-status="DISPATCHED"] {
    color: #c4b5fd !important;
    background: rgba(167, 139, 250, 0.18) !important;
    border-color: rgba(167, 139, 250, 0.45) !important;
}

/* 1.4 Status: RECEIVED (รับสินค้าและแนบรูปแล้ว / สมบูรณ์) -> สีเขียวมรกต */
.status-badge.received,
.status-badge.status-received,
.status-badge.tone-received,
.status-badge.success,
.badge-received,
.badge-success {
    color: #15803d !important;
    background: #dcfce7 !important;
    border: 1.5px solid #4ade80 !important;
    font-weight: 800 !important;
}
body:not(.light-theme) .status-badge.received,
body:not(.light-theme) .status-badge.status-received,
body:not(.light-theme) .status-badge.tone-received,
body:not(.light-theme) .status-badge.success,
body:not(.light-theme) .badge-received,
body:not(.light-theme) .badge-success {
    color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.18) !important;
    border-color: rgba(74, 222, 128, 0.45) !important;
}

/* 1.5 Status: CANCELLED / REJECTED / OUT OF STOCK -> สีแดงชัดเจนเด่นชัด */
.status-badge.cancelled,
.status-badge.status-cancelled,
.status-badge.tone-cancelled,
.status-badge.rejected,
.status-badge.status-rejected,
.status-badge.danger,
.status-badge.error,
.status-badge.badge-out-of-stock {
    color: #b91c1c !important;
    background: #fee2e2 !important;
    border: 1.5px solid #f87171 !important;
    font-weight: 800 !important;
}
body:not(.light-theme) .status-badge.cancelled,
body:not(.light-theme) .status-badge.status-cancelled,
body:not(.light-theme) .status-badge.tone-cancelled,
body:not(.light-theme) .status-badge.rejected,
body:not(.light-theme) .status-badge.status-rejected,
body:not(.light-theme) .status-badge.danger,
body:not(.light-theme) .status-badge.error,
body:not(.light-theme) .status-badge.badge-out-of-stock {
    color: #fb7185 !important;
    background: rgba(251, 113, 133, 0.18) !important;
    border-color: rgba(251, 113, 133, 0.45) !important;
}

/* --------------------------------------------------------------------------
   2. COLOR-CODED PRODUCT CATEGORIES & TYPES (แยกหมวดหมู่ง่ายต่อการค้นหา)
   -------------------------------------------------------------------------- */
.category-pill,
.category-badge,
.tag-category {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 3px 9px !important;
    border-radius: 6px !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

/* หมวด ของสด/เนื้อสัตว์ */
.cat-fresh, [data-category="FRESH"], .badge-fresh {
    color: #15803d !important;
    background: #dcfce7 !important;
    border: 1px solid #86efac !important;
}
body:not(.light-theme) .cat-fresh, body:not(.light-theme) [data-category="FRESH"], body:not(.light-theme) .badge-fresh {
    color: #4ade80 !important;
    background: rgba(74, 222, 128, 0.15) !important;
    border-color: rgba(74, 222, 128, 0.35) !important;
}

/* หมวด พืชผัก */
.cat-veg, [data-category="VEGETABLE"], .badge-veg {
    color: #4d7c0f !important;
    background: #ecfccb !important;
    border: 1px solid #a3e635 !important;
}
body:not(.light-theme) .cat-veg, body:not(.light-theme) [data-category="VEGETABLE"], body:not(.light-theme) .badge-veg {
    color: #a3e635 !important;
    background: rgba(163, 230, 53, 0.15) !important;
    border-color: rgba(163, 230, 53, 0.35) !important;
}

/* หมวด เครื่องดื่ม */
.cat-bev, [data-category="BEVERAGE"], .badge-bev {
    color: #0369a1 !important;
    background: #e0f2fe !important;
    border: 1px solid #7dd3fc !important;
}
body:not(.light-theme) .cat-bev, body:not(.light-theme) [data-category="BEVERAGE"], body:not(.light-theme) .badge-bev {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
}

/* หมวด อะไหล่ & เครื่องมือ */
.cat-spare, [data-category="SPARE_PARTS"], .badge-spare {
    color: #6d28d9 !important;
    background: #ede9fe !important;
    border: 1px solid #c4b5fd !important;
}
body:not(.light-theme) .cat-spare, body:not(.light-theme) [data-category="SPARE_PARTS"], body:not(.light-theme) .badge-spare {
    color: #c4b5fd !important;
    background: rgba(196, 181, 253, 0.15) !important;
    border-color: rgba(196, 181, 253, 0.35) !important;
}

/* หมวด ของใช้ทั่วไป */
.cat-supply, [data-category="SUPPLY"], .badge-supply {
    color: #b45309 !important;
    background: #fef3c7 !important;
    border: 1px solid #fde68a !important;
}
body:not(.light-theme) .cat-supply, body:not(.light-theme) [data-category="SUPPLY"], body:not(.light-theme) .badge-supply {
    color: #fbbf24 !important;
    background: rgba(251, 191, 36, 0.15) !important;
    border-color: rgba(251, 191, 36, 0.35) !important;
}

/* --------------------------------------------------------------------------
   3. COLOR-CODED KPI METRICS CARDS (แถบสีแยกแต่ละหมวดตัวเลข ชัดเจนระดับบริหาร)
   -------------------------------------------------------------------------- */
.operations-metrics {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 12px !important;
}

.operations-metrics > div {
    padding: 12px 14px !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}

body:not(.light-theme) .operations-metrics > div {
    background: #111827 !important;
    border: 1.5px solid rgba(203, 213, 225, 0.20) !important;
}

/* KPI 1: สินค้าอนุมัติ (สีฟ้า) */
.operations-metrics > div:nth-child(1) {
    border-left: 5px solid #0284c7 !important;
}
.operations-metrics > div:nth-child(1) strong {
    color: #0284c7 !important;
    font-size: 22px !important;
}

/* KPI 2: ต้องสั่งซื้อด่วน (สีแดง) */
.operations-metrics > div:nth-child(2) {
    border-left: 5px solid #dc2626 !important;
}
.operations-metrics > div:nth-child(2) strong {
    color: #dc2626 !important;
    font-size: 22px !important;
}

/* KPI 3: ใบเบิกรออนุมัติ (สีส้ม) */
.operations-metrics > div:nth-child(3) {
    border-left: 5px solid #f59e0b !important;
}
.operations-metrics > div:nth-child(3) strong {
    color: #d97706 !important;
    font-size: 22px !important;
}

/* KPI 4: รายการจ่ายออก (สีม่วง) */
.operations-metrics > div:nth-child(4) {
    border-left: 5px solid #8b5cf6 !important;
}
.operations-metrics > div:nth-child(4) strong {
    color: #7c3aed !important;
    font-size: 22px !important;
}

/* KPI 5: มูลค่าสต๊อก (สีเขียว) */
.operations-metrics > div:nth-child(5) {
    border-left: 5px solid #10b981 !important;
}
.operations-metrics > div:nth-child(5) strong {
    color: #059669 !important;
    font-size: 22px !important;
}

/* --------------------------------------------------------------------------
   4. STRICT TEXT LENGTH & OVERFLOW CONTROLS (คุมความยาวข้อความ ไม่ให้ล้นจอ)
   -------------------------------------------------------------------------- */

/* 4.1 Single-Line Truncation (หัวข้อหลัก, รหัส, ชื่อแบรนด์) */
.panel-header h2,
.settings-section-header h3,
.operations-user-card h3,
.operations-report-card h3,
.sidebar-brand .logo-text h2,
.wms-document-number {
    max-width: 100% !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    letter-spacing: normal !important;
}

/* 4.2 Two-Line Clamp (คำอธิบาย, รายละเอียด, หมายเหตุ) */
.panel-header p,
.settings-section-header p,
.operations-tip-card p,
.settings-toggle-row div.subtitle,
.operations-alert p,
.table td .text-sub,
.wms-subtext {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    line-height: 1.4 !important;
    max-width: 600px !important;
}

/* 4.3 Table Column Width & Cell Overflow Guards */
.table td,
.data-table td,
.requisition-preview__table td {
    max-width: 380px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    vertical-align: middle !important;
}

/* SKU / Barcode Cell - Compact Monospace No-Wrap */
.table td.sku-cell,
.table td .sku-code,
.wms-code {
    max-width: 180px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-family: monospace !important;
    font-weight: 700 !important;
}

/* Product Name Cell - Bold with Max 2 Lines */
.table td.cell-product-name strong,
.table td.cell-product-name b,
.table td > strong.product-name-clamp {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
}

/* Ensure numbers, stock ratios, and inline strongs stay cleanly formatted */
.table td strong,
.table td b {
    display: inline;
}
.table td div strong,
.table td .wms-block-strong {
    display: block !important;
}

/* Badges never wrap into two lines */
.status-badge,
.badge,
.category-pill,
.wms-chip {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* ==========================================================================
   IMMEDIATE PDF & PRINT DOCUMENT ISOLATION (ZERO THEME LEAKAGE GUARANTEE)
   ========================================================================== */
.wms-document,
.wms-document *,
.wms-page,
.wms-page *,
.report-document,
.report-document *,
.pdf-export-root,
.pdf-export-root * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    text-rendering: geometricPrecision !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
    font-family: 'Sarabun', 'Leelawadee UI', Tahoma, 'Noto Sans Thai', Arial, sans-serif !important;
}

.wms-document,
.wms-page,
.report-document,
.pdf-export-root {
    background-color: #ffffff !important;
    color: #172033 !important;
    width: 794px !important;
    min-width: 794px !important;
}

.wms-document h1,
.wms-document .wms-company-name,
.report-document .wms-company-name,
.wms-company-name {
    color: #173b66 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    margin: 0 0 2px 0 !important;
}

.wms-document .wms-document-title,
.report-document .wms-document-title,
.wms-document-title {
    color: #172033 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
}

.wms-document .wms-system-name,
.report-document .wms-system-name,
.wms-system-name {
    color: #64748b !important;
    font-size: 9.5px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    margin: 2px 0 0 0 !important;
}

.wms-document .wms-document-label,
.report-document .wms-document-label {
    color: #64748b !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.wms-document .wms-document-number,
.report-document .wms-document-number {
    color: #172033 !important;
    font-family: 'Courier New', monospace !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.wms-document .wms-section-title,
.report-document .wms-section-title {
    color: #173b66 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    margin: 12px 0 6px 0 !important;
}

.wms-document .wms-table,
.report-document .wms-table,
.wms-document .wms-meta-table,
.report-document .wms-meta-table {
    background-color: #ffffff !important;
    color: #172033 !important;
    border: 1px solid #8fa4ba !important;
    border-collapse: collapse !important;
    width: 100% !important;
}

.wms-document .wms-table th,
.report-document .wms-table th {
    background-color: #173b66 !important;
    color: #ffffff !important;
    border: 1px solid #8fa4ba !important;
    font-weight: 700 !important;
    font-size: 8.8px !important;
    letter-spacing: 0 !important;
    padding: 7px !important;
}

.wms-document .wms-table td,
.report-document .wms-table td {
    background-color: #ffffff !important;
    color: #172033 !important;
    border: 1px solid #c9d5e2 !important;
    font-size: 9.5px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    padding: 6px 7px !important;
}

.wms-document .wms-table tbody tr:nth-child(even) td,
.report-document .wms-table tbody tr:nth-child(even) td {
    background-color: #f7f9fc !important;
}

.wms-document .wms-stat-grid,
.report-document .wms-stat-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.wms-document .wms-stat,
.report-document .wms-stat {
    min-height: 64px !important;
    padding: 9px 11px !important;
    background-color: #f4f7fb !important;
    border: 1px solid #d8e1eb !important;
    border-radius: 8px !important;
}

.wms-document .wms-stat-label,
.report-document .wms-stat-label {
    color: #64748b !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.wms-document .wms-stat-value,
.report-document .wms-stat-value {
    color: #173b66 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.wms-document .wms-signatures,
.report-document .wms-signatures {
    margin-top: 16px !important;
    width: 100% !important;
    border-collapse: collapse !important;
}

.wms-document .wms-signatures td,
.report-document .wms-signatures td {
    border: none !important;
    background: transparent !important;
    padding: 0 10px !important;
    text-align: center !important;
}

.wms-document .wms-signature-space,
.report-document .wms-signature-space {
    height: 52px !important;
}

.wms-document .wms-signature-line,
.report-document .wms-signature-line {
    border-bottom: 1px solid #475569 !important;
    width: 86% !important;
    margin: 0 auto 5px !important;
}

.wms-document .wms-signature-role,
.report-document .wms-signature-role {
    color: #172033 !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    letter-spacing: 0 !important;
}

.wms-document .wms-footer,
.report-document .wms-footer {
    border-top: 1px solid #c9d5e2 !important;
    color: #64748b !important;
    font-size: 8px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.wms-document .wms-footer span,
.report-document .wms-footer span {
    color: #64748b !important;
    font-size: 8px !important;
}

/* ==========================================================================
   GLOBAL THAI TYPOGRAPHY & ZERO VOWEL DRIFT HARDENING (ป้องกันสระเพี้ยน/สระลอย)
   ========================================================================== */
html, body, button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6, p, span, a, label, strong, em, b, i, code {
    letter-spacing: 0 !important;
    word-spacing: normal !important;
    font-feature-settings: "liga" 1, "calt" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==========================================================================
   HISTORY & STOCK MOVEMENT LEDGER - LIGHT MODE READABILITY UPGRADE
   (ปรับแต่งประวัติเดินคลังและบัตรคุมสต็อกในโหมดสว่างให้อ่านง่าย คมชัด พรีเมียม สบายตา)
   ========================================================================== */

body.light-theme .history-kpi-in,
body.light-theme .history-kpi-card:nth-child(1) {
    background: #ffffff !important;
    border: 1.5px solid #86efac !important;
    box-shadow: 0 2px 10px rgba(22, 101, 52, 0.08) !important;
}
body.light-theme .history-kpi-in > div:first-child,
body.light-theme .history-kpi-card:nth-child(1) > div:first-child {
    color: #15803d !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-in .badge,
body.light-theme .history-kpi-card:nth-child(1) .badge {
    background: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #86efac !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-in > div:last-child,
body.light-theme .history-kpi-card:nth-child(1) > div:last-child {
    color: #15803d !important;
    font-weight: 900 !important;
}
body.light-theme .history-kpi-in > div:last-child span,
body.light-theme .history-kpi-card:nth-child(1) > div:last-child span {
    color: #166534 !important;
    font-weight: 700 !important;
}

body.light-theme .history-kpi-out,
body.light-theme .history-kpi-card:nth-child(2) {
    background: #ffffff !important;
    border: 1.5px solid #fca5a5 !important;
    box-shadow: 0 2px 10px rgba(190, 18, 60, 0.08) !important;
}
body.light-theme .history-kpi-out > div:first-child,
body.light-theme .history-kpi-card:nth-child(2) > div:first-child {
    color: #be123c !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-out .badge,
body.light-theme .history-kpi-card:nth-child(2) .badge {
    background: #fee2e2 !important;
    color: #9f1239 !important;
    border: 1px solid #fca5a5 !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-out > div:last-child,
body.light-theme .history-kpi-card:nth-child(2) > div:last-child {
    color: #be123c !important;
    font-weight: 900 !important;
}
body.light-theme .history-kpi-out > div:last-child span,
body.light-theme .history-kpi-card:nth-child(2) > div:last-child span {
    color: #9f1239 !important;
    font-weight: 700 !important;
}

body.light-theme .history-kpi-adjust,
body.light-theme .history-kpi-card:nth-child(3) {
    background: #ffffff !important;
    border: 1.5px solid #7dd3fc !important;
    box-shadow: 0 2px 10px rgba(3, 105, 161, 0.08) !important;
}
body.light-theme .history-kpi-adjust > div:first-child,
body.light-theme .history-kpi-card:nth-child(3) > div:first-child {
    color: #0369a1 !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-adjust .badge,
body.light-theme .history-kpi-card:nth-child(3) .badge {
    background: #e0f2fe !important;
    color: #075985 !important;
    border: 1px solid #7dd3fc !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-adjust > div:last-child,
body.light-theme .history-kpi-card:nth-child(3) > div:last-child {
    color: #0369a1 !important;
    font-weight: 900 !important;
}
body.light-theme .history-kpi-adjust > div:last-child span,
body.light-theme .history-kpi-card:nth-child(3) > div:last-child span {
    color: #075985 !important;
    font-weight: 700 !important;
}

body.light-theme .history-kpi-net,
body.light-theme .history-kpi-card:nth-child(4) {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06) !important;
}
body.light-theme .history-kpi-net > div:first-child,
body.light-theme .history-kpi-card:nth-child(4) > div:first-child {
    color: #1e293b !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-net .badge,
body.light-theme .history-kpi-card:nth-child(4) .badge {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 800 !important;
}
body.light-theme .history-kpi-net > div:last-child,
body.light-theme .history-kpi-card:nth-child(4) > div:last-child {
    font-weight: 900 !important;
}

/* History 3-Pill Metrics Grid in Light Mode (Category, Product & Stock Card) */
body.light-theme .product-summary-metrics-grid,
body.light-theme .stock-card-metrics-grid {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

body.light-theme .product-summary-metrics-grid > div:nth-child(1),
body.light-theme .stock-card-metrics-grid > div:nth-child(1),
body.light-theme .metric-pill-in {
    background: #ffffff !important;
    border: 1.5px solid #86efac !important;
    box-shadow: 0 1px 4px rgba(22, 101, 52, 0.08) !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(1) > div,
body.light-theme .stock-card-metrics-grid > div:nth-child(1) > div,
body.light-theme .metric-pill-in > div {
    color: #15803d !important;
    font-weight: 800 !important;
    font-size: 11px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(1) > strong,
body.light-theme .stock-card-metrics-grid > div:nth-child(1) > strong,
body.light-theme .metric-pill-in > strong {
    color: #166534 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(1) > span,
body.light-theme .stock-card-metrics-grid > div:nth-child(1) > span,
body.light-theme .metric-pill-in > span {
    color: #15803d !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    opacity: 0.95 !important;
}

body.light-theme .product-summary-metrics-grid > div:nth-child(2),
body.light-theme .stock-card-metrics-grid > div:nth-child(2),
body.light-theme .metric-pill-out {
    background: #ffffff !important;
    border: 1.5px solid #fca5a5 !important;
    box-shadow: 0 1px 4px rgba(190, 18, 60, 0.08) !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(2) > div,
body.light-theme .stock-card-metrics-grid > div:nth-child(2) > div,
body.light-theme .metric-pill-out > div {
    color: #be123c !important;
    font-weight: 800 !important;
    font-size: 11px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(2) > strong,
body.light-theme .stock-card-metrics-grid > div:nth-child(2) > strong,
body.light-theme .metric-pill-out > strong {
    color: #9f1239 !important;
    font-weight: 900 !important;
    font-size: 15px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(2) > span,
body.light-theme .stock-card-metrics-grid > div:nth-child(2) > span,
body.light-theme .metric-pill-out > span {
    color: #be123c !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    opacity: 0.95 !important;
}

body.light-theme .product-summary-metrics-grid > div:nth-child(3),
body.light-theme .stock-card-metrics-grid > div:nth-child(3),
body.light-theme .metric-pill-net {
    background: #ffffff !important;
    border: 1.5px solid #7dd3fc !important;
    box-shadow: 0 1px 4px rgba(3, 105, 161, 0.08) !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(3) > div,
body.light-theme .stock-card-metrics-grid > div:nth-child(3) > div,
body.light-theme .metric-pill-net > div {
    color: #0369a1 !important;
    font-weight: 800 !important;
    font-size: 11px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(3) > strong,
body.light-theme .stock-card-metrics-grid > div:nth-child(3) > strong,
body.light-theme .metric-pill-net > strong {
    font-weight: 900 !important;
    font-size: 15px !important;
}
body.light-theme .product-summary-metrics-grid > div:nth-child(3) > span,
body.light-theme .stock-card-metrics-grid > div:nth-child(3) > span,
body.light-theme .metric-pill-net > span {
    color: #0369a1 !important;
    font-weight: 700 !important;
    font-size: 10px !important;
    opacity: 0.95 !important;
}

/* History Cards, Lists & Buttons in Light Mode */
body.light-theme .card-glass {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}
body.light-theme .card-glass h3,
body.light-theme .card-glass h4 {
    color: #0f172a !important;
    font-weight: 800 !important;
}
body.light-theme .history-filter-drawer,
.history-filter-drawer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 10px 0 0 0 !important;
}
body.light-theme .history-filter-drawer label,
.history-filter-drawer label {
    color: #475569 !important;
    font-weight: 700 !important;
}

body.light-theme .stock-card-info-grid {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
}
body.light-theme .stock-card-info-grid strong {
    color: #0f172a !important;
    font-weight: 800 !important;
}
body.light-theme .stock-card-info-grid code {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    font-weight: 800 !important;
    border: 1px solid #bae6fd !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

body.light-theme .history-view-switcher {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}
body.light-theme .history-view-switcher__button {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}
body.light-theme .history-view-switcher__button.btn-accent {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .date-chip {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
    font-weight: 700 !important;
}
body.light-theme .date-chip.active {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

body.light-theme .table thead th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    border-bottom: 2px solid #cbd5e1 !important;
}
body.light-theme .table tbody tr:nth-child(even) {
    background: #f8fafc !important;
}
body.light-theme .table tbody tr:hover {
    background: #e2e8f0 !important;
}
body.light-theme .table tbody td {
    color: #0f172a !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-theme .recent-tx-item {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}
body.light-theme .recent-tx-item:hover {
    background: #edf2f7 !important;
}

/* ==========================================================================
   LINEAR / APPLE MINIMALIST HIGH-END FEED CARDS SYSTEM
   ========================================================================== */
.feed-cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin-top: 12px;
}

.feed-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.feed-card:hover {
    border-color: var(--color-blue);
    background: rgba(30, 41, 59, 0.7);
}

body.light-theme .feed-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body.light-theme .feed-card:hover {
    border-color: #0284c7;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.feed-card-status-strip {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.feed-card-status-strip.strip-green { background: #10b981; }
.feed-card-status-strip.strip-blue { background: #0284c7; }
.feed-card-status-strip.strip-orange { background: #f59e0b; }
.feed-card-status-strip.strip-red { background: #f43f5e; }
.feed-card-status-strip.strip-purple { background: #a855f7; }

.feed-card-media {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.feed-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feed-card-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.feed-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.3;
}

body.light-theme .feed-card-title {
    color: #0f172a;
}

.feed-card-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.feed-card-metrics {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    text-align: right;
}

.feed-card-metric-pill {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.feed-card-metric-val {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.feed-card-metric-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.feed-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.feed-view-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

body.light-theme .feed-view-toggle {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.feed-view-toggle-btn {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
}

.feed-view-toggle-btn.active {
    background: var(--color-blue);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
}

body.light-theme .feed-view-toggle-btn.active {
    background: #0284c7;
    color: #ffffff;
}

@media (max-width: 768px) {
    .feed-card {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px 12px;
    }
    .feed-card-metrics {
        width: 100%;
        justify-content: space-between;
        border-top: 1px dashed var(--border-color);
        padding-top: 8px;
        margin-top: 4px;
    }
    .feed-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ==========================================================================
   MODERN BORDERLESS TABLES & MICRO PROGRESS BARS
   ========================================================================== */
.table.borderless-table,
.card-glass .table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: none !important;
    width: 100% !important;
}

.table.borderless-table thead th,
.card-glass .table thead th {
    background: transparent !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 2px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    padding: 10px 8px !important;
}

.table.borderless-table tbody td,
.card-glass .table tbody td {
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color-subtle) !important;
    padding: 11px 8px !important;
    font-size: 12.5px !important;
    vertical-align: middle !important;
    transition: background 0.12s ease;
}

.table.borderless-table tbody tr:hover td,
.card-glass .table tbody tr:hover td {
    background: rgba(56, 189, 248, 0.04) !important;
}

body.light-theme .card-glass .table thead th {
    color: #475569 !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

body.light-theme .card-glass .table tbody td {
    color: #0f172a !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme .card-glass .table tbody tr:hover td {
    background: #f8fafc !important;
}

.micro-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
}

body.light-theme .micro-progress-bar {
    background: #e2e8f0;
}

.micro-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* ==========================================================================
   ULTRA-CLEAN FLAT CANVAS & DE-NESTING (APPLE / STRIPE MINIMALIST)
   Eliminate nested boxes inside boxes (กล่องซ้อนกล่อง) with generous whitespace
   ========================================================================== */

/* 1. Flatten nested container boxes */
.card-glass .table-responsive,
.dashboard-card .table-responsive,
.card-glass > .table-responsive[style*="border"],
div.table-responsive[style*="border"] {
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 2. De-nest multiple card-glass wrappers inside card-glass */
.card-glass .card-glass,
.dashboard-card .card-glass,
.card-glass .dashboard-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* 3. Floating Key Numbers (Metric Cards) — Clean & Open */
.metrics-grid .metric-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color-subtle) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    padding: 18px 20px !important;
    transition: transform 0.15s ease, border-color 0.15s ease !important;
}

.metrics-grid .metric-card:hover {
    border-color: var(--color-blue) !important;
    transform: translateY(-2px);
}

body.light-theme .metrics-grid .metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

body.light-theme .metrics-grid .metric-card:hover {
    border-color: #0284c7 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
}

/* 4. Flatten Section 7 ABC Analysis Boxes & Sub-blocks */
.mobile-stack > div[style*="border"] {
    border: 1px solid var(--border-color-subtle) !important;
    border-radius: 12px !important;
    box-shadow: none !important;
}

body.light-theme .mobile-stack > div[style*="border"] {
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}

/* 5. Clean Single-Surface Primary Cards */
.card-glass {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color-subtle) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
}

body.light-theme .card-glass {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02) !important;
}

/* 6. Clean Single-Surface Modals & Remove Nested Boxed Sections */
.modal-card {
    border: 1px solid var(--border-color-subtle) !important;
    border-radius: 18px !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
}

body.light-theme .modal-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12) !important;
}

.modal-body > div[style*="border"]:not(.feed-card):not(.alert) {
    border: none !important;
    background: transparent !important;
}

/* 7. Clean Form Inputs without boxed shadows */
.input-text,
select.input-text {
    border: 1px solid var(--border-color-subtle) !important;
    border-radius: 8px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    transition: border-color 0.15s ease !important;
}

.input-text:focus,
select.input-text:focus {
    border-color: var(--color-blue) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15) !important;
    outline: none !important;
}

body.light-theme .input-text,
body.light-theme select.input-text {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-theme .input-text:focus,
body.light-theme select.input-text:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}







/* ==========================================================================
   VIBRANT, CRYSTAL-CLEAR STATUS BADGES & NOTIFICATIONS
   ========================================================================== */

/* Green Badges: Success / Inbound / Approved / Healthy */
.status-badge.success,
.badge-fresh,
.badge-approved,
.badge-dispatched,
.badge[style*="rgba(16, 185, 129"],
.badge[style*="rgba(63, 185, 80"],
.status-badge[style*="success"] {
    background: rgba(16, 185, 129, 0.16) !important;
    color: #059669 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
    font-weight: 800 !important;
    text-shadow: none !important;
}

body:not(.light-theme) .status-badge.success,
body:not(.light-theme) .badge-fresh,
body:not(.light-theme) .badge-approved,
body:not(.light-theme) .badge-dispatched,
body:not(.light-theme) .badge[style*="rgba(16, 185, 129"],
body:not(.light-theme) .badge[style*="rgba(63, 185, 80"] {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #34d399 !important;
    border-color: rgba(52, 211, 153, 0.45) !important;
}

/* Red Badges: Error / Out of Stock / Rejected / Alert */
.status-badge.danger,
.status-badge.error,
.badge-rejected,
.badge-out-of-stock,
.badge[style*="rgba(239, 68, 68"],
.badge[style*="rgba(244, 63, 94"],
.badge[style*="rgba(248, 81, 73"],
.status-badge[style*="error"] {
    background: rgba(244, 63, 94, 0.16) !important;
    color: #e11d48 !important;
    border: 1px solid rgba(244, 63, 94, 0.35) !important;
    font-weight: 800 !important;
    text-shadow: none !important;
}

body:not(.light-theme) .status-badge.danger,
body:not(.light-theme) .status-badge.error,
body:not(.light-theme) .badge-rejected,
body:not(.light-theme) .badge-out-of-stock,
body:not(.light-theme) .badge[style*="rgba(239, 68, 68"],
body:not(.light-theme) .badge[style*="rgba(244, 63, 94"],
body:not(.light-theme) .badge[style*="rgba(248, 81, 73"] {
    background: rgba(244, 63, 94, 0.22) !important;
    color: #fb7185 !important;
    border-color: rgba(251, 113, 133, 0.45) !important;
}

/* Orange / Amber Badges: Warning / Low Stock / Pending */
.status-badge.warning,
.badge-dry,
.badge-pending,
.badge-low-stock,
.badge[style*="rgba(255, 152, 0"],
.badge[style*="rgba(245, 158, 11"],
.status-badge[style*="warning"] {
    background: rgba(245, 158, 11, 0.16) !important;
    color: #d97706 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    font-weight: 800 !important;
    text-shadow: none !important;
}

body:not(.light-theme) .status-badge.warning,
body:not(.light-theme) .badge-dry,
body:not(.light-theme) .badge-pending,
body:not(.light-theme) .badge-low-stock,
body:not(.light-theme) .badge[style*="rgba(255, 152, 0"],
body:not(.light-theme) .badge[style*="rgba(245, 158, 11"] {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.45) !important;
}

/* Blue Badges: Info / General / SKU Code */
.status-badge.info,
.badge-beverage,
.badge-inbound,
.badge[style*="rgba(56, 189, 248"],
.badge[style*="rgba(56, 139, 253"],
.status-badge[style*="info"] {
    background: rgba(2, 132, 199, 0.14) !important;
    color: #0284c7 !important;
    border: 1px solid rgba(2, 132, 199, 0.30) !important;
    font-weight: 800 !important;
}

body:not(.light-theme) .status-badge.info,
body:not(.light-theme) .badge-beverage,
body:not(.light-theme) .badge-inbound,
body:not(.light-theme) .badge[style*="rgba(56, 189, 248"],
body:not(.light-theme) .badge[style*="rgba(56, 139, 253"] {
    background: rgba(56, 189, 248, 0.20) !important;
    color: #38bdf8 !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
}

/* Purple Badges: Catch-Weight / Specialty */
.badge-catch-weight,
.badge-specialty,
.badge[style*="rgba(147, 51, 234"],
.badge[style*="rgba(168, 85, 247"] {
    background: rgba(147, 51, 234, 0.14) !important;
    color: #7e22ce !important;
    border: 1px solid rgba(147, 51, 234, 0.30) !important;
    font-weight: 800 !important;
}

body:not(.light-theme) .badge-catch-weight,
body:not(.light-theme) .badge-specialty,
body:not(.light-theme) .badge[style*="rgba(147, 51, 234"],
body:not(.light-theme) .badge[style*="rgba(168, 85, 247"] {
    background: rgba(168, 85, 247, 0.20) !important;
    color: #c084fc !important;
    border-color: rgba(192, 132, 252, 0.45) !important;
}

/* Vibrant Toasts */
.toast.success {
    background: #064e3b !important;
    border: 1px solid #10b981 !important;
    border-left: 5px solid #10b981 !important;
    color: #ecfdf5 !important;
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3) !important;
    font-weight: 700 !important;
}

.toast.error,
.toast.danger {
    background: #881337 !important;
    border: 1px solid #f43f5e !important;
    border-left: 5px solid #f43f5e !important;
    color: #fff1f2 !important;
    box-shadow: 0 10px 25px rgba(244, 63, 94, 0.3) !important;
    font-weight: 700 !important;
}

.toast.warning {
    background: #78350f !important;
    border: 1px solid #f59e0b !important;
    border-left: 5px solid #f59e0b !important;
    color: #fffbeb !important;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3) !important;
    font-weight: 700 !important;
}

.toast.info {
    background: #0c4a6e !important;
    border: 1px solid #0ea5e9 !important;
    border-left: 5px solid #0ea5e9 !important;
    color: #f0f9ff !important;
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3) !important;
    font-weight: 700 !important;
}

body.light-theme .toast.success {
    background: #ffffff !important;
    border: 1px solid #10b981 !important;
    border-left: 5px solid #10b981 !important;
    color: #065f46 !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.18) !important;
}

body.light-theme .toast.error,
body.light-theme .toast.danger {
    background: #ffffff !important;
    border: 1px solid #f43f5e !important;
    border-left: 5px solid #f43f5e !important;
    color: #9f1239 !important;
    box-shadow: 0 8px 24px rgba(244, 63, 94, 0.18) !important;
}

body.light-theme .toast.warning {
    background: #ffffff !important;
    border: 1px solid #f59e0b !important;
    border-left: 5px solid #f59e0b !important;
    color: #92400e !important;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.18) !important;
}

body.light-theme .toast.info {
    background: #ffffff !important;
    border: 1px solid #0ea5e9 !important;
    border-left: 5px solid #0ea5e9 !important;
    color: #0369a1 !important;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.18) !important;
}

/* Stocktake Review Modal Global Overlay Guarantee */
.modal-overlay.stocktake-review-overlay,
body > .modal-overlay.stocktake-review-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    background: rgba(0, 0, 0, 0.72) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    padding: 16px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.stocktake-review-modal-card {
    margin: auto !important;
    max-width: min(720px, calc(100vw - 32px)) !important;
    width: min(720px, calc(100vw - 32px)) !important;
    box-sizing: border-box !important;
    border-radius: 16px !important;
    box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6) !important;
}

body.light-theme .stocktake-review-modal-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.2) !important;
}

/* ==========================================================================
   📐 MASTER SPACING & GEOMETRY HARMONIZATION (ALL PAGES - TOP/BOTTOM/LEFT/RIGHT)
   ========================================================================== */

/* 1. Main Content Viewport Padding & Maximum Width Flow */
.main-content {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    padding: 22px 28px 48px !important;
}

@media (max-width: 1024px) {
    .main-content {
        padding: 18px 20px 40px !important;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 14px 14px calc(88px + env(safe-area-inset-bottom, 16px)) !important;
    }
}

/* 2. Unified Page Panel Layout & Section Flow */
.page-panel {
    width: 100% !important;
    box-sizing: border-box !important;
}

.page-panel > * + * {
    margin-top: 18px !important;
}

/* 3. Panel Header Spacing & Layout Rhythm */
.panel-header,
.settings-unified-container .panel-header,
.operations-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
    padding-bottom: 16px !important;
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08)) !important;
}

.panel-header h2 {
    font-size: 21px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.panel-header p {
    font-size: 13px !important;
    line-height: 1.45 !important;
    margin: 4px 0 0 0 !important;
    color: var(--text-muted, #94a3b8) !important;
}

/* 4. Glass Cards, Dashboard Cards & Containers Spacing */
.card-glass,
.dashboard-card,
.workflow-scan-panel,
.workflow-form-panel,
.settings-section-card,
.operations-report-card,
.operations-user-card,
.operations-progress-card {
    box-sizing: border-box !important;
    padding: 20px 22px !important;
    border-radius: 14px !important;
    margin-bottom: 18px !important;
}

@media (max-width: 768px) {
    .card-glass,
    .dashboard-card,
    .workflow-scan-panel,
    .workflow-form-panel,
    .settings-section-card,
    .operations-report-card,
    .operations-user-card,
    .operations-progress-card {
        padding: 15px 16px !important;
        border-radius: 12px !important;
        margin-bottom: 14px !important;
    }
}

/* 5. Metrics & Stat Grids Spacing */
.metrics-grid,
.dashboard-metrics,
.kpi-grid,
.operations-metrics {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    gap: 14px 18px !important;
    margin-bottom: 20px !important;
}

@media (max-width: 640px) {
    .metrics-grid,
    .dashboard-metrics,
    .kpi-grid,
    .operations-metrics {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px 12px !important;
        margin-bottom: 16px !important;
    }
}

/* 6. Form Field Spacing, Inputs, and Labels */
.form-group,
.operations-form label,
.settings-section-card .form-group {
    margin-bottom: 16px !important;
}

.input-text,
.input-select,
.input-number,
.settings-input-flex,
select.input-select,
input[type="text"].input-text,
input[type="number"].input-text,
input[type="password"].input-text {
    height: 42px !important;
    padding: 0 14px !important;
    font-size: 13px !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
}

textarea.input-text {
    padding: 10px 14px !important;
    font-size: 13px !important;
    border-radius: 9px !important;
    box-sizing: border-box !important;
}

/* 7. Tables, Table Rows, and Cell Spacing */
.table-responsive,
.wms-scrollable {
    margin-top: 14px !important;
    margin-bottom: 14px !important;
    border-radius: 10px !important;
    box-sizing: border-box !important;
}

.table th {
    padding: 13px 16px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    vertical-align: middle !important;
}

.table td {
    padding: 13px 16px !important;
    font-size: 13px !important;
    vertical-align: middle !important;
    line-height: 1.45 !important;
}

@media (max-width: 768px) {
    .table th,
    .table td {
        padding: 10px 12px !important;
    }
}

/* 8. Tabs, Pill Switches, and Action Button Spacing */
.operations-tabs,
.settings-nav-tabs,
.requisitions-filter-tabs {
    display: flex !important;
    gap: 8px !important;
    padding: 4px !important;
    margin-bottom: 20px !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.operations-tabs button,
.settings-nav-tabs button,
.requisitions-filter-tabs button {
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* 9. Search Boxes & Filter Bars */
.search-box {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    min-width: 200px !important;
    max-width: 260px !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

body .search-box > i,
.search-box > i {
    position: absolute !important;
    left: 13px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #64748b !important;
    font-size: 13px !important;
    pointer-events: none !important;
    z-index: 10 !important;
    margin: 0 !important;
}

body.light-theme .search-box > i {
    color: #64748b !important;
}

body .search-box input,
body .search-box input[type="text"],
body.light-theme .search-box input,
body.light-theme .search-box input[type="text"],
.search-box input {
    width: 100% !important;
    height: 36px !important;
    padding-left: 38px !important;
    padding-right: 28px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    border-radius: 20px !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    box-sizing: border-box !important;
}

body:not(.light-theme) .search-box input,
body:not(.light-theme) .search-box input[type="text"] {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
}

body:not(.light-theme) .search-box input:focus,
body:not(.light-theme) .search-box input[type="text"]:focus {
    border-color: var(--color-blue, #38bdf8) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

body.light-theme .search-box input,
body.light-theme .search-box input[type="text"] {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
}

body.light-theme .search-box input:focus,
body.light-theme .search-box input[type="text"]:focus {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

.search-box .search-clear-btn {
    position: absolute !important;
    right: 8px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-muted, #94a3b8) !important;
    cursor: pointer !important;
    font-size: 12px !important;
    padding: 4px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

/* History Search Main Row Pill Styling */
.history-search-main-row .search-box,
body .history-search-main-row .search-box {
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 !important;
}

body .history-search-main-row .search-box input,
body.light-theme .history-search-main-row .search-box input {
    height: 40px !important;
    border-radius: 20px !important;
    padding-left: 38px !important;
    padding-right: 32px !important;
    font-size: 13px !important;
}

.history-search-main-row .btn-secondary,
.history-search-main-row .btn-accent {
    height: 40px !important;
    border-radius: 20px !important;
}

body.light-theme .history-filter-drawer .input-select,
body.light-theme .history-filter-drawer .input-text,
.history-filter-drawer .input-select,
.history-filter-drawer .input-text,
.history-filter-drawer select,
.history-filter-drawer input[type="date"] {
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    height: 38px !important;
    font-size: 12.5px !important;
    color: #0f172a !important;
    padding: 6px 12px !important;
    box-shadow: none !important;
}

body:not(.light-theme) .history-filter-drawer .input-select,
body:not(.light-theme) .history-filter-drawer .input-text,
body:not(.light-theme) .history-filter-drawer select,
body:not(.light-theme) .history-filter-drawer input[type="date"] {
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: rgba(255, 255, 255, 0.04) !important;
    height: 38px !important;
    font-size: 12.5px !important;
    color: #ffffff !important;
    padding: 6px 12px !important;
    box-shadow: none !important;
}

/* 10. Department Preset Switcher Buttons Grid */
.dept-preset-btn {
    padding: 12px 14px !important;
    border-radius: 11px !important;
    font-size: 12.5px !important;
    font-weight: 750 !important;
    gap: 7px !important;
}

/* =========================================================================
   INBOUND GOODS PRO 2026 (รับสินค้าเข้าคลัง ดีไซน์พรีเมียม สดใส ไม่เป็นสีเทา)
========================================================================= */

.inbound-pro-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 40px;
}

/* 1. Header & Live Metrics */
.inbound-pro-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 26px;
    border-radius: 18px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.07);
}

body:not(.light-theme) .inbound-pro-header {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.inbound-pro-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.inbound-pro-header-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
}

.inbound-pro-title {
    font-size: 21px;
    font-weight: 850;
    margin: 0;
    color: #0f172a;
    letter-spacing: -0.3px;
}

body:not(.light-theme) .inbound-pro-title {
    color: #f8fafc;
}

.inbound-badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.inbound-badge-green {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1px solid #86efac;
    color: #047857;
}

body:not(.light-theme) .inbound-badge-green {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.inbound-pro-subtitle {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
}

body:not(.light-theme) .inbound-pro-subtitle {
    color: #94a3b8;
}

.inbound-pro-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.inbound-metric-card {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 105px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

body:not(.light-theme) .inbound-metric-card {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.inbound-metric-card .metric-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 2px;
}

body:not(.light-theme) .inbound-metric-card .metric-label {
    color: #94a3b8;
}

.inbound-metric-card .metric-value {
    font-size: 14.5px;
    font-weight: 850;
}

/* Offline Queue Banner */
.inbound-offline-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1.5px solid #fde68a;
    color: #78350f;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.12);
}

body:not(.light-theme) .inbound-offline-banner {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fef3c7;
}

.inbound-offline-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* Mobile Tab Switcher */
.inbound-mobile-tab-bar {
    display: none;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    gap: 6px;
}

body:not(.light-theme) .inbound-mobile-tab-bar {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(255, 255, 255, 0.12);
}

.inbound-mobile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #475569;
    font-size: 13.5px;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.2s ease;
}

body:not(.light-theme) .inbound-mobile-tab {
    color: #94a3b8;
}

.inbound-mobile-tab.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.inbound-tab-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11.5px;
    font-weight: 850;
}

/* 2. Main 2-Column Grid Layout */
.inbound-pro-grid {
    display: grid;
    grid-template-columns: minmax(360px, 490px) 1fr;
    gap: 22px;
    align-items: start;
}

.inbound-col-scanner {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.inbound-col-queue {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 3. Scanner Card & Mode Switcher */
.inbound-card-scanner,
.inbound-card-presets,
.inbound-card-queue {
    border-radius: 18px;
    padding: 22px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.03);
}

body:not(.light-theme) .inbound-card-scanner,
body:not(.light-theme) .inbound-card-presets,
body:not(.light-theme) .inbound-card-queue {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

/* Mode Segmented Selector (Vibrant, Not Gray) */
.inbound-mode-switcher {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
    padding: 7px;
    border-radius: 14px;
    border: 1.5px solid #bfdbfe;
    margin-bottom: 18px;
}

body:not(.light-theme) .inbound-mode-switcher {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(59, 130, 246, 0.25);
}

.inbound-mode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 11px;
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

body:not(.light-theme) .inbound-mode-btn {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.inbound-mode-btn i {
    font-size: 18px;
    flex-shrink: 0;
}

.mode-btn-text strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

body:not(.light-theme) .mode-btn-text strong {
    color: #f8fafc;
}

.mode-btn-text span {
    display: block;
    font-size: 11px;
    color: #64748b;
    line-height: 1.2;
    margin-top: 2px;
}

body:not(.light-theme) .mode-btn-text span {
    color: #94a3b8;
}

.inbound-mode-btn.active {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    color: #1d4ed8;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.22);
}

body:not(.light-theme) .inbound-mode-btn.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
    color: #93c5fd;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}

.inbound-mode-btn.active.instant-glow {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    color: #b45309;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}

body:not(.light-theme) .inbound-mode-btn.active.instant-glow {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
    color: #fde68a;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

/* Tools Toolbar (Quick Register + Camera) */
.inbound-tools-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.inbound-tool-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: 11px;
    font-size: 12.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inbound-tool-register {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1.5px solid #10b981;
    color: #065f46;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.16);
}

.inbound-tool-register:hover {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

body:not(.light-theme) .inbound-tool-register {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.inbound-tool-camera {
    background: linear-gradient(135deg, #eff6ff 0%, #ede9fe 100%);
    border: 1.5px solid #6366f1;
    color: #3730a3;
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.16);
}

.inbound-tool-camera:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #ddd6fe 100%);
    border-color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

body:not(.light-theme) .inbound-tool-camera {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(147, 51, 234, 0.18));
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

/* Barcode Input Form (Vibrant Crisp White & Blue) */
.inbound-scan-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inbound-input-label {
    font-size: 12.5px;
    font-weight: 800;
    color: #334155;
}

body:not(.light-theme) .inbound-input-label {
    color: #cbd5e1;
}

.inbound-scan-box-wrapper {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #3b82f6;
    border-radius: 14px;
    padding: 6px 8px 6px 14px;
    gap: 12px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.14);
    transition: all 0.2s ease;
}

body:not(.light-theme) .inbound-scan-box-wrapper {
    background: rgba(15, 23, 42, 0.7);
    border-color: #3b82f6;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.25);
}

.inbound-scan-box-wrapper:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.inbound-scan-icon {
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2563eb;
    flex-shrink: 0;
}

body:not(.light-theme) .inbound-scan-icon {
    color: #60a5fa;
}

.inbound-scan-input,
#root .inbound-scan-box-wrapper input.inbound-scan-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #0f172a !important;
    font-size: 15px;
    font-weight: 700;
    padding: 8px 4px !important;
    min-width: 0;
    margin: 0 !important;
}

body:not(.light-theme) .inbound-scan-input,
body:not(.light-theme) #root .inbound-scan-box-wrapper input.inbound-scan-input {
    color: #ffffff !important;
}

.inbound-scan-input::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.inbound-scan-clear-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 15px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
}

.inbound-scan-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.inbound-scan-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 850;
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    margin-left: 4px;
    transition: all 0.2s ease;
}

.inbound-scan-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
    transform: translateY(-1px);
}

/* Live Last Scan Feedback Card */
.inbound-last-scan-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 13px;
    margin-top: 14px;
    animation: inboundFadeSlide 0.25s ease-out;
}

@keyframes inboundFadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.inbound-last-scan-card.scan-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 1.5px solid #86efac;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.1);
}

body:not(.light-theme) .inbound-last-scan-card.scan-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.inbound-last-scan-card.scan-warning {
    background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
    border: 1.5px solid #fca5a5;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.1);
}

body:not(.light-theme) .inbound-last-scan-card.scan-warning {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.last-scan-media {
    width: 46px;
    height: 46px;
    border-radius: 9px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.last-scan-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.last-scan-content {
    flex: 1;
    min-width: 0;
}

.last-scan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 2px;
}

.last-scan-header strong {
    color: #059669;
    font-weight: 800;
}

.scan-warning .last-scan-header strong {
    color: #dc2626;
    font-weight: 800;
}

.last-scan-time {
    font-size: 10.5px;
    color: #64748b;
}

.last-scan-name {
    margin: 0 0 4px 0;
    font-size: 13.5px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.light-theme) .last-scan-name {
    color: #f8fafc;
}

.last-scan-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scan-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-weight: 700;
}

body:not(.light-theme) .scan-pill {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.12);
}

.scan-pill-loc {
    color: #0369a1;
    background: #e0f2fe;
    border-color: #bae6fd;
}

body:not(.light-theme) .scan-pill-loc {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

/* 4. Storage Presets & Lot Config Card */
.inbound-presets-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.inbound-presets-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

body:not(.light-theme) .inbound-presets-header h4 {
    color: #f8fafc;
}

.inbound-presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.inbound-preset-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inbound-preset-field label {
    font-size: 11.5px;
    font-weight: 750;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

body:not(.light-theme) .inbound-preset-field label {
    color: #cbd5e1;
}

.inbound-preset-select,
.inbound-preset-input {
    width: 100% !important;
    height: 42px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    padding: 8px 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
    transition: all 0.2s ease !important;
}

body:not(.light-theme) .inbound-preset-select,
body:not(.light-theme) .inbound-preset-input {
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #f8fafc !important;
}

.inbound-preset-select:focus,
.inbound-preset-input:focus {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
}

/* 5. Right Column: Queue & Batch Card */
.inbound-card-queue {
    display: flex;
    flex-direction: column;
    min-height: 540px;
}

.inbound-queue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1.5px solid #e2e8f0;
    margin-bottom: 16px;
}

body:not(.light-theme) .inbound-queue-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.inbound-queue-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inbound-queue-icon-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border: 1.5px solid #86efac;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #059669;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.15);
}

body:not(.light-theme) .inbound-queue-icon-badge {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.inbound-queue-title {
    margin: 0;
    font-size: 16.5px;
    font-weight: 850;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

body:not(.light-theme) .inbound-queue-title {
    color: #f8fafc;
}

.inbound-queue-count-badge {
    font-size: 12px;
    font-weight: 800;
    background: #dcfce7;
    color: #047857;
    padding: 2px 9px;
    border-radius: 12px;
    border: 1px solid #86efac;
}

body:not(.light-theme) .inbound-queue-count-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
}

.inbound-queue-desc {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: #64748b;
}

body:not(.light-theme) .inbound-queue-desc {
    color: #94a3b8;
}

.inbound-clear-all-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    color: #dc2626;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inbound-clear-all-btn:hover {
    background: #fecaca;
    color: #b91c1c;
}

body:not(.light-theme) .inbound-clear-all-btn {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Queue Scroll List Container */
.inbound-queue-scroll-container {
    flex-grow: 1;
    overflow-y: auto;
    max-height: 520px;
    min-height: 240px;
    padding-right: 4px;
}

.inbound-queue-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.inbound-queue-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

body:not(.light-theme) .inbound-queue-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/* Empty State (Vibrant Sky & Mint, Not Dull Gray) */
.inbound-empty-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 24px;
    border: 2px dashed #93c5fd;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    box-shadow: inset 0 2px 8px rgba(59, 130, 246, 0.04);
}

body:not(.light-theme) .inbound-empty-state-box {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(59, 130, 246, 0.3);
}

.inbound-empty-state-box .empty-icon-circle {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #dcfce7 100%);
    border: 2px solid #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #2563eb;
    margin-bottom: 16px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.18);
}

body:not(.light-theme) .inbound-empty-state-box .empty-icon-circle {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    color: #60a5fa;
}

.inbound-empty-state-box h4 {
    font-size: 16px;
    font-weight: 850;
    color: #0f172a;
    margin: 0 0 6px 0;
}

body:not(.light-theme) .inbound-empty-state-box h4 {
    color: #f8fafc;
}

.inbound-empty-state-box p {
    font-size: 13px;
    color: #475569;
    max-width: 380px;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

body:not(.light-theme) .inbound-empty-state-box p {
    color: #94a3b8;
}

.inbound-empty-actions {
    display: flex;
    gap: 12px;
}

.inbound-empty-actions button {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 10px;
    font-size: 12.5px;
    font-weight: 800;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.15s ease;
}

.inbound-empty-actions button:hover {
    border-color: #3b82f6;
    color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

body:not(.light-theme) .inbound-empty-actions button {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

/* Inbound Item Card */
.inbound-item-cards-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inbound-item-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

body:not(.light-theme) .inbound-item-card {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.09);
}

.inbound-item-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.12);
}

.inbound-card-media-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.inbound-item-index {
    font-size: 11.5px;
    font-weight: 850;
    color: #64748b;
    min-width: 22px;
}

.inbound-item-image-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 22px;
}

body:not(.light-theme) .inbound-item-image-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}

.inbound-item-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inbound-card-info-col {
    flex: 1;
    min-width: 0;
}

.inbound-item-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.inbound-sku-pill {
    font-family: monospace;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #1e293b;
}

body:not(.light-theme) .inbound-sku-pill {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

.inbound-barcode-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

body:not(.light-theme) .inbound-barcode-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.3);
}

.inbound-loc-pill {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

body:not(.light-theme) .inbound-loc-pill {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.inbound-item-name {
    margin: 2px 0 4px 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.light-theme) .inbound-item-name {
    color: #f8fafc;
}

.inbound-item-calculation {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.calc-uom {
    color: #64748b;
}

.calc-uom strong {
    color: #0f172a;
}

body:not(.light-theme) .calc-uom strong {
    color: #f8fafc;
}

.calc-multiplier {
    font-weight: 800;
    color: #059669;
}

.calc-extra {
    color: #64748b;
    font-weight: 600;
}

/* Steppers & Quantity Adjusters */
.inbound-card-actions-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.inbound-stepper-container {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

body:not(.light-theme) .inbound-stepper-container {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12);
}

.inbound-stepper-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #ffffff;
    color: #0f172a;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

body:not(.light-theme) .inbound-stepper-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #f8fafc;
}

.inbound-stepper-btn:hover {
    background: #3b82f6;
    color: #ffffff;
}

.inbound-stepper-input {
    width: 52px !important;
    height: 36px !important;
    text-align: center !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    color: #0f172a !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
}

body:not(.light-theme) .inbound-stepper-input {
    color: #ffffff !important;
}

.inbound-quick-chips {
    display: flex;
    gap: 4px;
}

.quick-chip-btn {
    padding: 3px 8px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 800;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip-btn:hover {
    background: #3b82f6;
    border-color: #2563eb;
    color: #ffffff;
    transform: translateY(-1px);
}

body:not(.light-theme) .quick-chip-btn {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
    color: #93c5fd;
}

.inbound-card-delete-btn {
    background: transparent;
    border: none;
    color: #dc2626;
    font-size: 16px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.inbound-card-delete-btn:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: scale(1.1);
}

/* 6. Sticky Batch Submit Footer */
.inbound-queue-footer-card {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1.5px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

body:not(.light-theme) .inbound-queue-footer-card {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.inbound-summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 18px;
    border-radius: 13px;
    background: linear-gradient(135deg, #ecfdf5 0%, #eff6ff 100%);
    border: 1.5px solid #a7f3d0;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.1);
}

body:not(.light-theme) .inbound-summary-bar {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.25);
}

.summary-text-block .summary-label {
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    color: #065f46;
}

body:not(.light-theme) .summary-text-block .summary-label {
    color: #f8fafc;
}

.summary-text-block .summary-sub {
    display: block;
    font-size: 11px;
    color: #059669;
    font-weight: 600;
}

body:not(.light-theme) .summary-text-block .summary-sub {
    color: #94a3b8;
}

.summary-total-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    color: #059669;
}

body:not(.light-theme) .summary-total-badge {
    color: #34d399;
}

.inbound-batch-submit-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    font-size: 15px;
    font-weight: 850;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.inbound-batch-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    transform: translateY(-2px);
}

.inbound-batch-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS (PC / iPad / Mobile)
========================================================================= */

/* iPad & Tablet Viewport (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .inbound-pro-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .inbound-stepper-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 14px !important;
    }
    
    .inbound-stepper-input {
        width: 60px !important;
        height: 44px !important;
        font-size: 15px !important;
    }
    
    .quick-chip-btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
    }
    
    .inbound-tool-btn {
        padding: 12px 16px !important;
        font-size: 13px !important;
    }
}

/* Mobile Viewport (< 768px) */
@media (max-width: 767.98px) {
    .inbound-pro-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 14px;
    }
    
    .inbound-pro-metrics {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }
    
    .inbound-metric-card {
        padding: 6px 8px;
        min-width: 0;
        align-items: center;
        text-align: center;
    }
    
    .inbound-metric-card .metric-label {
        font-size: 10px;
    }
    
    .inbound-metric-card .metric-value {
        font-size: 12.5px;
    }

    .inbound-mobile-tab-bar {
        display: flex;
    }
    
    .inbound-pro-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .mobile-hide {
        display: none !important;
    }
    
    .mobile-show {
        display: flex !important;
    }

    .inbound-presets-grid {
        grid-template-columns: 1fr;
    }

    .inbound-mode-switcher {
        grid-template-columns: 1fr;
    }

    .inbound-tools-toolbar {
        flex-direction: column;
    }

    .inbound-item-card {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        position: relative;
    }

    .inbound-card-media-col {
        width: 100%;
    }

    .inbound-card-actions-col {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        border-top: 1.5px solid #e2e8f0;
        padding-top: 8px;
    }

    .inbound-card-delete-btn {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .inbound-stepper-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        font-size: 16px !important;
    }

    .inbound-stepper-input {
        width: 60px !important;
        height: 44px !important;
        font-size: 16px !important;
    }

    .quick-chip-btn {
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
}

/* =========================================================================
   LOGIN SCREEN ULTRA-READABILITY (อ่านง่าย คมชัด ทั้งโหมดมืดและสว่าง)
========================================================================= */

.central-login-screen {
    box-sizing: border-box;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 28px 18px;
    background: #f8fafc;
}

body:not(.light-theme) .central-login-screen {
    background: #0f172a;
}

.central-login-card {
    box-sizing: border-box;
    width: min(100%, 510px);
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

body:not(.light-theme) .central-login-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

/* Brand Header */
.central-login-brand {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 20px 24px !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 55%, #0284c7 100%) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15) !important;
}

body:not(.light-theme) .central-login-brand {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 2px solid rgba(255, 255, 255, 0.12) !important;
}

.central-login-brand img {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    padding: 6px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    object-fit: contain !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    flex-shrink: 0 !important;
}

.central-login-brand span,
.central-login-brand .brand-org-name,
#root .central-login-screen .central-login-brand span {
    display: block !important;
    font-family: 'Outfit', 'Sarabun', sans-serif !important;
    font-size: 12px !important;
    font-weight: 850 !important;
    letter-spacing: 0.08em !important;
    color: #fbbf24 !important;
    opacity: 1 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    margin-bottom: 2px !important;
    text-transform: uppercase !important;
}

body:not(.light-theme) .central-login-brand span,
body:not(.light-theme) .central-login-brand .brand-org-name,
body:not(.light-theme) #root .central-login-screen .central-login-brand span {
    color: #fbbf24 !important;
}

.central-login-brand strong,
.central-login-brand .brand-site-title,
#root .central-login-screen .central-login-brand strong {
    display: block !important;
    margin-top: 2px !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    color: #ffffff !important;
    letter-spacing: -0.01em !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35) !important;
}

/* Heading & Subtitle */
.central-login-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 24px 24px 16px;
}

.central-login-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    flex-shrink: 0;
}

.central-login-heading h1 {
    margin: 0;
    color: #0f172a !important;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.25;
}

body:not(.light-theme) .central-login-heading h1 {
    color: #ffffff !important;
}

.central-login-heading p {
    margin: 5px 0 0;
    color: #334155 !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
}

body:not(.light-theme) .central-login-heading p {
    color: #cbd5e1 !important;
}

/* 3-Step Pills Bar */
.central-login-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 24px 20px;
    padding: 11px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    color: #0f172a;
    background: #f1f5f9;
    font-size: 12px;
    font-weight: 800;
}

body:not(.light-theme) .central-login-steps {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
    color: #f8fafc;
}

.central-login-steps span {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.central-login-steps b {
    display: inline-grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: #2563eb;
    font-size: 11px;
    font-weight: 850;
}

body:not(.light-theme) .central-login-steps b {
    background: #3b82f6;
}

.central-login-steps i {
    font-size: 11px;
    color: #2563eb;
    opacity: 0.8;
}

body:not(.light-theme) .central-login-steps i {
    color: #60a5fa;
}

/* Login Form & Inputs */
.central-login-form {
    display: grid;
    gap: 10px;
    padding: 0 24px 24px;
}

.central-login-form > label {
    margin-top: 4px;
    color: #0f172a !important;
    font-size: 13px;
    font-weight: 850;
}

body:not(.light-theme) .central-login-form > label {
    color: #f8fafc !important;
}

.central-login-input {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    box-sizing: border-box;
    padding: 0 14px;
    border: 2px solid #cbd5e1 !important;
    border-radius: 11px;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

body:not(.light-theme) .central-login-input {
    background: rgba(15, 23, 42, 0.7) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow: none;
}

.central-login-input:focus-within {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18) !important;
}

body:not(.light-theme) .central-login-input:focus-within {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.25) !important;
}

.central-login-input > i {
    color: #2563eb;
    font-size: 16px;
}

body:not(.light-theme) .central-login-input > i {
    color: #60a5fa;
}

.central-login-input input,
#root .central-login-form .central-login-input > input {
    width: 100%;
    min-width: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
    background: transparent !important;
    font-size: 15px;
    font-weight: 700;
    padding: 0 !important;
}

body:not(.light-theme) .central-login-input input,
body:not(.light-theme) #root .central-login-form .central-login-input > input {
    color: #ffffff !important;
}

.central-login-input input::placeholder {
    color: #64748b;
    font-weight: 500;
    opacity: 1;
}

body:not(.light-theme) .central-login-input input::placeholder {
    color: #94a3b8;
}

/* Remember Device Box */
.central-login-form > div:has(> #central-login-remember) {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4 !important;
    border: 1.5px solid #86efac !important;
    border-radius: 11px;
    padding: 10px 14px;
    margin: 4px 0 10px 0;
}

body:not(.light-theme) .central-login-form > div:has(> #central-login-remember) {
    background: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.central-login-form > div:has(> #central-login-remember) label {
    color: #065f46 !important;
    font-weight: 750 !important;
    font-size: 13px !important;
    cursor: pointer;
    margin: 0 !important;
}

body:not(.light-theme) .central-login-form > div:has(> #central-login-remember) label {
    color: #6ee7b7 !important;
}

/* Buttons */
.central-login-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 6px;
    border-radius: 11px;
    font-size: 15.5px;
    font-weight: 850;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: #ffffff !important;
    border: none;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.central-login-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669, #047857) !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
    transform: translateY(-1px);
}

.central-login-card .btn-secondary,
.central-login-screen .btn-secondary {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #1e293b !important;
    font-weight: 800;
    border-radius: 11px;
    min-height: 44px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.central-login-card .btn-secondary:hover,
.central-login-screen .btn-secondary:hover {
    border-color: #3b82f6 !important;
    color: #2563eb !important;
    background: #eff6ff !important;
}

body:not(.light-theme) .central-login-card .btn-secondary,
body:not(.light-theme) .central-login-screen .btn-secondary {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: #f8fafc !important;
}

body:not(.light-theme) .central-login-card .btn-secondary:hover,
body:not(.light-theme) .central-login-screen .btn-secondary:hover {
    background: rgba(59, 130, 246, 0.2) !important;
    border-color: #60a5fa !important;
    color: #93c5fd !important;
}

/* Footer Notice */
.central-login-help {
    margin: 0;
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1.5px solid #e2e8f0;
    color: #334155 !important;
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

body:not(.light-theme) .central-login-help {
    background: rgba(15, 23, 42, 0.5);
    border-top: 1.5px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1 !important;
}

.central-login-help i {
    color: #2563eb;
    margin-top: 3px;
    font-size: 14px;
    flex-shrink: 0;
}

body:not(.light-theme) .central-login-help i {
    color: #60a5fa;
}



