:root {
    --bg: #f4f0e8;
    --panel: rgba(255, 251, 245, 0.88);
    --ink: #1f1d1a;
    --muted: #6f685d;
    --line: rgba(84, 67, 50, 0.15);
    --accent: #b14d1f;
    --accent-2: #1d6f61;
    --danger: #a2322a;
    --shadow: 0 20px 60px rgba(70, 46, 24, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: Georgia, "Times New Roman", serif;
    background:
        radial-gradient(circle at top left, rgba(177, 77, 31, 0.18), transparent 30%),
        radial-gradient(circle at top right, rgba(29, 111, 97, 0.18), transparent 32%),
        linear-gradient(180deg, #f8f4ec 0%, #efe7da 100%);
}

.shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 20px 20px;
}

.app-footer {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px 36px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
    font-size: 0.88rem;
}

.hero,
.summary-grid,
.meta-grid,
.history-grid {
    margin-bottom: 24px;
}

.hero {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr;
    gap: 20px;
    align-items: end;
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-size: 0.75rem;
}

h1,
h2 {
    margin: 0;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.2rem, 6vw, 4rem);
    line-height: 0.95;
}

h2 {
    font-size: 1.2rem;
}

.subcopy,
.section-head p,
.card p,
li,
td,
th {
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.subcopy,
.section-head p,
.card p {
    color: var(--muted);
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    cursor: pointer;
    font-size: 0.98rem;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
}

button.primary {
    background: var(--accent);
    color: #fff7f2;
}

button.secondary {
    background: #e7ddd0;
    color: var(--ink);
}

.flash,
.card {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border-radius: 24px;
}

.flash {
    padding: 14px 18px;
    margin-bottom: 24px;
    font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

.summary-grid,
.meta-grid,
.history-grid {
    display: grid;
    gap: 20px;
}

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

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

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

.card {
    padding: 22px;
}

.stat-card .label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
}

.stat-card .value {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--ink);
}

.stat-card.ok {
    background: rgba(29, 111, 97, 0.12);
}

.stat-card.bad {
    background: rgba(162, 50, 42, 0.12);
}

.stat-card.neutral {
    background: rgba(111, 104, 93, 0.12);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 16px;
}

.table-wrap {
    overflow-x: auto;
}

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

th,
td {
    padding: 12px 10px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    font-size: 0.95rem;
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 6px 10px;
    border-radius: 999px;
    text-transform: capitalize;
    font-size: 0.82rem;
    font-weight: 700;
}

.badge.online {
    background: rgba(29, 111, 97, 0.18);
    color: var(--accent-2);
}

.badge.offline {
    background: rgba(162, 50, 42, 0.16);
    color: var(--danger);
}

.badge.unknown {
    background: rgba(111, 104, 93, 0.14);
    color: var(--muted);
}

.tight-list {
    margin: 14px 0 0;
    padding-left: 18px;
}

.error-copy {
    margin-top: 6px;
    color: var(--danger);
    font-size: 0.84rem;
}

@media (max-width: 980px) {
    .hero,
    .summary-grid,
    .meta-grid,
    .history-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        justify-content: flex-start;
    }

    .app-footer {
        flex-direction: column;
    }
}
