/* ===== CSS Variables ===== */
:root {
    --fd-sidebar-width: 250px;
    --fd-sidebar-bg: #1e293b;
    --fd-sidebar-color: #cbd5e1;
    --fd-sidebar-active: #3b82f6;
    --fd-topbar-height: 56px;
    --fd-body-bg: #f1f5f9;
    --fd-card-bg: #ffffff;
    --fd-text-primary: #1e293b;
    --fd-text-muted: #64748b;
    --fd-border-color: #e2e8f0;
    --fd-chart-color-1: #3b82f6;
    --fd-chart-color-2: #10b981;
    --fd-chart-color-3: #f59e0b;
    --fd-chart-color-4: #ef4444;
    --fd-chart-color-5: #8b5cf6;
}

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background-color: var(--fd-body-bg);
    color: var(--fd-text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
}

/* ===== Sidebar ===== */
.fd-sidebar {
    width: var(--fd-sidebar-width);
    min-height: 100vh;
    background-color: var(--fd-sidebar-bg);
    color: var(--fd-sidebar-color);
    transition: margin-left 0.3s ease;
    flex-shrink: 0;
}

    .fd-sidebar.fd-sidebar--collapsed {
        margin-left: calc(var(--fd-sidebar-width) * -1);
    }

.fd-sidebar__brand {
    height: var(--fd-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fd-sidebar__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
}

.fd-sidebar__nav {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.fd-sidebar__item {
    margin: 0;
}

.fd-sidebar__link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--fd-sidebar-color);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

    .fd-sidebar__link:hover,
    .fd-sidebar__link.active {
        background-color: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

/* ===== Site badges ===== */
.fd-site-badge {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
    line-height: 1.4;
}

.fd-site-badge--tr {
    background-color: #e30a17;
    color: #ffffff;
}

.fd-site-badge--vn {
    background-color: #da251d;
    color: #ffd700;
}

.fd-sidebar__group-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.fd-sidebar__link--sub {
    padding-left: 1.75rem;
}

/* ===== Topbar ===== */
.fd-topbar {
    height: var(--fd-topbar-height);
    background-color: var(--fd-card-bg);
    border-bottom: 1px solid var(--fd-border-color);
}

.fd-topbar__toggle {
    border: none;
    background: transparent;
}

/* ===== Content ===== */
.fd-wrapper {
    min-height: 100vh;
}

.fd-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.fd-main {
    flex: 1;
}

/* ===== Footer ===== */
.fd-footer {
    border-top: 1px solid var(--fd-border-color);
    font-size: 0.875rem;
    color: var(--fd-text-muted);
}

/* ===== Cards ===== */
.fd-card {
    background-color: var(--fd-card-bg);
    border: 1px solid var(--fd-border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.fd-card__title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fd-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.fd-card__value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fd-text-primary);
}

.fd-card--accent {
    border-left: 4px solid var(--fd-sidebar-active);
}

.fd-card__sub {
    font-size: 0.75rem;
    color: var(--fd-text-muted);
    margin-top: 0.25rem;
}

/* ===== Charts ===== */
canvas[data-chart] {
    display: block;
    max-width: 100%;
}

/* ===== Forms ===== */
.fd-form-group {
    margin-bottom: 1rem;
}

/* ===== Login Page – Material Design ===== */
.fd-login__body {
    font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--fd-body-bg);
}

.fd-login {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* --- Brand Panel --- */
.fd-login__brand {
    flex: 0 0 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1a237e 0%, #283593 40%, #3949ab 100%);
    color: #ffffff;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

    .fd-login__brand::before {
        content: '';
        position: absolute;
        width: 500px;
        height: 500px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.04);
        top: -150px;
        right: -100px;
    }

    .fd-login__brand::after {
        content: '';
        position: absolute;
        width: 300px;
        height: 300px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.03);
        bottom: -80px;
        left: -60px;
    }

.fd-login__brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.fd-login__brand-logo {
    max-width: 100%;
    max-height: 90%;
    height: auto;
    width: auto;
    object-fit: contain;
}

.fd-login__brand-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #ffffff;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.fd-login__brand-title {
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.fd-login__brand-subtitle {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.85;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.fd-login__brand-features {
    text-align: left;
    display: inline-block;
}

.fd-login__brand-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 300;
    opacity: 0.9;
}

    .fd-login__brand-feature i {
        font-size: 1.1rem;
        opacity: 0.8;
    }

/* --- Form Side --- */
.fd-login__form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background-color: var(--fd-body-bg);
}

