/* ═══════════════════════════════════════════════════════════
   Gestión de Stock — Premium styles
   ═══════════════════════════════════════════════════════════ */

/* ── Tab Bar ── */
.gs-tabs-bar {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #1e293b;
    background: rgba(15, 23, 42, 0.5);
    padding: 0 20px;
}

.gs-tab {
    padding: 14px 24px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.gs-tab:hover { color: #94a3b8; }
.gs-tab.active {
    color: #14b8a6;
    border-bottom-color: #14b8a6;
}

/* ── KPI card override for custom color ── */
.gs-panel .inv-kpi-card::before {
    background: linear-gradient(135deg,
        var(--kpi-color, rgba(20,184,166,0.25)) 0%,
        rgba(15, 23, 42, 0.5) 100%
    ) !important;
}

/* ── Config Summary Bar ── */
.gs-config-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    background: rgba(20, 184, 166, 0.04);
    border: 1px solid rgba(20, 184, 166, 0.15);
    border-radius: 8px;
    font-size: 0.78rem;
    color: #94a3b8;
}

.gs-config-bar strong {
    color: #14b8a6;
    font-weight: 700;
}

.gs-btn-refresh {
    margin-left: auto;
    background: rgba(20, 184, 166, 0.1);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #14b8a6;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s;
}
.gs-btn-refresh:hover {
    background: rgba(20, 184, 166, 0.2);
}

/* ── Main Table ── */
.gs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.gs-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(8px);
}

.gs-table th {
    padding: 10px 12px;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
    text-align: left;
}

/* Column header tooltip indicator */
.gs-th-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    color: #475569;
    cursor: help;
    margin-left: 3px;
    padding: 0 3px;
    border-radius: 3px;
    background: rgba(71, 85, 105, 0.15);
    border: 1px solid rgba(71, 85, 105, 0.25);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    transition: all 0.2s;
    vertical-align: middle;
    line-height: 1.3;
}
.gs-th-help:hover {
    color: #14b8a6;
    background: rgba(20, 184, 166, 0.1);
    border-color: rgba(20, 184, 166, 0.3);
}

.gs-table th.text-right,
.gs-table td.text-right { text-align: right; }

.gs-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.3);
    color: #e2e8f0;
    white-space: nowrap;
}

.gs-table tbody tr { transition: background 0.15s; }
.gs-table tbody tr:hover { background: rgba(20, 184, 166, 0.04); }

