/* =========================================================
   INVENTORY ELITE HEADER SYSTEM
   Reference: Premium Admin Panel (CityCell Design System)
   ========================================================= */

/* ROW 1: Title (left) + Action Buttons (right) */
.inv-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 20px;
    flex-wrap: wrap;
}

.inv-actions-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Flat Pill Action Buttons (PDF, Auditar, etc.) */
.btn-action-flat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action-flat:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.btn-action-flat i {
    font-size: 1rem;
}

/* Gold variant (Ajuste Precios) */
.btn-flat-gold {
    color: #d97706;
    border-color: #fde68a;
    background: #fffbeb;
}

.btn-flat-gold:hover {
    background: #fef3c7;
    border-color: #f59e0b;
}

/* AI variant (Análisis IA) */
.btn-flat-ai {
    color: #7c3aed;
    border-color: #ddd6fe;
    background: #f5f3ff;
}

.btn-flat-ai:hover {
    background: #ede9fe;
    border-color: #8b5cf6;
}

/* Danger variant (Borrar) */
.btn-flat-danger {
    color: #dc2626;
    border-color: #fecaca;
    background: #fff5f5;
}

.btn-flat-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Divider between button groups */
.inv-divider {
    width: 1px;
    height: 24px;
    background: #e2e8f0;
    margin: 0 4px;
}

/* ROW 2: Search + Filter Selects + Controls */
.inv-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inv-search {
    flex: 1;
    min-width: 220px;
}

/* Brand/Type filter selects in the controls row */
.inv-filter-selects {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.inv-select-pill {
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 50px;
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%2394a3b8' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
    transition: all 0.2s;
    min-width: 130px;
}

.inv-select-pill:hover,
.inv-select-pill:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 118, 189, 0.1);
}

/* Right controls group */
.inv-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* =========================================================
   ORIGINAL INVENTORY CSS BELOW
   ========================================================= */

/* --- SMART INVENTORY ANALYSIS UI (PHASE 5) --- */
.analysis-dashboard {
    font-family: 'Inter', sans-serif;
    text-align: left;
}

.analysis-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.analysis-tab {
    background: none;
    border: none;
    padding: 8px 15px;
    font-weight: 700;
    color: var(--text-light);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.analysis-tab:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.analysis-tab.active {
    background: #eff6ff;
    color: #2563eb;
}

/* --- SMART ANALYSIS V2 (CLEAN) --- */
.analysis-dashboard-v2 {
    display: flex;
    flex-direction: column;
    height: 75vh;
    gap: 15px;
}

.analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    flex-shrink: 0;
}

.analysis-tabs-group {
    display: flex;
    gap: 10px;
}

.analysis-actions-group {
    display: flex;
    gap: 10px;
}

.analysis-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 15px;
}

.analysis-table-wrapper {
    flex: 1;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.analysis-table th {
    padding: 12px 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    font-weight: 700;
    background: #f8fafc;
    white-space: nowrap;
}

.analysis-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
}

.status-dead {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    display: inline-block;
}

.status-ok {
    color: #64748b;
    font-size: 0.85rem;
}