.fd-login__card {
    width: 100%;
    max-width: 400px;
    background: var(--fd-card-bg);
    border-radius: 8px;
    padding: 2.5rem 2rem 2rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
}

.fd-login__card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.fd-login__avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    color: #ffffff;
    font-size: 1.5rem;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

.fd-login__title {
    font-size: 1.375rem;
    font-weight: 500;
    color: var(--fd-text-primary);
    margin-bottom: 0.25rem;
    letter-spacing: 0.25px;
}

.fd-login__subtitle {
    font-size: 0.875rem;
    color: var(--fd-text-muted);
    font-weight: 400;
}

/* --- Validation Alert --- */
.fd-login__alert {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    margin-bottom: 1.25rem;
}

    .fd-login__alert:empty {
        display: none;
    }

/* --- Material Floating Label Fields --- */
.fd-login__field {
    margin-bottom: 1.25rem;
}

.fd-login__field-inner {
    display: flex;
    align-items: stretch;
    background: var(--fd-body-bg);
    border: 1px solid var(--fd-border-color);
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

    .fd-login__field-inner:focus-within {
        border-color: #3949ab;
        box-shadow: 0 0 0 3px rgba(57, 73, 171, 0.12);
    }

.fd-login__field-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    flex-shrink: 0;
    color: var(--fd-text-muted);
    font-size: 1.1rem;
    transition: color 0.2s;
}

.fd-login__field-inner:focus-within .fd-login__field-icon {
    color: #3949ab;
}

.fd-login__float-label {
    flex: 1;
    position: relative;
    padding-top: 0.625rem;
}

    .fd-login__float-label label {
        position: absolute;
        top: 50%;
        left: 0.5rem;
        transform: translateY(-50%);
        font-size: 0.9375rem;
        color: var(--fd-text-muted);
        pointer-events: none;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        background: transparent;
        padding: 0;
        font-weight: 400;
    }

    .fd-login__float-label input:focus ~ label,
    .fd-login__float-label input:not(:placeholder-shown) ~ label {
        top: 4px;
        transform: translateY(0);
        font-size: 0.6875rem;
        font-weight: 500;
        color: #3949ab;
    }

.fd-login__input {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0.875rem 0.5rem 0.375rem 0.5rem;
    font-size: 0.9375rem;
    box-shadow: none;
    outline: none;
    width: 100%;
}

    .fd-login__input:focus {
        box-shadow: none;
        outline: none;
        background: transparent;
    }

.fd-login__field-error {
    display: block;
    font-size: 0.75rem;
    color: #d32f2f;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
    min-height: 1rem;
}

/* --- Options Row --- */
.fd-login__options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.fd-login__check .form-check-input {
    border-color: var(--fd-border-color);
}

    .fd-login__check .form-check-input:checked {
        background-color: #3949ab;
        border-color: #3949ab;
    }

.fd-login__check .form-check-label {
    font-size: 0.8125rem;
    color: var(--fd-text-muted);
}

/* --- Captcha Widget --- */
.fd-login__captcha {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* --- Material Raised Button --- */
.fd-login__btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #ffffff;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.3);
}

    .fd-login__btn:hover {
        box-shadow: 0 4px 16px rgba(26, 35, 126, 0.4);
        transform: translateY(-1px);
    }

    .fd-login__btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(26, 35, 126, 0.25);
    }

/* --- Footer --- */
.fd-login__footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--fd-text-muted);
    letter-spacing: 0.25px;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .fd-login__brand {
        flex: 0 0 360px;
    }
}

/* ===== Landing Watermark ===== */
.fd-landing-watermark {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    /*background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);*/
    position: relative;
    overflow: hidden;
}

.fd-landing-watermark::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0) 70%);
    top: -200px;
    right: -200px;
}

.fd-landing-watermark::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0) 70%);
    bottom: -150px;
    left: -150px;
}

.fd-landing-watermark__container {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.fd-landing-watermark__logo {
    max-width: 85%;
    max-height: 65%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity 0.3s ease, transform 0.3s ease;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.08));
}

.fd-landing-watermark__logo:hover {
    opacity: 0.95;
    transform: scale(1.02);
}

@media (max-width: 768px) {
    .fd-login {
        flex-direction: column;
    }

    .fd-login__brand {
        flex: none;
        min-height: 200px;
        padding: 2rem;
    }

    .fd-login__brand-features {
        display: none;
    }

    .fd-login__brand-subtitle {
        margin-bottom: 0;
    }

    .fd-login__form-side {
        padding: 1.5rem;
    }

    .fd-login__card {
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        margin-top: -1rem;
        border-radius: 12px 12px 8px 8px;
    }
}

