/* صفحه کمپین — محصول پنل، نه لندینگ */

.camp-page {
    padding-bottom: 96px;
}

.camp-empty {
    max-width: 520px;
    margin: 24px auto;
}

.camp-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.camp-metric {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.camp-metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.camp-metric strong {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.camp-metric-hint code {
    display: inline-block;
    margin: 2px 2px 0 0;
    padding: 2px 6px;
    background: #f0fdfa;
    color: #0f766e;
    border-radius: 6px;
    font-size: 0.75rem;
}

.camp-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.camp-side {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    position: sticky;
    top: 12px;
}

.camp-side-title,
.camp-side h3,
.camp-main-head h2,
.camp-result h3 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text);
}

.camp-channels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.camp-channel {
    text-align: right;
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 12px;
    padding: 12px 14px;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.camp-channel:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.camp-channel.is-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.camp-channel-name {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
}

.camp-channel-desc {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.camp-channel-dot {
    position: absolute;
    left: 12px;
    top: 14px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}

.camp-channel-dot.is-ready { background: #10b981; }
.camp-channel-dot.is-blocked { background: #f59e0b; }

.camp-conn {
    font-size: 0.84rem;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    background: #f8fafc;
    line-height: 1.5;
}

.camp-conn.is-ready {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.camp-conn.is-blocked {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.camp-auth {
    border: 1px solid #99f6e4;
    background: #f0fdfa;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
}

.camp-auth label,
.camp-timing label,
.camp-step label {
    display: block;
    font-weight: 600;
    font-size: 0.8rem;
    margin: 10px 0 4px;
}

.camp-auth input,
.camp-timing input,
.camp-step input,
.camp-step textarea,
.camp-step select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    background: #fff;
    outline: none;
}

.camp-auth input:focus,
.camp-timing input:focus,
.camp-step input:focus,
.camp-step textarea:focus,
.camp-step select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.camp-auth .btn {
    width: 100%;
    margin-top: 10px;
}

.camp-timing-note {
    color: var(--muted);
    font-size: 0.78rem;
    margin-top: 10px;
    line-height: 1.5;
}

.camp-main {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    min-height: 420px;
}

.camp-main-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.camp-main-sub {
    color: var(--muted);
    font-size: 0.86rem;
    margin-top: 4px;
}

.camp-add-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.camp-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.camp-step {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fafc;
    position: relative;
    padding-right: 52px;
    animation: campIn 0.22s ease-out;
}

@keyframes campIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

.camp-step-index {
    position: absolute;
    right: 12px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camp-step-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 4px;
}

.camp-step-top strong {
    font-size: 0.92rem;
}

.camp-step-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.camp-step-actions .btn,
.camp-step-actions .btn-del {
    padding: 5px 10px;
    font-size: 0.78rem;
}

.camp-step textarea {
    min-height: 88px;
    resize: vertical;
}

.camp-step-file {
    margin-top: 8px;
    padding: 10px;
    border: 1px dashed #99f6e4;
    border-radius: 8px;
    background: #fff;
}

.camp-step-file-name {
    color: var(--primary-dark);
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 6px;
}

.camp-result {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.camp-result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.camp-pill {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text);
}

.camp-pill.ok { background: #d1fae5; color: #065f46; }
.camp-pill.bad { background: #fee2e2; color: #991b1b; }
.camp-pill.skip { background: #fef3c7; color: #92400e; }

.camp-log {
    display: none;
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 0.76rem;
    white-space: pre-wrap;
    direction: ltr;
    text-align: left;
    max-height: 220px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.camp-bar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 30;
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.camp-bar-info {
    font-size: 0.88rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.camp-bar-info strong { color: var(--text); }

.camp-bar-sep { opacity: 0.5; }

.camp-bar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.camp-bar-actions .form-error {
    margin: 0;
    padding: 6px 10px;
}

.camp-send {
    min-width: 140px;
}

.camp-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .camp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .camp-layout { grid-template-columns: 1fr; }
    .camp-side { position: static; }
}

@media (max-width: 640px) {
    .camp-metrics { grid-template-columns: 1fr 1fr; }
    .camp-metric-hint { grid-column: 1 / -1; }
    .camp-step { padding-right: 16px; padding-top: 48px; }
    .camp-step-index { right: auto; left: 12px; top: 12px; }
    .camp-bar { left: 8px; right: 8px; bottom: 8px; }
    .camp-page { padding-bottom: 120px; }
}