/* FIXED HEADER TABLE STYLES FOR INVENTORY ANALYSIS */
.analysis-table-container {
    max-height: 50vh;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.analysis-table.fixed-header thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* === CITYCELL ELITE CATALOG (MASTER REFORM) === */

/* --- BCV RATE PILL (REFINED BLUE ELITE) --- */
.bcv-rate-container {
    display: flex;
    justify-content: flex-start;
    margin: 0 0 30px 0;
}

.bcv-rate-pill {
    background: #ffffff;
    /* CLEAN WHITE */
    padding: 12px 20px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: 2px solid #e0f2fe;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.bcv-rate-date {
    font-size: 0.7rem;
    color: #0369a1;
    /* Deep Blue Date */
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bcv-rate-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bcv-rate-label {
    font-size: 0.95rem;
    font-weight: 850;
    color: #0369a1;
    /* BLUE LABEL AS REQUESTED */
}

.bcv-rate-value {
    font-size: 1.15rem;
    font-weight: 700;
    /* SOFTENED WEIGHT */
    color: #0f172a;
    letter-spacing: -0.2px;
}

/* --- SEARCH & FILTERS CONTAINER (CLEAN & HORIZONTAL) --- */
.search-container {
    display: flex;
    align-items: center;
    background: transparent;
    padding: 10px 0;
    margin-bottom: 30px;
    gap: 0;
    border-top: 1px solid #f1f5f9;
    padding-top: 30px;
}

/* Catalog-specific search bar sizing */
.catalog-search-ctrl {
    flex: 1;
    min-width: 200px;
}

.control-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    border: 1px solid #e2e8f0;
    padding: 0 20px;
    height: 42px;
    /* MORE COMPACT AS REQUESTED */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.control-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(47, 118, 189, 0.08);
    transform: translateY(-1px);
}

.control-search i {
    color: #94a3b8;
    font-size: 1.15rem;
    /* Slightly smaller icon */
    margin-right: 12px;
}

.control-search input {
    border: none !important;
    background: transparent !important;
    width: 100%;
    font-size: 0.9rem;
    /* CLEANER FONT SIZE */
    font-weight: 600;
    color: #1e293b;
    outline: none !important;
}

.search-divider {
    border-left: 1px solid #e2e8f0;
    margin-left: 20px;
    padding-left: 20px;
    display: flex;
    align-items: center;
}

.search-filter-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    height: 46px;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 850;
    color: #64748b;
    cursor: pointer;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80a8,8,0,0,1,11.32-11.32L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    transition: all 0.2s;
    outline: none !important;
    /* REMOVE HORRIBLE DEFAULT OUTLINE */
}

.search-filter-btn:focus {
    border-color: var(--primary);
    background-color: white;
    color: var(--primary);
    box-shadow: 0 0 0 4px rgba(47, 118, 189, 0.1);
}

.search-filter-btn:hover {
    border-color: #cbd5e1;
    color: var(--text-dark);
}

/* --- VIEW TOGGLE (GRID/LIST) --- */
.view-toggle-wrapper {
    display: flex;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 18px;
    margin-left: 30px;
}

.view-toggle-wrapper button {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 1.4rem;
}