/* ===== DataTables overrides ===== */
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--fd-border-color);
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .fd-sidebar {
        position: fixed;
        z-index: 1050;
        margin-left: calc(var(--fd-sidebar-width) * -1);
    }

        .fd-sidebar.fd-sidebar--open {
            margin-left: 0;
        }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===== Pallet Card ===== */
.fd-badge-from-box {
    background-color: var(--fd-accent, #e0f0ff);
    color: var(--fd-text-primary);
    border: 1px solid var(--fd-border-color);
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.35em 0.65em;
}

/* ===== Shared report pages ===== */
.fd-report-page__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.fd-report-page__title {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
}

.fd-report-page__subtitle {
    margin: 0.5rem 0 0;
    color: var(--fd-text-muted);
}

.fd-detail-list {
    display: grid;
    gap: 0.875rem;
}

.fd-detail-list__row {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 1.2fr;
    gap: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--fd-border-color);
}

    .fd-detail-list__row:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .fd-detail-list__row dt {
        margin: 0;
        font-size: 0.8125rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--fd-text-muted);
    }

    .fd-detail-list__row dd {
        margin: 0;
        font-weight: 600;
        color: var(--fd-text-primary);
        text-align: right;
        word-break: break-word;
    }

/* ===== Pallet Production Report – master/detail ===== */
.fd-btn-expand {
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
    font-weight: 700;
}

.fd-row-expanded > td {
    background-color: var(--fd-body-bg);
}

.fd-child-row {
    padding: 0.75rem 1rem;
    background-color: var(--fd-body-bg);
}


/* ===== Warehouse floor ===== */
.fd-modal-open {
    overflow: hidden;
}

.fd-warehouse-tools {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fd-warehouse-card {
    overflow: hidden;
}

.fd-warehouse-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.fd-warehouse-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fd-text-muted);
    font-size: 0.875rem;
}

.fd-warehouse-legend__swatch {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.fd-warehouse-legend__swatch--both {
    background: linear-gradient(180deg, #1d4ed8 0 50%, #d97706 50% 100%);
}

.fd-warehouse-legend__swatch--partial {
    background: linear-gradient(180deg, #e2e8f0 0 50%, #d97706 50% 100%);
}

.fd-warehouse-legend__swatch--empty {
    background: #e2e8f0;
}

.fd-warehouse-legend__swatch--shipped {
    background: #16a34a;
}

.fd-warehouse-legend__dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.fd-warehouse-legend__dot--short {
    background: #dceaf8;
    border-color: #7fb5e0;
}

.fd-warehouse-legend__dot--long {
    background: #fae8e0;
    border-color: #e6a88c;
}

.fd-warehouse-viewport {
    position: relative;
    overflow: hidden;
    min-height: 32rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(241, 245, 249, 0.96)), radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 40%);
    border: 1px solid var(--fd-border-color);
    border-radius: 1rem;
    cursor: grab;
}

    .fd-warehouse-viewport.is-dragging {
        cursor: grabbing;
    }

    .fd-warehouse-viewport.is-dragging .fd-warehouse-world {
        transition: none;
    }

.fd-warehouse-world {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    padding: 1rem;
    transition: transform 0.12s ease-out;
}

.fd-warehouse-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, max-content));
    align-items: start;
    gap: 1rem;
    width: max-content;
}

