:root {
    --bg: #0d0f14;
    --surface: #161920;
    --surface-2: #1e2130;
    --border: #252838;
    --border-hover: #353a50;
    --text: #e2e4ed;
    --text-muted: #6b7280;
    --text-dim: #9ca3af;
    --up: #22c55e;
    --up-bg: rgba(34, 197, 94, 0.12);
    --down: #ef4444;
    --down-bg: rgba(239, 68, 68, 0.12);
    --accent: #6366f1;
    --accent-bg: rgba(99, 102, 241, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --border-focus: #6366f1;
}

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

body {
    font-family: "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ── Layout ─────────────────────────────────── */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -0.3px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent), #818cf8);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

nav a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 13.5px;
    transition:
        color 0.15s,
        background 0.15s;
}

nav a:hover,
nav a.active {
    color: var(--text);
    background: var(--surface-2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition:
        color 0.15s,
        background 0.15s,
        border-color 0.15s;
}

.btn-icon:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border-hover);
}

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ── Page header ─────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.page-header p {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13.5px;
}

/* ── Buttons ─────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition:
        opacity 0.15s,
        background 0.15s,
        box-shadow 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    opacity: 0.88;
}

.btn-ghost {
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.btn svg {
    width: 15px;
    height: 15px;
}

/* ── Stats bar ───────────────────────────────── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-value.up {
    color: var(--up);
}
.stat-value.down {
    color: var(--down);
}

.stat-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Incidents banner ────────────────────────── */
.incidents-banner {
    background: var(--down-bg);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.incidents-banner-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    color: var(--down);
}

.incidents-banner-body {
    flex: 1;
}

.incidents-banner-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--down);
    margin-bottom: 6px;
}

.incident-item {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.incident-item strong {
    color: var(--text);
}

/* ── Section ─────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
}

/* ── Monitor grid ────────────────────────────── */
.monitors-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.monitor-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: grid;
    grid-template-columns: auto 1fr auto auto auto auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition:
        border-color 0.15s,
        background 0.15s;
    text-decoration: none;
    color: inherit;
    margin-bottom: 10px;
}

.monitor-card:hover {
    border-color: var(--border-hover);
    background: var(--surface-2);
}

.monitor-card.disabled {
    opacity: 0.5;
}

/* status dot */
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-dot.up {
    background: var(--up);
    box-shadow: 0 0 0 3px var(--up-bg);
}

.status-dot.up::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--up);
    opacity: 0.2;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.down {
    background: var(--down);
    box-shadow: 0 0 0 3px var(--down-bg);
}

.status-dot.unknown {
    background: var(--text-muted);
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.2;
    }
    50% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.monitor-info {
    min-width: 0;
}

