/* v9.0.2 */
/**
 * teflon-processing.css - Ecosystem Sync V2 (4-Phase Wizard)
 */
.tefp-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 10040;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tefp-panel {
    position: fixed;
    z-index: 10041;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 1.2, 0.3, 1), opacity 0.3s;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    font-family: 'Inter', system-ui, sans-serif;
}

@media (min-width: 768px) {
    .tefp-panel {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        width: 1050px;
        max-width: 96vw;
        height: 80vh;
        max-height: 850px;
        border-radius: 16px;
        opacity: 0;
    }

    .tefp-panel.tefp-active {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .tefp-body-split {
        display: flex;
        flex-direction: row;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .tefp-col-controls {
        flex: 1.25;
        padding: 24px;
        overflow-y: auto;
        background: #f8fafc;
        border-right: 1px solid #e2e8f0;
    }

    .tefp-col-history {
        flex: 1;
        padding: 24px;
        overflow-y: auto;
        background: #fff;
        position: relative;
    }
}

@media (max-width: 767px) {
    .tefp-panel {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 92vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .tefp-panel.tefp-active {
        transform: translateY(0);
    }

    .tefp-body-split {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow-y: auto;
        padding-bottom: max(env(safe-area-inset-bottom, 20px), 20px);
    }

    .tefp-col-controls {
        padding: 20px;
        background: #f8fafc;
        border-bottom: 8px solid #f1f5f9;
        flex-shrink: 0;
    }

    .tefp-col-history {
        padding: 20px;
        background: #fff;
        min-height: 350px;
        position: relative;
    }
}

.tefp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.tefp-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tefp-badge {
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.tefp-close-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: #64748b;
    font-size: 18px;
    transition: all 0.2s;
}

.tefp-close-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

/* Visual Progress Stepper (4 steps) */
.tefp-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    padding: 0 5%;
}

.tefp-stepper::before {
    content: '';
    position: absolute;
    top: 18px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: #cbd5e1;
    z-index: 1;
}

.tefp-stepper-progress {
    position: absolute;
    top: 18px;
    left: 10%;
    height: 2px;
    background: #3b82f6;
    z-index: 2;
    transition: width 0.4s ease;
}

.tefp-step {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 25%;
}

.tefp-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f8fafc;
    color: #94a3b8;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cbd5e1;
    transition: all 0.3s;
}

.tefp-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-align: center;
    line-height: 1.3;
}

.tefp-step-label-sub {
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 400;
}

.tefp-step.is-completed .tefp-step-circle {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.tefp-step.is-completed .tefp-step-label {
    color: #10b981;
}

.tefp-step.is-active .tefp-step-circle {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.tefp-step.is-active .tefp-step-label {
    color: #2563eb;
    font-weight: 700;
}

/* Wizard Form Area */
.tefp-wizard-state {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    animation: tefpFadeIn 0.3s ease;
    position: relative;
}

@keyframes tefpFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tefp-state-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tefp-state-desc {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Inputs */
.tefp-form-group {
    margin-bottom: 20px;
    position: relative;
}

.tefp-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.tefp-label-sub {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
    margin-left: 6px;
}

.tefp-input,
.tefp-select {
    width: 100%;
    box-sizing: border-box;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14.5px;
    color: #0f172a;
    transition: all 0.2s;
    font-family: inherit;
}

.tefp-input:focus,
.tefp-select:focus {
    background: #fff;
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.tefp-textarea {
    resize: vertical;
    min-height: 90px;
}

.tefp-input[disabled] {
    background: #e2e8f0;
    color: #64748b;
    cursor: not-allowed;
}

.tefp-switch-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f5f9;
    padding: 12px;
    border-radius: 8px;
    margin-top: -8px;
}

.tefp-switch-toggle {
    width: 44px;
    height: 24px;
    background: #cbd5e1;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.tefp-switch-toggle.active {
    background: #3b82f6;
}

.tefp-switch-handle {
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tefp-switch-toggle.active .tefp-switch-handle {
    left: 22px;
}

.tefp-switch-label {
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
}

/* Submit Button */
.tefp-btn-submit {
    width: 100%;
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 16px;
    margin-top: 10px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.tefp-btn-submit:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

.tefp-btn-submit.btn-approve {
    background: #0ea5e9;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3);
}

.tefp-btn-submit.btn-sent {
    background: #f59e0b;
    box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.3);
}

.tefp-btn-submit.btn-recv {
    background: #10b981;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.tefp-btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Timeline History */
.tefp-history-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tefp-history-title-right {
    display: flex;
    gap: 10px;
}

.tefp-btn-new-log {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.tefp-btn-new-log:hover {
    background: #e2e8f0;
}

.tefp-timeline {
    position: relative;
    padding-left: 24px;
    margin-top: 10px;
}

.tefp-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 8px;
    width: 2px;
    background: #e2e8f0;
}

.tefp-tl-item {
    position: relative;
    margin-bottom: 28px;
}

.tefp-tl-dot {
    position: absolute;
    left: -25px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    z-index: 2;
}

.tefp-tl-content {
    background: #fcfcfc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 13.5px;
    color: #334155;
    position: relative;
    margin-left: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: 0.2s;
}

.tefp-tl-content:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.tefp-tl-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    align-items: flex-start;
}

.tefp-tl-status {
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tefp-tl-actions {
    display: flex;
    gap: 6px;
}

.tefp-tl-btn {
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: 0.2s;
    font-size: 14px;
}

.tefp-tl-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tefp-tl-row {
    display: flex;
    margin-bottom: 8px;
    gap: 8px;
    line-height: 1.5;
    align-items: flex-start;
}

.tefp-tl-lbl {
    color: #64748b;
    min-width: 90px;
    font-weight: 600;
    font-size: 13px;
}

.tefp-tl-val {
    flex: 1;
    word-break: break-word;
}

/* Status Colors (4 phases) */
.st-req {
    background: #eff6ff;
    color: #2563eb;
}

.dot-req {
    background: #3b82f6;
    box-shadow: 0 0 0 1px #93c5fd;
}

.st-appr {
    background: #e0f2fe;
    color: #0284c7;
}

.dot-appr {
    background: #0ea5e9;
    box-shadow: 0 0 0 1px #7dd3fc;
}

.st-sent {
    background: #fffbeb;
    color: #d97706;
}

.dot-sent {
    background: #f59e0b;
    box-shadow: 0 0 0 1px #fcd34d;
}

.st-done {
    background: #ecfdf5;
    color: #10b981;
}

.dot-done {
    background: #10b981;
    box-shadow: 0 0 0 1px #6ee7b7;
}

.tefp-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

.tefp-loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 12px;
    font-size: 24px;
    color: #3b82f6;
}