/* ========================================================
   ESTILOS DEDICADOS: MONITOR DE PRODUCTOS VENDIDOS
   La Yunta - Dark Glassmorphism Theme
   ======================================================== */

.products-page-body {
    background: #070b13;
    color: #f8fafc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.prod-app-container {
    max-width: 1560px;
    margin: 0 auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================================
   NAVBAR SUPERIOR
   ======================================================== */
.prod-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.prod-nav-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.btn-back-dashboard {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #172136;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-back-dashboard:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

.prod-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.prod-logo {
    height: 42px;
    width: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(230, 10, 21, 0.25);
}

.prod-brand-text {
    display: flex;
    flex-direction: column;
}

.prod-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prod-brand-text h1 {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
    color: #ffffff;
    margin: 0;
}

.prod-live-badge {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #10b981;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.prod-live-badge i {
    font-size: 8px;
    animation: livePulse 2s infinite ease-in-out;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.8); }
}

.prod-brand-text p {
    font-size: 12px;
    color: #94a3b8;
    margin: 2px 0 0 0;
}

.prod-nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.prod-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #172136;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
}

.prod-user-chip i {
    color: #ef4444;
    font-size: 16px;
}

.btn-prod-logout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-prod-logout:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ========================================================
   BARRA DE FILTROS (IDÉNTICA AL DASHBOARD)
   ======================================================== */
.prod-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d1424;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.prod-filter-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.filter-bar-label {
    font-size: 12.5px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-pill-group {
    display: flex;
    background: #070b13;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.prod-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.prod-filter-pill:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.prod-filter-pill.active {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.store-select-wrapper select {
    background: #172136;
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    min-width: 220px;
}

.store-select-wrapper select:focus {
    border-color: #ef4444;
}

.prod-filter-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.date-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #070b13;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px 8px;
}

