/* ═══════════════════════════════════════════════════════
   Liverpool Marketplace — Pivot: filas=SKU, cols=días
   ═══════════════════════════════════════════════════════ */

/* ── Header ── */
.lv-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; flex-wrap: wrap; gap: 12px;
}
.lv-header-left { display: flex; align-items: center; gap: 14px; }
.lv-logo-badge {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, #e91e8c, #c4145a);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(233, 30, 140, 0.3);
}
.lv-logo-text { font-size: 1.5rem; font-weight: 800; color: #fff; font-family: 'Inter', sans-serif; }
.lv-title { font-size: 1.3rem; font-weight: 700; color: #e2e8f0; margin: 0; }
.lv-subtitle { font-size: 0.78rem; color: #64748b; margin: 2px 0 0; }
.lv-header-right { display: flex; align-items: center; gap: 10px; }
.lv-env-badge {
    padding: 3px 12px; border-radius: 12px; font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
    background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3);
}

/* ── Buttons ── */
.lv-btn {
    padding: 8px 16px; border-radius: 8px; font-size: 0.8rem; font-weight: 600;
    cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s;
}
.lv-btn-refresh { background: rgba(99,102,241,.12); color: #818cf8; border: 1px solid rgba(99,102,241,.25); }
.lv-btn-refresh:hover { background: rgba(99,102,241,.25); }
.lv-btn-green { background: rgba(34,197,94,.12); color: #4ade80; border: 1px solid rgba(34,197,94,.25); }
.lv-btn-green:hover { background: rgba(34,197,94,.25); }
.lv-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── KPI Row ── */
.lv-kpi-row {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    padding: 0 24px; margin-bottom: 16px;
}
.lv-kpi-card {
    background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 10px; padding: 14px 16px; transition: border-color 0.2s;
}
.lv-kpi-card:hover { border-color: rgba(99, 102, 241, 0.3); }
.lv-kpi-label { font-size: 0.72rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.lv-kpi-value { font-size: 1.6rem; font-weight: 800; color: #e2e8f0; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.lv-kpi-sub { font-size: 0.68rem; color: #475569; }
.lv-kpi-uds { border-left: 3px solid #e91e8c; }
.lv-kpi-skus { border-left: 3px solid #fbbf24; }
.lv-kpi-dias { border-left: 3px solid #4ade80; }

/* ── Alert: SKUs sin registrar ── */
.lv-alert-skus {
    margin: 0 24px 12px; padding: 10px 16px; border-radius: 8px;
    background: rgba(251, 146, 60, 0.08); border: 1px solid rgba(251, 146, 60, 0.25);
    color: #fb923c; font-size: 0.8rem; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
}

/* ── Sync Status ── */
.lv-sync-status {
    margin: 0 24px 12px; padding: 10px 16px; border-radius: 8px;
    font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.lv-sync-loading { background: rgba(99,102,241,.1); color: #818cf8; border: 1px solid rgba(99,102,241,.2); }
.lv-sync-ok { background: rgba(34,197,94,.1); color: #4ade80; border: 1px solid rgba(34,197,94,.2); }
.lv-sync-err { background: rgba(239,68,68,.1); color: #f87171; border: 1px solid rgba(239,68,68,.2); }

/* ── Filters ── */
.lv-filters {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 24px; margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.lv-search-input {
    padding: 6px 14px; background: #0f172a; color: #e2e8f0;
    border: 1px solid rgba(51,65,85,.45); border-radius: 8px; font-size: 0.8rem; width: 220px; outline: none;
}
.lv-search-input:focus { border-color: rgba(233,30,140,.5); }

/* ── Loading & Empty ── */
.lv-loading, .lv-empty {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 60px; color: #64748b; font-size: 0.9rem; flex-direction: column;
}
.lv-spinner {
    width: 20px; height: 20px; border: 2px solid rgba(233,30,140,.2);
    border-top-color: #e91e8c; border-radius: 50%; animation: lv-spin 0.8s linear infinite;
}
@keyframes lv-spin { to { transform: rotate(360deg); } }

/* ── Pivot Table ── */
.lv-table-wrap { padding: 0 24px; overflow-x: auto; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }

.lv-table thead th {
    padding: 8px 6px;
    background: rgba(30, 41, 59, 0.9);
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.72rem;
    text-align: center;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    position: sticky; top: 0; z-index: 2;
    white-space: nowrap;
}
.lv-totals-header th {
    background: rgba(233, 30, 140, 0.06);
    border-bottom: 2px solid rgba(233, 30, 140, 0.15);
    top: 32px;
}
.lv-table thead tr:first-child th:first-child,
.lv-table thead tr:first-child th:nth-child(2) { text-align: left; }

.lv-table tbody tr {
    border-bottom: 1px solid rgba(51, 65, 85, 0.15);
    transition: background 0.12s;
}
.lv-table tbody tr:hover { background: rgba(51, 65, 85, 0.15); }
.lv-table td { padding: 8px 6px; color: #cbd5e1; vertical-align: middle; }

.lv-sku {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem; color: #f472b6; font-weight: 600;
}
.lv-producto {
    color: #94a3b8; max-width: 200px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; font-size: 0.78rem;
}

/* ── Day cells ── */
.lv-day-col { width: 52px; min-width: 52px; }
.lv-total-col { width: 60px; min-width: 60px; }

.lv-day-cell {
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.82rem;
}
.lv-cell-active { color: #e2e8f0; }
.lv-cell-zero { color: #334155; font-weight: 400; }
.lv-cell-total {
    color: #f472b6 !important;
    font-weight: 800;
    border-left: 2px solid rgba(233, 30, 140, 0.2);
    background: rgba(233, 30, 140, 0.04);
}

/* ── Total row ── */
.lv-total-row {
    background: rgba(233, 30, 140, 0.05) !important;
    border-top: 2px solid rgba(233, 30, 140, 0.15) !important;
}
.lv-total-label {
    text-align: right !important;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding-right: 12px !important;
}
.lv-cell-day-total {
    text-align: center;
    font-weight: 800;
    color: #818cf8 !important;
    font-size: 0.85rem;
}
.lv-cell-grand-total {
    text-align: center;
    font-weight: 900;
    color: #e91e8c !important;
    font-size: 0.9rem;
    border-left: 2px solid rgba(233, 30, 140, 0.2);
    background: rgba(233, 30, 140, 0.08);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .lv-kpi-row { grid-template-columns: 1fr; }
}
