/* ═══════════════════════════════════════════════════════════
   Scheduler Wizard — ProgramScheduleWizard styles
   ═══════════════════════════════════════════════════════════ */

/* ── Wizard Step Indicator ── */
.wizard-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 0 16px;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wizard-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.wizard-step-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: color 0.2s;
}

.wizard-step--active .wizard-step-num {
    background: var(--accent);
    color: #fff;
}

.wizard-step--active .wizard-step-label {
    color: var(--accent);
    font-weight: 600;
}

.wizard-step--done .wizard-step-num {
    background: var(--success);
    color: #fff;
}

.wizard-step--done .wizard-step-label {
    color: var(--success);
}

.wizard-step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    max-width: 60px;
    transition: background 0.2s;
}

.wizard-step-connector--done {
    background: var(--success);
}

/* ── Wizard Content Area ── */
.wizard-content {
    min-height: 300px;
    padding: 4px 0;
}

.wizard-hint {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.85rem;
}

/* ── Loading / Error States ── */
.wizard-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.wizard-error {
    padding: 16px;
    border-radius: 8px;
    background: rgba(var(--danger-rgb), 0.1);
    border: 1px solid rgba(var(--danger-rgb), 0.3);
    color: var(--danger);
    margin: 16px 0;
}

/* ── Step 1: Part Selection ── */
.program-wizard-parts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-wizard-part {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.program-wizard-part:hover {
    background: var(--bg-tertiary);
}

.program-wizard-part--selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

.program-wizard-part-check {
    display: flex;
    align-items: center;
}

.program-wizard-part-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.program-wizard-part-info {
    flex: 1;
    min-width: 0;
}

.program-wizard-part-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.program-wizard-part-number {
    font-weight: 600;
    font-size: 0.9rem;
}

.program-wizard-part-name {
    color: var(--text-muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.program-wizard-part-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.program-wizard-part-wo {
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── Step 2: Program Matching ── */
.program-wizard-match {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.program-wizard-match-header {
    margin-bottom: 12px;
}

.program-wizard-match-part {
    font-weight: 600;
    font-size: 0.9rem;
}

.program-wizard-match-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.program-wizard-match-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.program-wizard-match-option:hover {
    border-color: var(--accent);
}

.program-wizard-match-option--selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.06);
}

.program-wizard-match-option-radio {
    display: flex;
    align-items: center;
}

.program-wizard-match-option-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.program-wizard-match-option-info {
    flex: 1;
    min-width: 0;
}

.program-wizard-match-option-name {
    font-weight: 500;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.program-wizard-match-option-detail {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.program-wizard-no-match {
    padding: 12px;
    background: rgba(var(--warning-rgb), 0.08);
    border: 1px solid rgba(var(--warning-rgb), 0.25);
    border-radius: 6px;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Step 3: Run Configuration ── */
.program-wizard-run-config {
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
}

.program-wizard-run-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.program-wizard-run-part {
    font-weight: 600;
    font-size: 0.9rem;
}

.program-wizard-run-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.program-wizard-run-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.program-wizard-run-input label {
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
}

.program-wizard-run-input input[type="number"] {
    text-align: center;
}

/* ── Step 4: Schedule & Summary ── */
.program-wizard-schedule-options {
    margin-bottom: 20px;
}

.program-wizard-machine-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.program-wizard-machine-select label {
    min-width: 100px;
    font-weight: 500;
}

.program-wizard-summary {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-top: 16px;
}

.program-wizard-summary h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ── Downstream Program Stages ── */
.downstream-stage {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
}

.downstream-stage--ready {
    border-left: 3px solid var(--success);
}

.downstream-stage--default {
    border-left: 3px solid var(--warning);
}

.downstream-stage--missing {
    border-left: 3px solid var(--danger);
}

/* ── Build Variations Table ── */
.build-variations-table {
    margin-top: 8px;
}

.build-variations-table .table,
.program-wizard-summary .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border);
    --bs-table-accent-bg: transparent;
    --bs-table-bg-type: transparent;
    --bs-table-bg-state: transparent;
    --bs-table-color-type: var(--text-primary);
    --bs-table-color-state: var(--text-primary);
    font-size: 0.82rem;
    margin-bottom: 0;
}

.build-variations-table .table > :not(caption) > * > *,
.program-wizard-summary .table > :not(caption) > * > * {
    background-color: transparent;
    box-shadow: none;
    color: var(--text-primary);
    border-bottom-color: var(--border);
}

.build-variations-table th,
.program-wizard-summary th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.build-variations-table td,
.program-wizard-summary td {
    vertical-align: middle;
    padding: 8px 6px;
}

.build-variations-table .form-control-sm {
    padding: 2px 6px;
    font-size: 0.8rem;
    height: auto;
}

/* ── Build Coverage Bar ── */
.build-coverage-bar {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

/* ═══════════════════════════════════════════════════════════
   Responsive: Tablet
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .wizard-steps {
        gap: 4px;
        padding: 0 8px;
        margin-bottom: 16px;
    }
    .wizard-step-label {
        font-size: 0.68rem;
    }
    .wizard-step-connector {
        max-width: 32px;
    }
    .wizard-content {
        min-height: 200px;
    }
    .program-wizard-match-option {
        padding: 12px;
        min-height: 44px;
    }
    .program-wizard-match-option-radio input[type="radio"] {
        width: 20px;
        height: 20px;
    }
    .program-wizard-part-check input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }
    .program-wizard-machine-select {
        flex-direction: column;
        align-items: stretch;
    }
    .program-wizard-machine-select label {
        min-width: 0;
    }
    .program-wizard-run-detail {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ═══════════════════════════════════════════════════════════
   Responsive: Phone
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .wizard-steps {
        gap: 2px;
        padding: 0 4px;
    }
    .wizard-step-num {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }
    .wizard-step-label {
        font-size: 0.62rem;
    }
    .wizard-step-connector {
        max-width: 20px;
    }
    .program-wizard-part {
        padding: 10px;
        gap: 10px;
    }
    .program-wizard-match {
        padding: 10px;
    }
    .program-wizard-run-config {
        padding: 10px;
    }
}
