/*
 * Вкладка «Расписание», раздел «Задачи по событию»: блок с адресом вебхука, история срабатываний.
 * Остальное (карточки, форма, чипы) — классы schedule-* из hermes-schedule.css.
 * Цвета — только токены app.css / hermes-shell.css. Подключается после hermes-schedule.css.
 */

/* Раздел идёт сразу под расписанием: убираем двойной верхний отступ. */
.hermes-dashboard .event-trigger-panel {
    padding-top: 0;
}

.hermes-dashboard .event-trigger-panel .schedule-head__text h2 {
    font-size: 1.1rem;
}

.hermes-dashboard .event-trigger-filter {
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--hermes-line);
    border-radius: 10px;
}

.hermes-dashboard .event-trigger-filter label {
    flex: 1 1 14rem;
}

.hermes-dashboard .event-trigger-filter small {
    flex: 1 1 100%;
}

.hermes-dashboard .event-trigger-limit input[type="number"] {
    width: 100%;
    max-width: 10rem;
    min-height: 2.55rem;
    padding: 0.62rem 0.68rem;
    color: var(--hermes-text);
    border: 1px solid rgb(var(--hermes-ink-rgb) / calc(0.11 * var(--hermes-line-a)));
    border-radius: 10px;
    background: var(--hermes-bg-2);
    font: inherit;
    font-weight: 450;
}

.hermes-dashboard .event-trigger-limit input[type="number"]:focus-visible {
    outline: 2px solid var(--hermes-accent);
    outline-offset: 1px;
    border-color: rgb(var(--hermes-accent-rgb) / 0.5);
}

.hermes-dashboard .schedule-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hermes-dashboard .schedule-chip:disabled:hover {
    color: var(--hermes-muted);
    background: transparent;
}

/* ---------- адрес вебхука (показывается один раз) ---------- */

.hermes-dashboard .event-trigger-reveal {
    display: grid;
    gap: 0.6rem;
    min-width: 0;
    padding: 1rem 1.1rem;
    border: 1px solid rgb(var(--hermes-accent-rgb) / 0.45);
    border-radius: 10px;
    background: rgb(var(--hermes-accent-rgb) / 0.1);
}

.hermes-dashboard .event-trigger-reveal > strong {
    color: var(--hermes-text);
    font-size: 0.95rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.hermes-dashboard .event-trigger-reveal p {
    margin: 0;
    color: var(--hermes-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.hermes-dashboard .event-trigger-reveal__label {
    color: var(--hermes-soft);
    font-size: 0.6875rem !important;
    font-weight: 650;
    letter-spacing: 0.02em;
}

.hermes-dashboard .event-trigger-reveal__fail {
    color: var(--hermes-danger-ink) !important;
}

.hermes-dashboard .event-trigger-reveal__url {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.hermes-dashboard .event-trigger-reveal__url code,
.hermes-dashboard .event-trigger-reveal__curl {
    min-width: 0;
    padding: 0.55rem 0.7rem;
    color: var(--hermes-text);
    border-radius: 8px;
    background: var(--hermes-bg-2);
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.hermes-dashboard .event-trigger-reveal__url code {
    flex: 1 1 auto;
}

.hermes-dashboard .event-trigger-reveal__url .button {
    flex: 0 0 auto;
}

.hermes-dashboard .event-trigger-reveal__curl {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
}

.hermes-dashboard .event-trigger-reveal__curl code {
    padding: 0;
    background: transparent;
    font: inherit;
}

/* ---------- карточка и история ---------- */

.hermes-dashboard .event-trigger-hint {
    font-family: var(--hermes-mono, "JetBrains Mono", monospace);
    overflow-wrap: anywhere;
}

.hermes-dashboard .event-trigger-history {
    display: grid;
    gap: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px solid var(--hermes-line);
}

.hermes-dashboard .event-trigger-history > .button {
    justify-self: start;
}

.hermes-dashboard .event-trigger-runs {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hermes-dashboard .event-trigger-run {
    display: grid;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--hermes-line);
    border-radius: 8px;
}

.hermes-dashboard .event-trigger-run--failed {
    border-color: rgb(var(--hermes-danger-rgb) / 0.32);
}

.hermes-dashboard .event-trigger-run--skipped {
    background: transparent;
    opacity: 0.85;
}

.hermes-dashboard .event-trigger-run__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    color: var(--hermes-dim);
    font-size: 0.75rem;
}

.hermes-dashboard .event-trigger-run__cost {
    margin-left: auto;
    color: var(--hermes-muted);
    font-weight: 600;
}

.hermes-dashboard .event-trigger-run__summary,
.hermes-dashboard .event-trigger-run__reply {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.hermes-dashboard .event-trigger-run__summary {
    color: var(--hermes-text);
}

.hermes-dashboard .event-trigger-run__reply {
    display: -webkit-box;
    overflow: hidden;
    color: var(--hermes-dim);
    white-space: pre-line;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hermes-dashboard .event-trigger-run__note {
    color: var(--hermes-dim);
    font-size: 0.6875rem;
}

.hermes-dashboard .event-trigger-run > .button {
    justify-self: start;
}

/* ---------- телефон ---------- */

@media (max-width: 760px) {
    .hermes-dashboard .event-trigger-panel {
        padding-top: 0;
    }

    .hermes-dashboard .event-trigger-reveal {
        padding: 0.9rem;
    }

    .hermes-dashboard .event-trigger-reveal__url {
        flex-direction: column;
        align-items: stretch;
    }

    .hermes-dashboard .event-trigger-limit input[type="number"],
    .hermes-dashboard .event-trigger-filter input[type="text"],
    .hermes-dashboard .event-trigger-filter select {
        font-size: 1rem;
    }

    .hermes-dashboard .event-trigger-limit input[type="number"] {
        max-width: none;
    }

    .hermes-dashboard .event-trigger-run__cost {
        margin-left: 0;
    }
}
