/* ============================================================
   Scheduler & Webhooks — Job views, webhook forms, deliveries
   ============================================================ */

/* ── Scheduler View ────────────────────────────────────────── */

.scheduler-view {
    padding: 20px 24px;
    overflow-y: auto;
    height: 100%;
}

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

.sched-header h2 {
    margin: 0;
    font-size: 18px;
}

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

.sched-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 12px;
}

.sched-prompt {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 200px;
    overflow-y: auto;
}

.sched-runs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 8px;
}

.sched-runs-table th,
.sched-runs-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.sched-runs-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.sched-status {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.status-ok      { color: var(--success); }
.status-err     { color: var(--error); }
.status-running { color: var(--accent); }

.run-session-link {
    color: var(--accent);
    font-size: 11px;
    margin-left: 6px;
}

.sched-runs-section,
.sched-prompt-section {
    margin-top: 16px;
}

.sched-runs-section h3,
.sched-prompt-section h3 {
    font-size: 14px;
    margin-bottom: 8px;
}

.sched-dot {
    font-size: 10px;
    margin-right: 4px;
}

.sched-cron {
    font-family: var(--font-mono);
}

/* ── Webhook Modal ─────────────────────────────────────────── */

.webhook-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border);
    gap: 12px;
    margin-bottom: 6px;
}

.webhook-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.webhook-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.webhook-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.webhook-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.webhook-auto-disabled {
    font-size: 11px;
    color: var(--error);
    font-style: italic;
}

.webhook-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-active   { background: var(--success); }
.dot-inactive { background: var(--text-muted); }

.webhook-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.webhook-empty {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 24px 0;
}

/* ── Event Filter Checkboxes ───────────────────────────────── */

.event-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 4px 0;
}

.checkbox-inline {
    flex-direction: row !important;
    align-items: center;
    gap: 6px !important;
    font-size: 13px !important;
    color: var(--text-primary) !important;
    cursor: pointer;
    white-space: nowrap;
}

/* ── Webhook Form ──────────────────────────────────────────── */

.webhook-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.webhook-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}

.webhook-form input[type="text"],
.webhook-form input[type="url"],
.webhook-form input[type="number"],
.webhook-form select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 6px 8px;
    outline: none;
}

.webhook-form input:focus,
.webhook-form select:focus {
    border-color: var(--accent);
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    cursor: pointer;
    font-size: 13px !important;
    color: var(--text-primary) !important;
}

/* ── Delivery History ──────────────────────────────────────── */

.delivery-row {
    display: grid;
    grid-template-columns: 80px 130px 90px 1fr 150px;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 4px;
    font-size: 12px;
    border-left: 3px solid var(--border);
    margin-bottom: 4px;
}

.delivery-ok      { border-left-color: var(--success); }
.delivery-fail    { border-left-color: var(--error); }
.delivery-pending { border-left-color: var(--warning); }

.delivery-status {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.04em;
}

.delivery-ok   .delivery-status { color: var(--success); }
.delivery-fail .delivery-status { color: var(--error); }
.delivery-pending .delivery-status { color: var(--warning); }

.delivery-agent { color: var(--accent); font-family: var(--font-mono); font-size: 11px; }
.delivery-event { color: var(--text-secondary); }

.delivery-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

.delivery-ts {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
}

.delivery-error {
    grid-column: 1 / -1;
    color: var(--error);
    font-size: 11px;
    padding-left: 4px;
    font-family: var(--font-mono);
}
