/* MIHUB Shelve Management — List / 3D Warehouse */

.warehouse-mgmt-card {
    background: #0a0c10;
    border: 1px solid rgba(179, 236, 36, 0.14);
    overflow: hidden;
}

.warehouse-mgmt-header {
    background: linear-gradient(180deg, #12161d 0%, #0a0c10 100%);
    border-bottom: 1px solid rgba(179, 236, 36, 0.12);
}

.warehouse-mgmt-header .card-title {
    color: #f5f6fc;
    font-weight: 600;
    font-size: 1.15rem;
}

.warehouse-view-toggle {
    display: inline-flex;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.warehouse-view-btn {
    border: 0;
    background: transparent;
    color: #9aa3b2;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.warehouse-view-btn:hover {
    color: #f5f6fc;
}

.warehouse-view-btn.is-active {
    background: #b3ec24;
    color: #0a0c10;
}

.warehouse-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.warehouse-kpi {
    background: #11151c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.warehouse-kpi-label {
    display: block;
    color: #8b93a7;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.warehouse-kpi-value {
    display: block;
    color: #f5f6fc;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.1;
}

.warehouse-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.warehouse-toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.warehouse-filter label {
    display: block;
    font-size: 0.7rem;
    color: #8b93a7;
    margin-bottom: 0.15rem;
}

.warehouse-filter .form-control,
.warehouse-filter .form-select {
    min-width: 140px;
    background: #161b22;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f6fc;
}

.warehouse-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warehouse-action-btn {
    background: #161b22;
    border: 1px solid rgba(179, 236, 36, 0.35);
    color: #b3ec24;
}

.warehouse-action-btn:hover {
    background: rgba(179, 236, 36, 0.12);
    color: #d7ff6a;
    border-color: #b3ec24;
}

.warehouse-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #8b93a7;
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
}

.warehouse-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #b3ec24;
    box-shadow: 0 0 8px rgba(179, 236, 36, 0.8);
    animation: whPulse 1.6s ease-in-out infinite;
}

.warehouse-live-badge.is-stale .warehouse-live-dot {
    background: #f59e0b;
    box-shadow: none;
    animation: none;
}

@keyframes whPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.85); }
}

.warehouse-stage-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 0.75rem;
    min-height: 560px;
}

.warehouse-canvas-host {
    position: relative;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(179, 236, 36, 0.08), transparent 55%),
        linear-gradient(180deg, #0d1118 0%, #07090d 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    overflow: hidden;
    min-height: 560px;
}

.warehouse-canvas-host canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.warehouse-loading,
.warehouse-error,
.warehouse-empty {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #c6ccd8;
    z-index: 3;
    background: rgba(7, 9, 13, 0.72);
    text-align: center;
    padding: 1rem;
}

.warehouse-hud {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    max-width: min(420px, 80%);
    pointer-events: none;
    color: #f5f6fc;
    font-size: 0.82rem;
    background: rgba(10, 12, 16, 0.72);
    border: 1px solid rgba(179, 236, 36, 0.25);
    border-radius: 8px;
    padding: 0.45rem 0.7rem;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.warehouse-hud.is-visible {
    opacity: 1;
}

.warehouse-parcel-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 220px;
    max-width: 280px;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    background: rgba(10, 12, 16, 0.94);
    border: 1px solid rgba(179, 236, 36, 0.45);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    color: #f5f6fc;
    pointer-events: none;
    transform: translate(12px, 12px);
    backdrop-filter: blur(6px);
}

.warehouse-parcel-tooltip[hidden] {
    display: none !important;
}

.warehouse-parcel-tooltip .tip-code {
    color: #b3ec24;
    font-weight: 700;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.warehouse-parcel-tooltip .tip-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: #9aa3b2;
    margin-top: 0.2rem;
}

.warehouse-parcel-tooltip .tip-row strong {
    color: #f5f6fc;
    font-weight: 600;
    text-align: right;
}

.warehouse-parcel-tooltip .tip-loading {
    color: #9aa3b2;
    font-size: 0.78rem;
}

.warehouse-detail-panel {
    background: #11151c;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 560px;
    max-height: 70vh;
    overflow: hidden;
}

.warehouse-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #161b22;
}

.warehouse-detail-header h5 {
    color: #b3ec24;
    font-weight: 700;
}

.warehouse-detail-body {
    padding: 1rem;
    overflow: auto;
    flex: 1;
}

.wh-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.wh-meta-item {
    background: #0a0c10;
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
}

.wh-meta-item span {
    display: block;
    color: #8b93a7;
    font-size: 0.7rem;
}

.wh-meta-item strong {
    color: #f5f6fc;
    font-size: 0.92rem;
}

.wh-progress {
    height: 8px;
    background: #0a0c10;
    border-radius: 999px;
    overflow: hidden;
    margin: 0.35rem 0 1rem;
}

.wh-progress > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 0.35s ease;
}

.wh-progress > i.ok { background: #22c55e; }
.wh-progress > i.warning { background: #eab308; }
.wh-progress > i.critical { background: #ef4444; }
.wh-progress > i.unavailable { background: #6b7280; }

.wh-parcel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.wh-parcel-item {
    background: #0a0c10;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.55rem 0.7rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.wh-parcel-item:hover,
.wh-parcel-item.is-active {
    border-color: rgba(179, 236, 36, 0.45);
}

.wh-parcel-item .uid {
    color: #b3ec24;
    font-weight: 600;
    font-size: 0.82rem;
}

.wh-parcel-item .meta {
    color: #8b93a7;
    font-size: 0.72rem;
}

.warehouse-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.75rem;
    color: #9aa3b2;
    font-size: 0.78rem;
}

.legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 0.25rem;
    vertical-align: middle;
}

.legend-swatch.ok { background: #22c55e; }
.legend-swatch.warning { background: #eab308; }
.legend-swatch.critical { background: #ef4444; }
.legend-swatch.unavailable { background: #6b7280; }

@media (max-width: 1199.98px) {
    .warehouse-kpi-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .warehouse-stage-wrap {
        grid-template-columns: 1fr;
    }

    .warehouse-detail-panel {
        min-height: 280px;
        max-height: 420px;
    }
}

@media (max-width: 767.98px) {
    .warehouse-kpi-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .warehouse-canvas-host {
        min-height: 420px;
    }
}
