/* ═══════════════════════════════════════════════
   Compras — Panel de Pendientes
   Premium layer mirroring Histórico OC design
   Design tokens: --pv-* (desarrollo/main.css)
   Shared dashboard classes: ho-* (historico.css)
   ═══════════════════════════════════════════════ */

/* ── Tab Bar (Desarrollo-style) ──────────────── */
.pend-tabs-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pend-tabs-bar::-webkit-scrollbar { display: none; }

.pend-tab {
    position: relative;
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-family: var(--pv-font-ui, 'Inter', sans-serif);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: rgba(255, 255, 255, 0.38);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.pend-tab:hover {
    color: rgba(255, 255, 255, 0.65);
}
.pend-tab--active {
    color: #e0e7ff;
    border-bottom: 2px solid #818cf8;
    font-weight: 600;
}

.pend-tabs-search {
    margin-left: auto;
    display: flex;
    align-items: center;
    padding: 0 4px;
}
.pend-tabs-search .ho-search-input {
    min-width: 200px;
}



/* ── Filter Container (checkboxes) ───────────── */
.cp-filter-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--pv-glass-surface);
    backdrop-filter: var(--pv-glass-blur);
    -webkit-backdrop-filter: var(--pv-glass-blur);
    border: 1px solid var(--pv-glass-border);
    border-radius: var(--pv-card-radius);
    flex-wrap: wrap;
    align-items: center;
}

.cp-filter-label {
    font-family: var(--pv-font-ui);
    font-weight: 700;
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-sm);
    margin-right: 0.25rem;
    white-space: nowrap;
}

.cp-filter-check {
    display: flex;
    align-items: center;
    color: var(--pv-text-primary);
    font-family: var(--pv-font-ui);
    font-size: var(--pv-text-sm);
    cursor: pointer;
    background: var(--pv-bg-base);
    padding: 0.3rem 0.65rem;
    border-radius: 9999px;
    border: 1px solid var(--pv-card-border);
    transition: all var(--pv-duration-fast) ease;
    white-space: nowrap;
}

.cp-filter-check:hover {
    border-color: var(--pv-green);
}

.cp-filter-check input {
    margin-right: 0.5rem;
    accent-color: var(--pv-green);
}

/* ── Filter Pill Active State ────────────────── */
.cp-pend-filter-pill {
    transition: all 0.2s ease !important;
}

.cp-pend-filter-pill.active {
    background: rgba(129, 140, 248, 0.22) !important;
    border-color: rgba(129, 140, 248, 0.5) !important;
    color: #e0e7ff !important;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.15);
}

.ho-btn-warning.cp-pend-filter-pill.active {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.5) !important;
    color: #fef3c7 !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

/* ── Error Row Highlight ─────────────────────── */
.cp-pend-row--error .ho-td {
    background: rgba(239, 68, 68, 0.08) !important;
}

.cp-pend-row--error:hover .ho-td {
    background: rgba(239, 68, 68, 0.14) !important;
}

/* ── Cell Helpers ─────────────────────────────── */
.cp-cell-desc {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cp-cell-missing {
    font-size: 0.73rem;
}

.cp-cell-missing--error {
    color: #f87171;
    font-weight: 700;
}

.cp-cell-missing--warning {
    color: #fbbf24;
}

/* ── Status Badges (premium aligned) ─────────── */
.cp-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 72px;
    text-transform: uppercase;
}

.cp-status-badge--pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.cp-status-badge--atrasada {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.cp-status-badge--recibida {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* ── Action Buttons (premium aligned) ────────── */
.cp-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cp-btn-action--danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.cp-btn-action--danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.cp-btn-action--success {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.25);
}

.cp-btn-action--success:hover {
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

/* ── Lote cell mono font ─────────────────────── */
.cp-lote-cell {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ── Search Input (inherits from global .search-input) ── */
#compras-seguimiento-table .text-muted {
    color: var(--pv-text-muted);
}

/* ── Table Column Width Overrides ────────────── */
/* Override ho-td white-space:nowrap for pendientes table
   so the Acción column stays visible without horizontal scroll */
#compras-seguimiento-table {
    table-layout: fixed;
    width: 100%;
}

#compras-seguimiento-table .ho-td {
    white-space: normal;
    word-break: break-word;
}

#compras-seguimiento-table .ho-th:nth-child(1),
#compras-seguimiento-table .ho-td:nth-child(1) { width: 70px; }   /* ID O.C */

#compras-seguimiento-table .ho-th:nth-child(2),
#compras-seguimiento-table .ho-td:nth-child(2) { width: 28%; }    /* SKU / Descripción */

#compras-seguimiento-table .ho-th:nth-child(3),
#compras-seguimiento-table .ho-td:nth-child(3) { width: 60px; }   /* Cant. */

#compras-seguimiento-table .ho-th:nth-child(4),
#compras-seguimiento-table .ho-td:nth-child(4) { width: 20%; }    /* Info. Faltante */

#compras-seguimiento-table .ho-th:nth-child(5),
#compras-seguimiento-table .ho-td:nth-child(5) { width: 90px; }   /* Lote */

#compras-seguimiento-table .ho-th:nth-child(6),
#compras-seguimiento-table .ho-td:nth-child(6) { width: 90px; }   /* Estatus */

#compras-seguimiento-table .ho-th:nth-child(7),
#compras-seguimiento-table .ho-td:nth-child(7) { width: 85px; }   /* Acción */

/* ── Toggle Switch (.pend-cfg-cb) ────────────── */
.pend-cfg-cb {
    appearance: none !important;
    -webkit-appearance: none !important;
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #334155;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    outline: none;
    vertical-align: middle;
}
.pend-cfg-cb:checked {
    background: #f59e0b;
}
.pend-cfg-cb::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
}
.pend-cfg-cb:checked::after {
    transform: translateX(16px);
}

/* ── Pagos Period Navigator (force horizontal) ── */
#pagos-period-nav {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
}

#pagos-period-nav button {
    flex-shrink: 0;
}