/* ===== AUTOMATIONS ===== */

.badge-automation-active {
    background: var(--success-color);
    color: #fff;
}

.badge-automation-inactive {
    background: var(--border-color);
    color: var(--text-color);
}

.badge-automation-disabled {
    background: var(--border-color);
    color: var(--text-muted);
    opacity: 0.7;
}

.automation-status-disabled {
    opacity: 0.6;
}

.automation-logic-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 4px;
}

/* Automation condition pills need more room than the default 180px */
[data-automation-id] .stream-card-prop {
    max-width: 280px;
}

/* Automation condition editor rows */
.automation-condition-row {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--bg-secondary, var(--bg-color));
}

.condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.condition-type-label {
    font-weight: 600;
    font-size: 0.9rem;
}

.condition-type-select {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.condition-always-desc {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.btn-remove-condition {
    background: none;
    border: none;
    color: var(--danger-color, #dc3545);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
}

.condition-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.condition-field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 3px;
    color: var(--text-muted);
}

.condition-field select,
.condition-field textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.9rem;
    font-family: inherit;
}

.condition-apps {
    resize: vertical;
    min-height: 60px;
}

.condition-apps-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-browse-apps {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-browse-apps:hover {
    border-color: var(--primary-color);
    background: rgba(33, 150, 243, 0.1);
}

.process-picker {
    margin-top: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.process-picker-search {
    width: 100%;
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
}

.process-picker-list {
    max-height: 160px;
    overflow-y: auto;
}

.process-picker-item {
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.1s;
}

.process-picker-item:hover {
    background: rgba(33, 150, 243, 0.15);
}

.process-picker-item.added {
    color: var(--text-muted);
    cursor: default;
    opacity: 0.6;
}

.process-picker-loading {
    padding: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* Webhook URL row */
.webhook-url-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.webhook-url-row input {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 0.8rem;
    font-family: monospace;
}

.btn-webhook-copy {
    white-space: nowrap;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
}

.webhook-save-hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin: 4px 0 0;
}