.fd-warehouse-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fd-warehouse-column__label {
    text-align: center;
    color: var(--fd-text-muted);
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.fd-warehouse-column__zones {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fd-warehouse-zone {
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.fd-warehouse-zone--short {
    background: #ffffff;
    border-color: #7fb5e0;
}

.fd-warehouse-zone--long {
    background: #ffffff;
    border-color: #e6a88c;
}

.fd-warehouse-zone__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid transparent;
}

.fd-warehouse-zone--short .fd-warehouse-zone__header {
    background: #dceaf8;
    border-bottom-color: rgba(26, 95, 165, 0.15);
}

.fd-warehouse-zone--long .fd-warehouse-zone__header {
    background: #fae8e0;
    border-bottom-color: rgba(165, 66, 29, 0.15);
}

.fd-warehouse-zone__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.fd-warehouse-zone--short .fd-warehouse-zone__title {
    color: #1a5fa5;
}

.fd-warehouse-zone--long .fd-warehouse-zone__title {
    color: #a5421d;
}

.fd-warehouse-zone__meta {
    margin: 0.25rem 0 0;
    color: var(--fd-text-muted);
    font-size: 0.875rem;
}

.fd-warehouse-zone__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.fd-warehouse-zone--short .fd-warehouse-zone__badge {
    background: rgba(26, 95, 165, 0.1);
    color: #1a5fa5;
}

.fd-warehouse-zone--long .fd-warehouse-zone__badge {
    background: rgba(165, 66, 29, 0.1);
    color: #a5421d;
}

.fd-warehouse-zone__body {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem 1rem 1rem;
}

.fd-warehouse-row {
    display: grid;
    grid-template-columns: 2.5rem max-content;
    gap: 0.75rem;
    align-items: center;
}

.fd-warehouse-row__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(226, 232, 240, 0.7);
    color: var(--fd-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.fd-warehouse-row__cells {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
}

.fd-warehouse-cell {
    position: relative;
    width: 1.75rem;
    height: 2.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.55rem;
    overflow: hidden;
    padding: 0;
    background: #e2e8f0;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

    .fd-warehouse-cell:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
    }

.fd-warehouse-cell__layer {
    position: absolute;
    left: 0;
    right: 0;
}

.fd-warehouse-cell__layer--top {
    top: 0;
    height: 50%;
}

.fd-warehouse-cell__layer--bottom {
    bottom: 0;
    height: 50%;
}

.fd-warehouse-cell--empty .fd-warehouse-cell__layer--top,
.fd-warehouse-cell--empty .fd-warehouse-cell__layer--bottom {
    background: #e2e8f0;
}
.fd-warehouse-cell--empty .fd-warehouse-cell__layer--bottom {
    background: #e2e8f0;
}

.fd-warehouse-cell--both .fd-warehouse-cell__layer--top {
    background: #1d4ed8;
}

.fd-warehouse-cell--both .fd-warehouse-cell__layer--bottom {
    background: #d97706;
}

.fd-warehouse-cell--partial .fd-warehouse-cell__layer--top {
    background: #e2e8f0;
}

.fd-warehouse-cell--partial .fd-warehouse-cell__layer--bottom {
    background: #d97706;
}

.fd-warehouse-cell__layer--shipped {
    background: #16a34a !important;
}

.fd-warehouse-modal[hidden] {
    display: none;
}

.fd-warehouse-modal {
    position: fixed;
    inset: 0;
    z-index: 1080;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.fd-warehouse-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
}

.fd-warehouse-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 30rem);
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.3);
    overflow: hidden;
}

.fd-warehouse-modal__header,
.fd-warehouse-modal__body {
    padding: 1.25rem 1.5rem;
}

.fd-warehouse-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--fd-border-color);
}

.fd-warehouse-modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.fd-warehouse-modal__subtitle {
    margin: 0.35rem 0 0;
    color: var(--fd-text-muted);
}

.fd-warehouse-modal__state {
    margin-bottom: 1rem;
}

.fd-warehouse-stack {
    display: grid;
    gap: 0.75rem;
}

.fd-warehouse-stack__slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid var(--fd-border-color);
    border-radius: 0.9rem;
}

.fd-warehouse-stack__label {
    color: var(--fd-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fd-warehouse-stack__value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.fd-warehouse-stack__divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.8), transparent);
}

.fd-warehouse-search {
    width: 14rem;
}

.fd-warehouse-zoom-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.6rem;
    border-radius: 0.45rem;
    background: rgba(226, 232, 240, 0.8);
    color: var(--fd-text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
}

.fd-warehouse-minimap-wrap {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    cursor: pointer;
    border-radius: 0.5rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.4);
    line-height: 0;
}

.fd-warehouse-minimap {
    display: block;
    border-radius: 0.5rem;
    pointer-events: none;
}

.fd-warehouse-cell--dimmed {
    opacity: 0.12;
    transition: opacity 0.15s;
}

.fd-warehouse-cell--matched {
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 2px #3b82f6;
}

.fd-warehouse-viewport.is-dragging [data-warehouse-cell] {
    pointer-events: none;
}

@media (max-width: 991.98px) {
    .fd-detail-list__row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

        .fd-detail-list__row dd {
            text-align: left;
        }

    .fd-warehouse-layout {
        grid-template-columns: 1fr;
    }
}

/* ===================== Flag images ===================== */
.fd-flag {
    display: inline-block;
    vertical-align: middle;
    border-radius: 2px;
    flex-shrink: 0;
}

.fd-flag--sm {
    width: 1.1em;
    height: 1.1em;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.fd-flag--lg {
    width: 1.5em;
    height: auto;
    vertical-align: -0.2em;
    margin-left: 0.4em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}
