/* ── Pipeline Manager — page-specific ── */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #06060e;
    --surface: #0d0d1c;
    --surface2: #141428;
    --surface3: #1c1c35;
    --border: #252540;
    --border2: #353560;
    --accent: #7b61ff;
    --accent2: #ff6b9d;
    --accent3: #00e5a0;
    --green: #00e5a0;
    --red: #ff4d6d;
    --yellow: #ffd166;
    --blue: #4da6ff;
    --text: #eeeeff;
    --muted: #6666a0;
    --muted2: #4a4a7a;
}

body {
    font-family: 'Noto Sans Thai', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    margin-left: var(--sidebar-w, 220px);
    flex: 1;
    padding: 24px;
    display: flex;
    gap: 20px;
}

.panel {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface3);
}

.panel-title {
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    flex: 1;
}

.btn-add {
    padding: 8px 12px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 12px;
}

.btn-add:hover {
    background: #8d7aff;
}

.left-panel {
    width: 280px;
    min-width: 280px;
}

.center-panel {
    flex: 1;
    min-width: 300px;
}

.right-panel {
    width: 350px;
}

.pipeline-list {
    flex: 1;
    overflow-y: auto;
}

.pipeline-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pipeline-row:hover {
    background: var(--surface3);
}

.pipeline-row.active {
    background: var(--accent);
    color: white;
}

.pipeline-icon {
    font-size: 16px;
}

.pipeline-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.pipeline-meta {
    font-size: 11px;
    opacity: 0.7;
}

.pipeline-status {
    font-size: 10px;
    background: var(--green);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: auto;
}

.pipeline-row.active .pipeline-status {
    background: rgba(255,255,255,0.3);
}

.agents-list {
    flex: 1;
    overflow-y: auto;
}

.agent-row {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 40px 1fr 140px 120px 80px;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.agent-order {
    font-weight: 600;
    color: var(--muted);
}

.agent-name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-model {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--muted);
}

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

.btn-small {
    padding: 6px 10px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Noto Sans Thai', sans-serif;
}

.btn-small:hover {
    background: var(--border);
}

.can-reject {
    color: var(--green);
    font-size: 11px;
}

.drag-hint {
    padding: 12px 16px;
    font-size: 11px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    text-align: center;
}

.token-stats {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--muted);
}

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--muted);
}

input[type="text"], select, textarea {
    width: 100%;
    padding: 10px;
    background: var(--surface3);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 12px;
}

textarea {
    resize: vertical;
    min-height: 200px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.variables-section {
    margin-top: 16px;
    padding: 12px;
    background: var(--surface3);
    border-radius: 6px;
    font-size: 11px;
}

.variables-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--muted);
}

.variable-item {
    padding: 4px 8px;
    background: var(--surface);
    border-radius: 4px;
    margin: 4px 0;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent3);
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-switch.on {
    background: var(--green);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 10px;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
}

.toggle-switch.on::after {
    left: 22px;
}

.toggle-label {
    font-size: 12px;
    font-weight: 600;
}

.btn-save {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Noto Sans Thai', sans-serif;
    font-size: 13px;
    margin-top: 16px;
}

.btn-save:hover {
    background: #8d7aff;
}