.monitor-name {
    font-size: 14.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-url {
    font-size: 12px;
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.monitor-uptime {
    text-align: right;
    min-width: 70px;
}

.uptime-pct {
    font-size: 14px;
    font-weight: 600;
}

.uptime-pct.high {
    color: var(--up);
}
.uptime-pct.mid {
    color: #f59e0b;
}
.uptime-pct.low {
    color: var(--down);
}

.uptime-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* sparkline */
.sparkline {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 28px;
}

.sparkline-bar {
    width: 4px;
    border-radius: 2px;
    background: var(--border);
    flex-shrink: 0;
}

.sparkline-bar.up {
    background: var(--up);
    opacity: 0.7;
}
.sparkline-bar.down {
    background: var(--down);
}

.monitor-response {
    text-align: right;
    min-width: 60px;
}

.response-time {
    font-size: 13px;
    font-weight: 500;
    font-family: "JetBrains Mono", monospace;
}

.response-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.monitor-interval {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    white-space: nowrap;
}

/* ── Empty state ─────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 20px;
}

/* ── Loading / error ─────────────────────────── */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 13.5px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-msg {
    background: var(--down-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--down);
    font-size: 13.5px;
}

/* ── Badge ───────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 500;
}

.badge-up {
    background: var(--up-bg);
    color: var(--up);
}
.badge-down {
    background: var(--down-bg);
    color: var(--down);
}

/* ── Footer ──────────────────────────────────── */
footer {
    border-top: 1px solid var(--border);
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .monitor-card {
        grid-template-columns: auto 1fr auto;
        gap: 10px 12px;
    }

    .sparkline,
    .monitor-interval,
    .monitor-response {
        display: none;
    }

    header {
        grid-template-columns: 1fr auto;
    }

    nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 6px 16px;
        gap: 8px;
        z-index: 100;
    }

    nav a {
        flex: 1;
        text-align: center;
        border-radius: var(--radius-sm);
    }

    main {
        padding-bottom: 70px;
    }

    .header-actions .btn {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: 1fr 1fr;
    }
    main {
        padding: 20px 16px;
    }
}

/* ── Monitor detail page ─────────────────────────────────────────────────── */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a:hover {
    color: var(--text);
}
.breadcrumb-sep {
    opacity: 0.4;
}

.monitor-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.monitor-hero-left {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.monitor-title {
    flex: 1;
}

.monitor-title h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.monitor-url-hero {
    font-family: "JetBrains Mono", monospace;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.monitor-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.meta-chip {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 12px;
    color: var(--text-dim);
    font-family: "JetBrains Mono", monospace;
}

.hero-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-top: 4px;
}

.status-badge.up {
    background: var(--up-bg);
    color: var(--up);
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.status-badge.down {
    background: var(--down-bg);
    color: var(--down);
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.status-badge.unknown {
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.status-dot-sm {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot-sm.up {
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.4;
    }
}

.btn-danger {
    background: var(--down-bg);
    color: var(--down);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
    opacity: 0.85;
}

/* ── Stats row ───────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-value.good {
    color: var(--up);
}
.stat-value.warn {
    color: #f59e0b;
}
.stat-value.bad {
    color: var(--down);
}

/* ── Card ────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 13.5px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.chart-wrap {
    position: relative;
    height: 180px;
}

/* ── Checks table ────────────────────────────── */
.checks-table {
    width: 100%;
    border-collapse: collapse;
}

.checks-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.checks-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    vertical-align: middle;
}

.checks-table tr:last-child td {
    border-bottom: none;
}
.checks-table tr:hover td {
    background: var(--surface-2);
}
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pill.up {
    background: var(--up-bg);
    color: var(--up);
}
.status-pill.down {
    background: var(--down-bg);
    color: var(--down);
}

.status-pill::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.code-cell {
    font-family: "JetBrains Mono", monospace;
    font-size: 12.5px;
}

.resp-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.resp-bar {
    height: 4px;
    border-radius: 2px;
    min-width: 2px;
}

.text-muted {
    color: var(--text-muted);
}
.text-dim {
    color: var(--text-dim);
}

/* ── Incidents list ──────────────────────────── */
.incidents-list {
    display: flex;
    flex-direction: column;
}

.incident-row {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    align-items: start;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.incident-row:last-child {
    border-bottom: none;
}

.incident-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
}

.incident-dot.active {
    background: var(--down);
    box-shadow: 0 0 0 3px var(--down-bg);
}
.incident-dot.resolved {
    background: var(--up);
}

.incident-title {
    font-size: 13.5px;
    font-weight: 500;
}

.incident-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.incident-duration {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-dim);
    white-space: nowrap;
    font-family: "JetBrains Mono", monospace;
}

/* ── Tabs ────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
}

.tab {
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.tab:hover {
    color: var(--text);
}
.tab.active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ── Empty/error states ──────────────────────── */
.empty-table {
    text-align: center;
    padding: 36px;
    color: var(--text-muted);
    font-size: 13.5px;
}

/* ── Delete modal ────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    max-width: 400px;
    width: 90%;
}

.modal h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}
.modal p {
    font-size: 13.5px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ── Notification tab ────────────────────────── */
.notif-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.channel-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.channel-row:last-child {
    border-bottom: none;
}

.channel-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.channel-type-badge.slack {
    background: rgba(74, 196, 123, 0.1);
    color: #4ac47b;
    border: 1px solid rgba(74, 196, 123, 0.2);
}
.channel-type-badge.webhook {
    background: var(--accent-bg);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.link-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.select-input {
    flex: 1;
    min-width: 160px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    padding: 9px 12px;
    outline: none;
    cursor: pointer;
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
}

/* ── Monitor detail responsive ───────────────── */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .monitor-hero {
        flex-direction: column;
    }
    .checks-table th:nth-child(3),
    .checks-table td:nth-child(3) {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ── Create / Edit monitor page ──────────────────────────────────────────── */

.page-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.page-desc {
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 32px;
}

/* ── Form card ───────────────────────────────── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.form-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field-row {
    display: grid;
    gap: 16px;
}
.field-row-2 {
    grid-template-columns: 1fr 1fr;
}
.field-row-3 {
    grid-template-columns: 2fr 1fr 1fr;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
}

.label-hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 6px;
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13.5px;
    padding: 9px 12px;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    appearance: none;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.field-error {
    font-size: 12px;
    color: var(--down);
}

.input-error {
    border-color: var(--down) !important;
    box-shadow: none !important;
}

/* ── URL preview ─────────────────────────────── */
.url-preview {
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    color: var(--text-muted);
    min-height: 16px;
    transition: color 0.15s;
}

.url-preview.valid {
    color: var(--up);
}
.url-preview.invalid {
    color: var(--down);
}

/* ── Method picker ───────────────────────────── */
.method-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.method-pill {
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: "JetBrains Mono", monospace;
    user-select: none;
}

.method-pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.method-pill.selected {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: #818cf8;
}

/* ── Status code tags ────────────────────────── */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    min-height: 42px;
    align-items: center;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    cursor: text;
}

.tags-input:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--accent-bg);
    border: 1px solid rgba(99, 102, 241, 0.25);
    color: #818cf8;
    font-size: 12.5px;
    font-family: "JetBrains Mono", monospace;
}

.tag-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 14px;
    line-height: 1;
    transition: opacity 0.1s;
}

.tag-remove:hover {
    opacity: 1;
}

.tags-text-input {
    flex: 1;
    min-width: 60px;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: "JetBrains Mono", monospace;
    font-size: 13px;
    padding: 0;
    box-shadow: none;
}

/* ── Toggle switch ───────────────────────────── */
.toggle-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
}

