:root {
    --bg-page: #0f1117;
    --bg-card: #1a1d29;
    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --border-color: #2a2f3f;
    --accent: #3b82f6;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-main: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

/* light theme overrides */
:root.light {
    --bg-page: #ffffff;
    --bg-card: #f8fafc;
    --text-main: #0f172a;
    --text-dim: #475569;
    --border-color: #cbd5e1;
    --accent: #2563eb;
}

/* global */
body {
    margin: 0;
    background-color: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

header.site-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.site-brand {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}
.site-sub {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.nav-links a {
    color: var(--text-main);
    margin-left: 1rem;
    font-size: 0.85rem;
    text-decoration: none;
}
.nav-links a:hover {
    color: var(--accent);
}

.theme-toggle-pill {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-main);
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    cursor: pointer;
    margin-left: 1rem;
}

.main-wrap {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.card h2,
.card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
}

.card p {
    margin: 0 0 0.75rem;
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
}

.table-basic {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.table-basic th {
    text-align: left;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    background-color: var(--bg-card);
}
.table-basic td {
    color: var(--text-dim);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    vertical-align: top;
}

.status-up {
    color: #22c55e;
    font-weight: 600;
}
.status-down {
    color: #ef4444;
    font-weight: 600;
}
.status-partial {
    color: #facc15;
    font-weight: 600;
}

.footer {
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-dim);
    font-size: 0.8rem;
}


/* ===== Status chips for UP / PARTIAL / DOWN ===== */
.status-up,
.status-partial,
.status-down {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.status-up {
    color: #22c55e;
    background-color: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.4);
}

.status-partial {
    color: #facc15;
    background-color: rgba(250,204,21,0.08);
    border-color: rgba(250,204,21,0.4);
}

.status-down {
    color: #ef4444;
    background-color: rgba(239,68,68,0.08);
    border-color: rgba(239,68,68,0.4);
}

/* ===== Flash messages (success / error) ===== */
.flash {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    border: 1px solid var(--border-color);
}

.flash-success {
    background-color: rgba(16,185,129,0.08); /* green-ish */
    color: #10b981;
    border-color: rgba(16,185,129,0.4);
    font-weight: 500;
}

.flash-error {
    background-color: rgba(239,68,68,0.08); /* red-ish */
    color: #ef4444;
    border-color: rgba(239,68,68,0.4);
    font-weight: 500;
}

/* OPTIONAL: tweak .footer if you want consistent look */
.footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-dim);
    padding: 2rem 1rem;
    background-color: var(--bg-alt);
    border-top: 1px solid var(--border-color);
}
/* Make the site-brand text a link but keep the visual */
.site-brand-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.site-brand-link:hover {
    color: var(--accent-hover);
}

/* Back link for edit pages */
.back-link {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent);
    text-decoration: none;
    background: rgba(59,130,246,0.12);
    border: 1px solid rgba(59,130,246,0.4);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    line-height: 1.2;
}
.back-link:hover {
    color: var(--accent-hover);
    background: rgba(59,130,246,0.18);
}
