:root {
    --bg: #f3f7fb;
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: #ffffff;
    --surface-alt: #eef4fb;
    --text: #18212b;
    --muted: #617081;
    --accent: #0d9488;
    --accent-dark: #0f766e;
    --accent-soft: rgba(13, 148, 136, 0.12);
    --up: #15803d;
    --down: #dc2626;
    --unknown: #a16207;
    --border: rgba(138, 163, 191, 0.24);
    --shadow: 0 16px 45px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.06);
    --radius: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 148, 136, 0.18), transparent 24%),
        radial-gradient(circle at right 10% top 15%, rgba(59, 130, 246, 0.12), transparent 20%),
        linear-gradient(180deg, #f7fbff 0%, #edf3f9 100%);
    min-height: 100vh;
}

.page-shell {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.18) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 85%);
}

a {
    color: var(--accent-dark);
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.site-header {
    border-bottom: 1px solid var(--border);
    background: rgba(247, 251, 255, 0.72);
    backdrop-filter: blur(18px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    gap: 18px;
}

.brand {
    font-size: 1.7rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.main-nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 999px;
    transition: background-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.main-nav a:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.hero,
.card,
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.hero {
    margin: 28px 0 22px;
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -80px;
    top: -70px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.22), transparent 70%);
}

.grid {
    display: grid;
    gap: 20px;
}

.grid.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    padding: 24px;
}

.card h2,
.card h3,
.hero h1,
.login-card h1 {
    margin-top: 0;
}

.hero h1,
.login-card h1,
.section-head h2 {
    letter-spacing: -0.04em;
}

.hero h1 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    margin-bottom: 12px;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 26px 0 14px;
}

.section-head.compact {
    margin: 0 0 18px;
}

.section-head h2 {
    margin: 0;
    font-size: 1.4rem;
}

.stats-grid {
    margin-top: 26px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 244, 251, 0.9));
    border: 1px solid rgba(138, 163, 191, 0.2);
    box-shadow: var(--shadow-soft);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-value {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    letter-spacing: -0.04em;
}

.target-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.meta,
.history-table td small {
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-up {
    background: rgba(47, 133, 90, 0.12);
    color: var(--up);
}

.badge-down {
    background: rgba(197, 48, 48, 0.12);
    color: var(--down);
}

.badge-unknown {
    background: rgba(138, 109, 59, 0.12);
    color: var(--unknown);
}

.checks-mini {
    margin-top: 16px;
    display: grid;
    gap: 10px;
}

.checks-mini-item {
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(238, 244, 251, 0.95), rgba(248, 251, 255, 0.95));
    border: 1px solid var(--border);
}

.uptime-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.uptime-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.08), rgba(255, 255, 255, 0.82));
    border: 1px solid var(--border);
}

.uptime-label {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.uptime-value {
    display: block;
    margin-top: 6px;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.flash {
    margin: 20px 0;
    padding: 12px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
}

.flash-success {
    background: rgba(21, 128, 61, 0.1);
}

.flash-error {
    background: rgba(220, 38, 38, 0.1);
}

form {
    display: grid;
    gap: 14px;
}

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(138, 163, 191, 0.35);
    border-radius: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.95);
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(13, 148, 136, 0.65);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    border: 0;
    border-radius: 999px;
    padding: 11px 17px;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    color: white;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(13, 148, 136, 0.2);
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}

button:hover,
.button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 24px rgba(13, 148, 136, 0.24);
    filter: saturate(1.03);
}

.button-secondary {
    background: linear-gradient(135deg, #5b6b7d, #7a8c9e);
}

.button-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.checkbox-row label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 500;
}

.checkbox-row input {
    width: auto;
}

.login-wrap {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
}

.login-card {
    width: min(460px, 100%);
    padding: 32px;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    border-bottom: 1px solid var(--border);
    text-align: left;
    padding: 12px 10px;
    vertical-align: top;
}

.push-panels {
    margin-top: 18px;
}

.subcard {
    padding: 18px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.subcard h3 {
    margin-top: 0;
}

.history-table thead th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.table-label {
    display: none;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

pre {
    background: #102132;
    color: #e8f1ff;
    padding: 14px;
    border-radius: 14px;
    overflow: auto;
}

@media (max-width: 820px) {
    .uptime-strip,
    .stats-grid,
    .grid.grid-2,
    .grid.grid-3 {
        grid-template-columns: 1fr;
    }

    .header-inner,
    .target-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero,
    .card,
    .login-card {
        border-radius: 20px;
    }

    .history-table,
    .history-table thead,
    .history-table tbody,
    .history-table th,
    .history-table td,
    .history-table tr {
        display: block;
        width: 100%;
    }

    .history-table thead {
        display: none;
    }

    .history-table tr {
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }

    .history-table td {
        border: 0;
        padding: 8px 0;
    }

    .table-label {
        display: block;
    }

    .inline-actions {
        flex-direction: column;
        align-items: stretch;
    }

    button,
    .button-link {
        width: 100%;
    }
}