/* Row expand button */
.gs-expand-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 2px 6px;
    transition: all 0.2s;
}
.gs-expand-btn:hover { color: #14b8a6; }
.gs-expand-btn.open { transform: rotate(90deg); color: #14b8a6; }

/* Platform detail sub-row */
.gs-detail-row td { padding: 0 !important; border-bottom: 1px solid rgba(51, 65, 85, 0.2); }

.gs-detail-table {
    width: 100%;
    margin: 0;
    background: rgba(15, 23, 42, 0.6);
    border-collapse: collapse;
    font-size: 0.76rem;
}

.gs-detail-table th {
    padding: 6px 12px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
    text-align: left;
}

.gs-detail-table td {
    padding: 6px 12px;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(51, 65, 85, 0.15);
}

/* ── ABC Badges ── */
.gs-abc-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
}
.gs-abc-A { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.gs-abc-B { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.gs-abc-C { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.gs-abc-D { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* ── Estado Badges ── */
.gs-estado {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.72rem;
}
.gs-estado-ok { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.gs-estado-ordenar { background: rgba(249, 115, 22, 0.12); color: #f97316; }
.gs-estado-rotura { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

/* ── Q Fabricar highlight ── */
.gs-q-highlight {
    font-weight: 700;
    color: #f97316;
}
.gs-q-zero { color: #64748b; }

/* ── Legend ── */
.gs-legend {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    padding: 8px 0;
    font-size: 0.72rem;
    color: #64748b;
}

/* ── Platform colors in detail ── */
.gs-plat-amazon { color: #f59e0b; }
.gs-plat-mercadolibre { color: #60a5fa; }
.gs-plat-shopify { color: #22c55e; }
.gs-plat-tiktok { color: #ff6b6b; }

/* ═══════════════════════════════════════════════
   CONFIGURATION PANEL
   ═══════════════════════════════════════════════ */

.gs-config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.gs-config-section {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 12px;
    padding: 20px;
}

.gs-config-wide { grid-column: 1 / -1; }

.gs-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gs-section-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.gs-section-header h3 {
    margin: 0;
    color: #e2e8f0;
    font-size: 0.95rem;
    font-weight: 700;
}

.gs-hint {
    color: #64748b;
    font-size: 0.76rem;
    margin: 0 0 14px;
    line-height: 1.4;
}

/* ── Config rows ── */
.gs-config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.gs-config-row label {
    color: #94a3b8;
    font-size: 0.82rem;
    min-width: 180px;
}

.gs-input-number {
    width: 80px;
    padding: 7px 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}
.gs-input-number:focus { border-color: #14b8a6; }

.gs-input-select {
    padding: 7px 10px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}

/* ── Lead Time Phase Row ── */
.gs-phase-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 8px;
}

.gs-phase-row input[type="text"] {
    flex: 1;
    padding: 6px 10px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 0.82rem;
    outline: none;
}
.gs-phase-row input[type="text"]:focus { border-color: #14b8a6; }

.gs-phase-row .gs-phase-days {
    width: 60px;
    text-align: center;
}

.gs-phase-row .gs-phase-unit {
    color: #64748b;
    font-size: 0.78rem;
    min-width: 30px;
}

.gs-phase-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.5;
    transition: opacity 0.2s;
    padding: 4px;
}
.gs-phase-remove:hover { opacity: 1; }

/* ── LT Total display ── */
.gs-lt-total {
    color: #14b8a6;
    font-size: 0.85rem;
}
.gs-lt-total strong { font-size: 1.1rem; }

/* ── Service Level Row ── */
.gs-sl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 8px;
}

.gs-sl-label {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.75rem;
}

.gs-sl-arrow { color: #334155; font-size: 0.8rem; }
.gs-sl-z-label { color: #64748b; font-size: 0.78rem; }
.gs-sl-z-value { color: #14b8a6; font-weight: 700; font-size: 0.85rem; min-width: 55px; }

/* ── ABC Threshold Rows ── */
.gs-abc-thresholds {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

.gs-th-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.gs-th-row label {
    color: #94a3b8;
    font-size: 0.8rem;
    min-width: 90px;
}

/* ── Buttons ── */
.gs-btn-add {
    padding: 6px 14px;
    background: rgba(20, 184, 166, 0.08);
    border: 1px dashed rgba(20, 184, 166, 0.3);
    border-radius: 6px;
    color: #14b8a6;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.gs-btn-add:hover {
    background: rgba(20, 184, 166, 0.15);
    border-style: solid;
}

.gs-btn-save {
    padding: 12px 32px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}
.gs-btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

/* Platform LT row */
.gs-plat-lt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(30,41,59,0.5);
    border-radius: 8px;
}

.gs-plat-lt-row .gs-plat-icon {
    font-size: 0.85rem;
    min-width: 18px;
}

.gs-plat-lt-row .gs-plat-name {
    flex: 1;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ── Bug detail indicator ── */
.gs-bug-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: 4px;
    animation: inv-pulse-dot 2s infinite;
}

/* ── DOH color coding ── */
.gs-doh-critical { color: #ef4444; font-weight: 700; }
.gs-doh-warning { color: #f97316; font-weight: 600; }
.gs-doh-caution { color: #fbbf24; }
.gs-doh-ok { color: #22c55e; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .gs-config-grid { grid-template-columns: 1fr; }
    .gs-abc-thresholds { grid-template-columns: 1fr; }
}

/* ── Sortable Headers ── */
.gs-sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}
.gs-sortable:hover {
    color: #14b8a6;
}
.gs-sort-arrow {
    font-size: 0.6rem;
    color: #14b8a6;
    margin-left: 2px;
    opacity: 0.9;
}