.date-filter-group label {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.date-filter-group input[type="date"] {
    background: transparent;
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    color-scheme: dark;
}

.date-mode-toggle {
    display: inline-flex;
    background: #070b13;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 3px;
    gap: 3px;
}

.btn-date-mode {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 5px 11px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-date-mode:hover {
    color: #ffffff;
}

.btn-date-mode.active {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-quick-date {
    background: #172136;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-quick-date:hover {
    background: #ef4444;
    color: #ffffff;
}

.date-range-filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #070b13;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px 10px;
    flex-wrap: wrap;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-input-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-input-field label {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-input-field input[type="date"] {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 3px 6px;
    color: #ffffff;
    font-weight: 700;
    font-size: 12px;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    color-scheme: dark;
}

.date-input-field input[type="date"]:focus {
    border-color: #ef4444;
}

.date-range-presets {
    display: flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding-left: 8px;
}

.btn-preset-range {
    background: #172136;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-preset-range:hover {
    background: #ef4444;
    color: #ffffff;
}

.btn-today-quick {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-today-quick:hover {
    background: #dc2626;
}

.limit-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
}

.limit-filter-group select {
    background: #172136;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12.5px;
    font-weight: 700;
    outline: none;
    cursor: pointer;
}

.btn-refresh-prod {
    background: #172136;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh-prod:hover {
    background: #dc2626;
    color: #ffffff;
}

/* ========================================================
   BANNER DE CONTEXTO ACTIVO
   ======================================================== */
.prod-active-context-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 10px 18px;
    font-size: 13px;
    color: #bae6fd;
}

.prod-active-context-banner i {
    color: #38bdf8;
    font-size: 16px;
}

/* ========================================================
   4 TARJETAS DE KPIS SUPERIORES
   ======================================================== */
.prod-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.prod-kpi-card {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.prod-kpi-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.prod-kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.prod-kpi-top span {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prod-kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-cyan { background: rgba(56, 189, 248, 0.15); color: #38bdf8; }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.icon-amber { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-slate { background: rgba(148, 163, 184, 0.12); color: #cbd5e1; }

.prod-kpi-number {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    margin: 4px 0 0 0;
    line-height: 1.1;
}

.text-emerald { color: #10b981; }

.prod-kpi-leader {
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
}

.prod-kpi-sub {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
}

/* ========================================================
   SECCIÓN BUSCADOR DE SKU / NOMBRE
   ======================================================== */
.prod-search-panel {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.search-panel-header h3 {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-panel-header h3 i {
    color: #ef4444;
}

.search-tip-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.prod-search-box-row {
    display: flex;
    gap: 10px;
}

.prod-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #070b13;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0 16px;
    gap: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.prod-search-input-wrap:focus-within {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.prod-search-input-wrap i {
    color: #ef4444;
    font-size: 18px;
}

.prod-search-input-wrap input {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 600;
    padding: 14px 0;
    outline: none;
}

.btn-search-exec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc2626;
    color: #ffffff;
    border: none;
    padding: 0 22px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-search-exec:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.btn-search-reset {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #172136;
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search-reset:hover {
    background: #251818;
    color: #ef4444;
}

/* ========================================================
   TARJETA DE RESULTADO DE BÚSQUEDA
   ======================================================== */
.prod-search-result-container {
    background: #090e1a;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    border-radius: 14px;
    padding: 20px 22px;
    animation: fadeInResult 0.3s ease-out;
}

@keyframes fadeInResult {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.result-sku-tag {
    background: #dc2626;
    color: #ffffff;
    font-family: monospace;
    font-size: 12px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.result-card-header h4 {
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
    margin: 4px 0 0 0;
}

.result-card-meta {
    font-size: 12px;
    color: #94a3b8;
}

.result-kpis-mini {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.result-mini-kpi {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.kpi-price-box { border-left: 3.5px solid #f59e0b; }
.kpi-qty-box { border-left: 3.5px solid #38bdf8; }
.kpi-revenue-box { border-left: 3.5px solid #10b981; }
.kpi-stores-box { border-left: 3.5px solid #c084fc; }

.price-tag-highlight {
    display: inline-block;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13.5px;
}

.chip-unit-price {
    font-size: 11px;
    color: #fbbf24;
    font-weight: 700;
    margin-top: 2px;
}

.result-mini-kpi span {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
}

.result-mini-kpi strong {
    display: block;
    font-size: 18px;
    font-weight: 900;
    color: #ffffff;
    margin-top: 3px;
}

.breakdown-box {
    background: #070b13;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
}

.breakdown-title-text {
    font-size: 12px;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.breakdown-chips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.store-sale-chip {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chip-store-meta {
    display: flex;
    flex-direction: column;
}

.chip-store-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f1f5f9;
}

.chip-store-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.type-sucursal { color: #38bdf8; }
.type-franquicia { color: #f59e0b; }

.chip-store-nums {
    text-align: right;
}

.chip-units {
    font-size: 13px;
    font-weight: 800;
    color: #38bdf8;
    display: block;
}

.chip-money {
    font-size: 11px;
    font-weight: 700;
    color: #10b981;
    display: block;
}

/* ========================================================
   SECCIÓN TABLA DE RANKING TOP
   ======================================================== */
.prod-ranking-panel {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ranking-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.ranking-header-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ranking-header-title i {
    font-size: 24px;
    color: #f59e0b;
}

.ranking-header-title h3 {
    font-size: 17px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.ranking-header-title span {
    font-size: 12px;
    color: #94a3b8;
}

.badge-total-items {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: #cbd5e1;
}

.table-responsive {
    overflow-x: auto;
}

.prod-ranking-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.prod-ranking-table th {
    background: #070b13;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.prod-ranking-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13.5px;
    color: #e2e8f0;
    vertical-align: middle;
}

.prod-ranking-table tr {
    transition: background 0.15s ease;
    cursor: pointer;
}

.prod-ranking-table tr:hover td {
    background: rgba(239, 68, 68, 0.08);
}

.prod-ranking-table tr:last-child td {
    border-bottom: none;
}

/* Indicador Numérico de Puesto Corporativo */
.rank-num-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 26px;
    padding: 0 6px;
    border-radius: 6px;
    background: #172136;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-family: 'Inter', monospace;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
}

.prod-ranking-table tr:hover .rank-num-badge {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.sku-code-tag {
    font-family: monospace;
    font-size: 12px;
    font-weight: 800;
    background: #172136;
    color: #f87171;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.prod-name-bold {
    font-weight: 700;
    color: #ffffff;
}

.units-pill {
    display: inline-block;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.money-green {
    font-weight: 800;
    color: #10b981;
    font-size: 14px;
}

.share-pill {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
}

.prod-loading-state {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
}

.prod-loading-state i {
    font-size: 28px;
    color: #ef4444;
}

.prod-footer {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    padding: 16px 0;
}

/* ========================================================
   RESPONSIVIDAD
   ======================================================== */
@media (max-width: 900px) {
    .prod-navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .prod-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .prod-filter-left, .prod-filter-right {
        width: 100%;
        justify-content: flex-start;
    }
    .store-select-wrapper select {
        width: 100%;
    }
}