.view-toggle-wrapper button.active {
    background: white;
    color: #ef4444;
    /* Specific Active Red */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* =====================================================
   MOBILE CATALOG OVERRIDES (≤600px)
   ===================================================== */
@media (max-width: 600px) {

    /* Search bar: wrap and go full-width */
    .search-container {
        flex-wrap: wrap;
        gap: 8px;
        padding-top: 16px;
        margin-bottom: 16px;
    }

    /* Search input: full row, no min-width override */
    .search-container .control-search {
        flex: 1 1 100% !important;
        min-width: 0 !important;
        width: 100%;
    }

    /* Hide Tipo / Marca filter pills and view-toggle on mobile */
    .search-container .search-divider,
    .search-container .view-toggle-wrapper {
        display: none;
    }

    /* BCV rate pill smaller */
    .bcv-rate-pill {
        font-size: 0.75rem;
        padding: 8px 14px;
    }

    /* Reduce catalog section padding */
    #view-catalog.view-section {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* --- PRODUCT GRID & CARDS (DEFINITIVE REFORM) --- */
#products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    /* More compact gap */
    padding: 10px 0;
}

/* --- PRODUCT CARD (ELITE REFORM) --- */
.product-card {
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.prod-img-container {
    width: 100%;
    height: 320px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(241, 245, 249, 0.8);
    transition: background 0.3s ease;
}

.prod-img {
    width: 100%;
    /* MAX WIDTH */
    height: 100%;
    /* MAX HEIGHT */
    object-fit: contain;
    transform: scale(1.1);
    /* GIANT BASE SIZE AS REQUESTED */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-card:hover .prod-img {
    transform: scale(1.15);
    /* SLIGHT HOVER ENHANCEMENT */
}

.product-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-light);
}

.product-card:hover .prod-img-container {
    background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.prod-info-premium {
    padding: 18px !important;
    /* Compact padding */
    text-align: center;
    flex: 1;
}

.prod-info-premium.centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 14px 12px;
}

.inv-tag-small {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 850;
    letter-spacing: 1.2px;
    margin-bottom: 2px;
    display: block;
}

.prod-title {
    font-size: 1.2rem;
    /* HARMONIC SMALLER */
    /* Larger and bolted */
    font-weight: 1000;
    color: #0f172a;
    margin-bottom: 6px;
    /* TIGHTLY PEGGED */
    line-height: 1.1;
    text-transform: uppercase;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto;
    min-height: 2.3rem;
    /* Adjusted for smaller font */
}

/* === RESPONSIVE OVERRIDES (GRID MORE THAN 1200, 900, 600) === */
@media (max-width: 1200px) {
    #products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    #products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #products-grid {
        grid-template-columns: 1fr !important;
        gap: 24px;
        padding: 10px;
    }

    /* Mobile: vertical stacked layout */
    .product-card {
        flex-direction: column !important;
        border-radius: 20px;
        align-items: center !important;
        min-height: unset !important;
        max-height: unset !important;
        overflow: hidden;
        border: 1px solid #e2e8f0;
    }

    .prod-img-container {
        width: 100% !important;
        min-width: unset !important;
        height: 240px !important;
        border-bottom: 1px solid #f1f5f9 !important;
        border-right: none !important;
        border-radius: 20px 20px 0 0;
        background: #fff;
    }

    .prod-img {
        transform: scale(1) !important;
        padding: 15px;
        object-fit: contain;
    }

    .prod-info-premium,
    .prod-info-premium.centered {
        flex: none;
        width: 100%;
        text-align: center !important;
        align-items: center !important;
        padding: 20px !important;
        justify-content: center !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .prod-title {
        font-size: 1.15rem !important;
        font-weight: 850 !important;
        min-height: unset !important;
        margin-bottom: 8px !important;
        line-height: 1.2 !important;
        height: auto !important;
        max-height: none !important;
        text-align: center !important;
    }

    .inv-tag-small {
        font-size: 0.75rem !important;
        margin-bottom: 4px !important;
        text-align: center !important;
    }

    .badge-quality-tag.elite-box {
        padding: 4px 12px !important;
        font-size: 0.7rem !important;
        margin-bottom: 12px !important;
        justify-content: center !important;
    }

    .availability-line {
        font-size: 0.8rem !important;
        margin-top: 5px !important;
    }

    .pricing-matrix-elite {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 0 20px 20px !important;
        width: 100%;
        border-top: none !important;
    }

    .price-island-glass {
        padding: 12px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        width: 100%;
    }

    .price-usd-bold {
        font-size: 1.25rem !important;
    }

    .install-label {
        font-size: 0.7rem !important;
        padding: 3px 10px !important;
        margin-bottom: 6px !important;
    }

    .low-stock-badge {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 10;
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .share-row {
        display: flex !important;
        justify-content: flex-end !important;
        width: 100% !important;
        padding: 0 20px 14px !important;
        /* Spacing below pricing */
    }

    .m-btn-share {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.3rem !important;
        border-radius: 10px !important;
    }

    .catalog-footer-actions {
        padding: 0 20px 25px !important;
        width: 100%;
        margin-top: 5px !important;
        display: flex !important;
        flex-direction: row !important;
        /* Row layout for actions */
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
    }

    .qty-stepper {
        flex-shrink: 0 !important;
        width: auto !important;
        margin: 0 !important;
        height: 44px !important;
        padding: 4px !important;
        background: #f8fafc !important;
        /* Lighter background */
        border: 1px solid #e2e8f0 !important;
    }

    .qty-btn {
        width: 34px !important;
        height: 34px !important;
        border-radius: 8px !important;
        background: white !important;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    }

    .qty-input {
        font-size: 1.1rem !important;
        width: 34px !important;
    }

    .btn-add-premium {
        flex: 1 !important;
        height: 44px !important;
        font-size: 0.9rem !important;
        width: auto !important;
        margin: 0 !important;
        border-radius: 12px !important;
        font-weight: 850 !important;
    }

    .product-card:hover {
        transform: none !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
    }
}

/* INSTALLATION LABELS (GLASS PILLS) */
.install-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    /* USER: 0.90rem */
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.install-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.install-label.con {
    color: #10b981;
}

.install-label.con::before {
    background: #10b981;
}

.install-label.sin {
    color: #ef4444;
}

.install-label.sin::before {
    background: #ef4444;
}

/* PRICING GROUPS (COMPACT MATRIX) */
.pricing-matrix-elite {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 14px;
    /* Reduced */
}

.price-island-glass {
    background: #f8fafc;
    border-radius: 18px;
    /* Compact */
    border: 1px solid #f1f5f9;
    padding: 12px 14px;
    /* Reduced */
    transition: all 0.3s;
}

.price-island-glass:hover {
    background: white;
    border-color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.price-row-top {
    display: flex;
    justify-content: space-between;
    /* Align pieces left/right */
    align-items: flex-start;
    margin-bottom: 8px;
}

/* TIER COLOR SYSTEM */
.label-detal,
.label-detal-t {
    color: #2563eb !important;
}

/* Blue */
.label-detal-usd,
.label-mayor {
    color: #16a34a !important;
}

/* Green */

.price-val-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.price-val-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.price-usd-bold {
    font-size: 0.9rem;
    /* USER: 0.9rem */
    font-weight: 1000;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.price-bs-muted {
    font-size: 0.9rem;
    /* USER: 0.9rem */
    color: #64748b;
    font-weight: 600;
}

.price-raw-subrow {
    display: flex;
    justify-content: space-between;
    /* Consistent with top row */
    align-items: center;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px dashed #e2e8f0;
}

.raw-label {
    font-size: 1rem;
    /* Slightly larger for clarity */
    font-weight: 950;
    color: #64748b;
    text-transform: uppercase;
}

.raw-value {
    font-size: 0.9rem;
    /* Same as USD to match equilibrio */
    font-weight: 1000;
    color: #0f172a;
}

/* QUALITY & REF TAGS (ELITE) */
/* ELITE SKU / DESC BOX */
.elite-box {
    background: #f1f7ff;
    padding: 10px 14px;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    /* ALLOW WRAPPING FOR MULTI-LINE DESC */
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    /* Horizontal / Vertical gap */
    text-align: center;
    line-height: 1.3;
}

.ref-label {
    font-size: 0.75rem;
    /* SMALLER AS REQUESTED */
    font-weight: 850;
    color: #475569;
    white-space: nowrap;
}

.pipe-divider {
    color: #cbd5e1;
    font-weight: 300;
}

.desc-line-blue {
    font-size: 0.8rem;
    /* SMALLER AS REQUESTED */
    font-weight: 900;
    color: #2563eb;
    text-transform: uppercase;
}

.sku-col,
.desc-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.box-label {
    font-size: 0.7rem;
    /* SMALLER HARMONIC */
    color: #94a3b8;
    font-weight: 800;
    text-transform: uppercase;
}

.sku-line {
    font-size: 0.85rem;
    /* SMALLER HARMONIC */
    font-weight: 1000;
    color: #1e293b;
    line-height: 1.2;
}

/* AVAILABILITY LINE (LEFT ALIGNED) */
.availability-line {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* LEFT ALIGNED */
    width: 100%;
    gap: 6px;
    color: #10b981;
    font-weight: 1000;
    font-size: 0.95rem;
    /* SMALLER AS REQUESTED */
    margin-bottom: 5px;
    padding-left: 5px;
}

/* STOCK INDICATOR (ELITE GLOW) */
.badge-quality-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 850;
    font-size: 0.8rem;
    color: #475569;
}

.ref-span {
    color: #64748b;
    font-weight: 800;
}

.desc-span {
    color: var(--primary);
    opacity: 0.9;
    margin-left: 5px;
}

.stock-pill-premium {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #f0fdf4;
    color: #166534;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 850;
    margin-top: 12px;
    border: 1px solid #dcfce7;
}

.stock-pill-premium.out {
    background: #eef2ff;
    /* Soft Indigo */
    color: #4f46e5;
    border-color: #e0e7ff;
}

/* Pricing Layout - CLEAN */
.price-layout.grid {
    padding: 0 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price-group-premium {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
}

.price-label-tech {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.dot-indicator.success {
    background: #10b981;
}

.dot-indicator.danger {
    background: #ef4444;
}

.price-row-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.d-price-usd {
    font-size: 1.4rem;
    font-weight: 950;
    color: var(--text-dark);
}

.d-price-bs {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 700;
}

.price-row-alt {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    border-top: 1px dashed #f1f5f9;
    padding-top: 6px;
}

/* Prices Fix */
.price-layout.grid {
    margin-top: 15px;
}

.d-price-tag-retail {
    font-size: 1.5rem;
    font-weight: 950;
    color: var(--primary);
}

.d-price-bs-tag {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 700;
}

/* Modal Wide Override */
.analysis-dashboard-popup {
    width: 1200px !important;
    max-width: 95vw !important;
}

/* === CITYCELL DASHBOARD & ANALYTICS (ELITE EDITION) === */

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 950;
    color: var(--text-dark);
    letter-spacing: -1px;
}

.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* --- STORY RAIL REFORM (ELITE) --- */
.stories-rail {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 20px 0;
    margin-bottom: 10px;
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.stories-rail::-webkit-scrollbar {
    display: none;
}

.story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 110px;
    /* INCREASED */
    cursor: pointer;
}

.story-ring {
    width: 90px;
    /* INCREASED SIZE */
    height: 90px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.story-item:hover .story-ring {
    transform: scale(1.1);
}

.story-img-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid white;
    background: white;
    overflow: hidden;
}

.story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-label {
    margin-top: 8px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-transform: uppercase;
    line-height: 1.1;
}

.story-label .brand {
    font-size: 0.6rem;
    font-weight: 800;
    color: #2563eb;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-label .model {
    font-size: 0.72rem;
    font-weight: 900;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === MOBILE: Compact story cards === */
@media (max-width: 768px) {
    .story-item {
        min-width: 90px;
        gap: 8px;
    }

    .story-ring {
        width: 82px;
        height: 82px;
        padding: 3px;
    }

    .story-label {
        font-size: 0.55rem;
    }
}

.section-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    display: block;
}

/* Row Layouts */
.stats-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.stats-row-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Stat Cards Base */
.stat-card {
    background: white;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.big-icon {
    position: absolute;
    right: -10px;
    bottom: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(-15deg);
    color: var(--text-dark);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1;
    margin: 8px 0;
}

.stat-info h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hero Cards (Facturación, Utilidad, Caja) */
.hero-card {
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: white;
    min-height: 170px;
    display: flex;
    align-items: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.hero-card.liquidity {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-color: rgba(99, 102, 241, 0.4);
}

.hero-card.profit {
    background: linear-gradient(135deg, #065f46 0%, #10b981 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

.hero-card.cashflow {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-color: rgba(59, 130, 246, 0.3);
}

.hero-card .stat-value,
.hero-card .stat-info h3,
.hero-card small {
    color: white !important;
}

.hero-card .big-icon {
    opacity: 0.15;
    color: white;
}

.stat-progress-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.stat-progress-fill {
    height: 100%;
    background: white;
    border-radius: 10px;
}

/* Charts Containers */
.chart-container-premium {
    background: white;
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.section-header-mini h3 {
    font-size: 1rem;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 20px;
}

@media (max-width: 1024px) {
    .stats-row-3 {
        grid-template-columns: 1fr;
    }
}

/* Footer & Pricing */
.card-footer {
    padding: 15px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.d-price-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
}

/* SHARE ROW (Positioned Above Actions) */
.share-row {
    display: flex;
    justify-content: flex-end;
    padding: 0 14px 10px 14px;
}

.m-btn-share {
    background: #22c55e;
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.25);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.m-btn-share:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.search-clear-btn {
    background: #f1f5f9;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-right: -10px;
}

.search-clear-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    transform: scale(1.15);
}

/* LOW STOCK INDICATOR (CENTERED RED) */
/* LOW STOCK INDICATOR (RIPPLE WAVE SYSTEM) */
.low-stock-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    padding: 5px 12px;
    /* MUCH SLEEKER */
    border-radius: 50px;
    font-size: 0.75rem;
    /* ELITE SMALL SIZE */
    font-weight: 850;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    animation: elite-ripple-wave 2s infinite ease-out;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

@keyframes elite-ripple-wave {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7), 0 0 0 0 rgba(239, 68, 68, 0.3);
    }

    50% {
        transform: scale(1.05);
        /* Effect in-out */
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0), 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0), 0 0 20px 20px rgba(239, 68, 68, 0);
        /* Onda expansive */
    }
}

.catalog-footer-actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #f1f5f9;
    align-items: center;
}

.btn-add-premium {
    flex: 1;
    height: 42px;
    /* Balanced thickness */
    background: var(--primary);
    color: white;
    border-radius: 12px;
    border: none;
    font-weight: 850;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-add-premium:hover:not(.disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-add-premium.disabled {
    background: #dc2626 !important;
    color: white !important;
    border: none !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

.btn-add-premium.disabled-agotado {
    background: rgba(220, 38, 38, 0.1);
    /* Transparent Red Premium */
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.2);
    opacity: 1 !important;
    cursor: not-allowed;
    box-shadow: none;
}

/* Stepper */
.qty-stepper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    gap: 10px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: white;
    font-weight: 800;
    cursor: pointer;
}

.qty-input {
    width: 30px;
    text-align: center;
    background: transparent;
    border: none;
    font-weight: 800;
    font-size: 0.9rem;
}

/* === INVENTORY FILTERS & ACTIONS === */
.inventory-filters-row {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: white;
    border-radius: 20px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    align-items: flex-end;
    box-shadow: var(--shadow-sm);
}

.inventory-filters-row>div {
    flex: 1;
}

.inventory-filters-row select,
.inventory-filters-row input {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0 15px;
    background: #f8fafc;
    font-weight: 600;
}

/* CSV IMPORT MODAL */
.modal-csv-container {
    background: white;
    border-radius: 24px;
    width: 100%;
    max-width: 900px;
    overflow: hidden;
}

.modal-csv-header {
    padding: 24px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.csv-upload-zone {
    padding: 40px;
}

.upload-zone-inner {
    border: 2px dashed var(--border);
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-zone-inner:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* === SETTINGS HUB LAYOUT === */
.settings-hub-layout {
    display: flex;
    background: white;
    border-radius: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
    min-height: 600px;
}

.settings-sidebar {
    width: 260px;
    background: #f8fafc;
    border-right: 1px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 15px;
    color: var(--text-light);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
}

.settings-nav-item i {
    font-size: 1.2rem;
}

.settings-nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-dark);
}

.settings-nav-item.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.settings-main-content {
    flex: 1;
    padding: 40px;
    max-height: 80vh;
    overflow-y: auto;
}

/* === MODERN STORY VIEWER SYSTEM === */
.story-viewer-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    animation: story-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.story-viewer-overlay.hidden {
    display: none;
}

/* Progress Bars */
.story-viewer-progress-container {
    display: flex;
    gap: 4px;
    padding: 12px 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.story-progress-segment {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.story-progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    transition: width linear;
}

.story-progress-fill.completed {
    width: 100%;
}

.story-progress-fill.active {
    animation: story-progress-anim 5s linear forwards;
}

@keyframes story-progress-anim {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

/* Header */
.story-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 15px 20px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}

.story-viewer-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.story-viewer-avatar-ring {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ef4444;
    padding: 2px;
}

.story-viewer-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.story-viewer-info {
    display: flex;
    flex-direction: column;
}

.story-viewer-name {
    color: white;
    font-weight: 850;
    font-size: 0.95rem;
}

.story-viewer-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.story-viewer-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 10px;
}

/* Content & Navigation */
.story-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.story-main-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    animation: story-img-zoom 5s linear forwards;
}

@keyframes story-img-zoom {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

.story-watermark {
    position: absolute;
    bottom: 15px;
    right: 15px;
    pointer-events: none;
    opacity: 1;
    /* Fully opaque / nítido */
    z-index: 10;
    width: 130px;
    transition: all 0.5s ease;
}

.story-watermark img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.story-nav-zone {
    position: absolute;
    top: 15%;
    bottom: 15%;
    width: 25%;
    z-index: 10;
    cursor: pointer;
}

.story-nav-zone.left {
    left: 0;
}

.story-nav-zone.right {
    right: 0;
}

/* Footer */
.story-viewer-footer {
    padding: 20px 20px 40px;
    display: flex;
    justify-content: center;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.story-add-btn {
    background: #2563eb;
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 850;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
    cursor: pointer;
}

@keyframes story-fade-in {
    from {
        opacity: 0;
        transform: scale(1.1);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === MOBILE ELITE CARD CLASSES === */
.m-card-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centered according to image */
    text-align: center;
}

.m-card-eyebrow {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.m-card-title {
    font-size: 1.2rem;
    font-weight: 1000;
    color: #0f172a;
    text-transform: uppercase;
    margin-bottom: 8px;
    line-height: 1.2;
}

.m-card-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.m-badge {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 850;
    color: #475569;
}

.m-badge.primary {
    color: var(--primary);
}

.m-badge.success {
    color: #10b981;
    background: #f0fdf4;
}

.m-badge.danger {
    color: #ef4444;
    background: #fef2f2;
}

.m-badge.pulse {
    animation: m-badge-pulse 2s infinite;
}

@keyframes m-badge-pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.desc-line-orange {
    font-size: 0.85rem;
    /* SMALLER HARMONIC */
    font-weight: 1000;
    color: #f97316;
    line-height: 1.2;
    text-transform: uppercase;
}

.availability-line.agotado {
    color: #ef4444;
    /* Red for out of stock */
}

/* =========================================================
   INVENTORY AUDIT MODULE (ELITE DESIGN)
   ========================================================= */

.audit-table-row {
    transition: background-color 0.2s;
}

.audit-table-row:hover {
    background-color: #f8fafc;
}

.audit-product-cell {
    padding: 12px 20px !important;
}

.audit-product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.audit-image-container {
    width: 60px;
    height: 60px;
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.audit-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.audit-product-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-product-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    line-height: 1.2;
}

.audit-product-meta {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.audit-sku {
    color: #94a3b8;
    background: #f8fafc;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.audit-separator {
    color: #cbd5e1;
}

.audit-qty-badge {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 850;
    font-size: 1rem;
    display: inline-block;
}

.audit-input-container {
    display: flex;
    justify-content: center;
}

.audit-input-qty {
    width: 80px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    font-weight: 850;
    color: #334155;
    outline: none;
    transition: all 0.2s;
}

.audit-input-qty:focus {
    border-color: var(--primary);
    background: #f0f7ff;
    box-shadow: 0 0 0 4px rgba(47, 118, 189, 0.1);
}

.audit-input-qty:hover {
    border-color: #cbd5e1;
}

/* Difference Badges in Audit */
.badge.diff-neutral {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.badge.diff-positive {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge.diff-negative {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}