.toggle-info {
    flex: 1;
}

.toggle-label-text {
    font-size: 13.5px;
    font-weight: 500;
}

.toggle-description {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    display: none;
}

.switch-track {
    position: absolute;
    inset: 0;
    background: var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.switch-track::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 3px;
    left: 3px;
    transition:
        transform 0.2s,
        background 0.2s;
}

.switch input:checked + .switch-track {
    background: var(--accent);
}
.switch input:checked + .switch-track::after {
    transform: translateX(20px);
    background: #fff;
}

/* ── Interval presets ────────────────────────── */
.preset-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.preset-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

/* ── Form actions ────────────────────────────── */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
}

/* ── Alert ───────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}

.alert-error {
    background: var(--down-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--down);
}
.alert-success {
    background: var(--up-bg);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--up);
}

/* ── Submit button spinner ───────────────────── */
.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Create page main is narrower ────────────── */
main.narrow {
    max-width: 680px;
}

/* ── Notifications page ──────────────────────────────────────────────────── */

.btn-sm {
    padding: 5px 10px;
    font-size: 12.5px;
}
.btn-sm svg {
    width: 13px;
    height: 13px;
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.channel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.15s;
}

.channel-card:hover {
    border-color: var(--border-hover);
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 14.5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.channel-url {
    font-size: 12px;
    color: var(--text-muted);
    font-family: "JetBrains Mono", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 3px;
}

.channel-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* ── Type badge (channel list) ───────────────── */
.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.type-badge.webhook {
    background: var(--accent-bg);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.type-badge.slack {
    background: rgba(74, 196, 123, 0.1);
    color: #4ac47b;
    border: 1px solid rgba(74, 196, 123, 0.2);
}

/* ── Type picker (modal) ─────────────────────── */
.type-picker {
    display: flex;
    gap: 6px;
}

.type-pill {
    padding: 6px 14px;
    border-radius: 5px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.type-pill:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.type-pill.selected {
    background: var(--accent-bg);
    border-color: var(--accent);
    color: #818cf8;
}

/* ── Modal subtitle + wider modal ────────────── */
.modal-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.modal-wide {
    max-width: 460px;
}

@media (max-width: 768px) {
    .channel-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .channel-actions {
        width: 100%;
    }
    .channel-url {
        white-space: normal;
        word-break: break-all;
    }
}

/* ── Create page responsive ──────────────────── */
@media (max-width: 540px) {
    .field-row-2,
    .field-row-3 {
        grid-template-columns: 1fr;
    }
}
