/* ============================================================ */
/* ALMACÉN DASHBOARD — Estilo Bento Box                         */
/* ============================================================ */

.almacen-dashboard {
    background-color: #f0f2f5;
    min-height: 100vh;
    padding: 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ---- Base de cada celda bento ---- */
.almacen-dashboard .bento-cell {
    background: #ffffff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

/* ============================================================ */
/* BARRA DE ACCIONES RAPIDAS                                    */
/* ============================================================ */
.almacen-dashboard .bento-quick-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #1e2a38 0%, #2d3e52 100%);
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
    flex-wrap: wrap;
}

.almacen-dashboard .qa-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.almacen-dashboard .qa-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.almacen-dashboard .qa-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.almacen-dashboard .qa-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
    text-align: left;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    color: #fff;
}

.almacen-dashboard .qa-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.almacen-dashboard .qa-btn:active {
    transform: translateY(0);
}

.almacen-dashboard .qa-btn-teal    { background: #0d9488; }
.almacen-dashboard .qa-btn-blue    { background: #3B82F6; }
.almacen-dashboard .qa-btn-purple  { background: #8B5CF6; }
.almacen-dashboard .qa-btn-neutral { background: #475569; }
.almacen-dashboard .qa-btn-green   { background: #10b981; }
.almacen-dashboard .qa-btn-orange  { background: #f59e0b; }

.almacen-dashboard .qa-btn-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.almacen-dashboard .qa-btn-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.almacen-dashboard .qa-btn-title {
    font-weight: 700;
    font-size: 0.88rem;
}

.almacen-dashboard .qa-btn-sub {
    font-size: 0.7rem;
    opacity: 0.82;
}

/* ============================================================ */
/* FILA DE ESTADISTICAS KPI                                     */
/* ============================================================ */
.almacen-dashboard .stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.almacen-dashboard .stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.almacen-dashboard .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}

.almacen-dashboard .accent-blue::before   { background: #3B82F6; }
.almacen-dashboard .accent-green::before  { background: #10b981; }
.almacen-dashboard .accent-red::before    { background: #ef4444; }
.almacen-dashboard .accent-orange::before { background: #f59e0b; }

.almacen-dashboard .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.almacen-dashboard .accent-blue .stat-icon   { background: #eff6ff; color: #3B82F6; }
.almacen-dashboard .accent-green .stat-icon  { background: #f0fdf4; color: #10b981; }
.almacen-dashboard .accent-red .stat-icon    { background: #fef2f2; color: #ef4444; }
.almacen-dashboard .accent-orange .stat-icon { background: #fffbeb; color: #f59e0b; }

.almacen-dashboard .stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.almacen-dashboard .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e2a38;
    line-height: 1.2;
}

.almacen-dashboard .stat-label {
    font-size: 0.68rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.almacen-dashboard .stat-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    align-self: flex-start;
    white-space: nowrap;
}

.almacen-dashboard .badge-up      { background: #dcfce7; color: #15803d; }
.almacen-dashboard .badge-warn    { background: #fef3c7; color: #92400e; }
.almacen-dashboard .badge-down    { background: #fee2e2; color: #dc2626; }
.almacen-dashboard .badge-neutral { background: #f1f5f9; color: #475569; }

/* ============================================================ */
/* CUADRICULA BENTO PRINCIPAL                                   */
/* ============================================================ */
.almacen-dashboard .bento-main {
    display: grid;
    grid-template-columns: 1fr 1fr 1.3fr;
    grid-template-rows: minmax(280px, auto) minmax(240px, auto);
    gap: 16px;
}

.almacen-dashboard .cell-inventory {
    grid-column: 1;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

.almacen-dashboard .cell-scan {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
}

.almacen-dashboard .cell-ops {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
}

.almacen-dashboard .cell-arrivals {
    grid-column: 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
}

/* ---- Cabeceras genéricas de celda ---- */
.almacen-dashboard .cell-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.almacen-dashboard .cell-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.almacen-dashboard .icon-dark   { background: #1e2a38; color: #fff; }
.almacen-dashboard .icon-teal   { background: #e0f2fe; color: #0369a1; }
.almacen-dashboard .icon-blue   { background: #eff6ff; color: #3B82F6; }
.almacen-dashboard .icon-orange { background: #fffbeb; color: #d97706; }

.almacen-dashboard .cell-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1e2a38;
    margin: 0;
}

/* ============================================================ */
/* ESTILOS ESPECÍFICOS POR CELDA                                */
/* ============================================================ */

/* ---- Celda: Estatus de Inventario (Gráfico CSS Puro) ---- */
.almacen-dashboard .donut-wrap {
    display: flex;
    justify-content: center;
    padding: 20px 0;
    flex-shrink: 0;
}

.almacen-dashboard .donut-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(#10b981 0% 52%,
            #f59e0b 52% 72%,
            #1e2a38 72% 95%,
            #ef4444 95% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.almacen-dashboard .donut-hole {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.almacen-dashboard .donut-total {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e2a38;
    line-height: 1.1;
}

.almacen-dashboard .donut-label {
    font-size: 0.65rem;
    color: #9CA3AF;
    text-transform: uppercase;
    font-weight: 600;
}

.almacen-dashboard .inventory-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: center;
    margin-bottom: 10px;
}

.almacen-dashboard .legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.almacen-dashboard .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.almacen-dashboard .legend-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e2a38;
    width: 80px;
    flex-shrink: 0;
}

.almacen-dashboard .legend-bar-track {
    flex: 1;
    height: 6px;
    background: #f0f2f5;
    border-radius: 4px;
    overflow: hidden;
}

.almacen-dashboard .legend-bar-fill {
    height: 100%;
    border-radius: 4px;
}

.almacen-dashboard .legend-pct {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    width: 32px;
    text-align: right;
    flex-shrink: 0;
}

/* ---- Celda: Recepción Rápida (Escáner) ---- */
.almacen-dashboard .scan-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 14px;
    line-height: 1.4;
}

.almacen-dashboard .scan-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.almacen-dashboard .scan-input-wrapper:focus-within {
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.almacen-dashboard .scan-icon {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-right: 12px;
}

.almacen-dashboard .scan-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e2a38;
    outline: none;
}

.almacen-dashboard .scan-input::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}

.almacen-dashboard .btn-action-dark { background: #1e2a38; color: #fff; }

.almacen-dashboard .btn-action-dark:hover {
    filter: brightness(1.2);
}

/* ---- Celda: Operaciones de Almacén ---- */
.almacen-dashboard .ops-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    justify-content: center;
}

.almacen-dashboard .ops-metric {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #f0f2f5;
    transition: transform 0.15s ease;
}

.almacen-dashboard .ops-metric:hover {
    transform: translateX(4px);
}

.almacen-dashboard .metric-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e2a38;
    display: block;
    line-height: 1.1;
}

.almacen-dashboard .metric-lbl {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 600;
    display: block;
}

/* ---- Celda: Grid de Llegadas ---- */
.almacen-dashboard .arrivals-table-wrap {
    flex: 1;
    overflow-y: auto;
    margin: 0 -20px;
    min-height: 0;
}

.almacen-dashboard .table-hover th {
    background-color: #f8fafc !important;
    color: #64748b !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-weight: 600;
    padding: 12px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.almacen-dashboard .product-thumb {
    width: 34px;
    height: 34px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.almacen-dashboard .priority-icon {
    color: #ef4444;
    font-size: 1.1rem;
    filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.3));
}

.almacen-dashboard .status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.almacen-dashboard .badge-transit { background: #e0f2fe; color: #0369a1; }
.almacen-dashboard .badge-late    { background: #fee2e2; color: #dc2626; }
.almacen-dashboard .badge-dock    { background: #dcfce7; color: #15803d; }

.almacen-dashboard .btn-recibir {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.almacen-dashboard .btn-recibir:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ---- Elementos compartidos ---- */
.almacen-dashboard .cell-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.almacen-dashboard .btn-cell-action {
    flex: 1;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.13s ease, filter 0.13s ease;
    white-space: nowrap;
    text-align: center;
}

.almacen-dashboard .btn-cell-action:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
}

.almacen-dashboard .btn-cell-action:active {
    transform: translateY(0);
}

.almacen-dashboard .btn-action-teal   { background: #e0f2fe; color: #0369a1; }
.almacen-dashboard .btn-action-blue   { background: #eff6ff; color: #3B82F6; }
.almacen-dashboard .btn-action-purple { background: #f5f3ff; color: #7c3aed; }
.almacen-dashboard .btn-action-orange { background: #fffbeb; color: #f59e0b; }

.almacen-dashboard .cell-footer {
    margin-top: 14px;
    flex-shrink: 0;
}

.almacen-dashboard .btn-cell-outline {
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.almacen-dashboard .btn-cell-outline:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e2a38;
}

/* ============================================================ */
/* RESPONSIVIDAD                                                */
/* ============================================================ */
@media (max-width: 1200px) {
    .almacen-dashboard .bento-main {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }

    .almacen-dashboard .cell-inventory { grid-column: 1; grid-row: 1; }
    .almacen-dashboard .cell-scan      { grid-column: 2; grid-row: 1; }
    .almacen-dashboard .cell-ops       { grid-column: 2; grid-row: 2; }
    .almacen-dashboard .cell-arrivals  { grid-column: 1 / -1; grid-row: 3; }
}

@media (max-width: 768px) {
    .almacen-dashboard {
        padding: 14px;
        gap: 12px;
    }

    .almacen-dashboard .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .almacen-dashboard .bento-main {
        grid-template-columns: 1fr;
    }

    .almacen-dashboard .cell-inventory,
    .almacen-dashboard .cell-scan,
    .almacen-dashboard .cell-ops,
    .almacen-dashboard .cell-arrivals {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 480px) {
    .almacen-dashboard .stats-row {
        grid-template-columns: 1fr;
    }

    .almacen-dashboard .qa-buttons {
        flex-direction: column;
    }

    .almacen-dashboard .qa-btn {
        width: 100%;
    }

    .almacen-dashboard .cell-actions {
        flex-direction: column;
    }
}
