:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --background: #08111f;
    --surface: #101c2e;
    --surface-light: #15243a;
    --border: #273852;
    --text: #edf4ff;
    --muted: #91a4bf;
    --accent: #5eead4;
    --online: #22c55e;
    --offline: #ef4444;
    --warning: #f59e0b;
}

* { box-sizing: border-box; }

body {
    background: radial-gradient(circle at top right, #12345a 0, var(--background) 42rem);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

a { color: inherit; }

.shell {
    margin: 0 auto;
    max-width: 1080px;
    padding: 48px 24px 72px;
}

.topbar { margin-bottom: 42px; }
.topbar a { color: var(--muted); text-decoration: none; }
.topbar a:hover { color: var(--text); }

.hero, .page-header, .toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 32px;
}

.hero { min-height: 220px; }
.page-header { margin-bottom: 36px; }

.eyebrow {
    color: var(--accent);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .14em;
    margin: 0 0 10px;
    text-transform: uppercase;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); letter-spacing: -.05em; line-height: .95; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 8px; }
.subtitle, .muted { color: var(--muted); }
.subtitle { font-size: 1.05rem; line-height: 1.65; max-width: 620px; }

.live-badge, .status-pill {
    align-items: center;
    background: rgb(34 197 94 / 9%);
    border: 1px solid rgb(34 197 94 / 30%);
    border-radius: 999px;
    color: #86efac;
    display: inline-flex;
    font-size: .85rem;
    font-weight: 700;
    gap: 9px;
    padding: 10px 14px;
    white-space: nowrap;
}

.live-badge span, .status-pill span, .app-status span {
    background: var(--online);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--online);
    height: 9px;
    width: 9px;
}

.navigation-grid, .status-grid { display: grid; gap: 18px; }
.navigation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.navigation-card, .status-card, .auth-panel {
    background: linear-gradient(145deg, rgb(21 36 58 / 95%), rgb(12 24 41 / 95%));
    border: 1px solid var(--border);
    border-radius: 18px;
}

.navigation-card {
    align-items: center;
    display: grid;
    gap: 18px;
    grid-template-columns: auto 1fr auto;
    padding: 28px;
    text-decoration: none;
    transition: border-color .2s, transform .2s;
}

.navigation-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-icon { color: var(--accent); font-size: 1.5rem; }
.navigation-card.private .card-icon { color: #a78bfa; }
.navigation-card p { color: var(--muted); line-height: 1.5; margin: 0; }
.arrow { color: var(--muted); font-size: 1.4rem; }

.status-card { min-height: 180px; padding: 24px; }
.status-card-header { align-items: center; display: flex; justify-content: space-between; gap: 12px; }
.status-card a { color: var(--text); text-decoration: none; }
.status-card a:hover { color: var(--accent); }
.app-status { align-items: center; display: inline-flex; font-size: .78rem; font-weight: 800; gap: 7px; text-transform: uppercase; }
.app-status.offline { color: #fca5a5; }
.app-status.offline span { background: var(--offline); box-shadow: 0 0 12px var(--offline); }
.metric { margin-top: 38px; }
.metric strong { display: block; font-size: 1.6rem; }
.metric small { color: var(--muted); }
.checked-at { color: var(--muted); font-size: .82rem; margin-top: 18px; text-align: right; }
.status-pill.checking { background: rgb(245 158 11 / 9%); border-color: rgb(245 158 11 / 30%); color: #fcd34d; }
.status-pill.checking span { background: var(--warning); box-shadow: none; }
.status-pill.degraded { background: rgb(239 68 68 / 9%); border-color: rgb(239 68 68 / 30%); color: #fca5a5; }
.status-pill.degraded span { background: var(--offline); box-shadow: 0 0 12px var(--offline); }

.skeleton { animation: pulse 1.4s infinite; opacity: .55; }
@keyframes pulse { 50% { opacity: .28; } }

.auth-panel { display: grid; gap: 32px; grid-template-columns: 1fr 1fr; padding: 32px; }
.auth-panel p { color: var(--muted); line-height: 1.55; }
label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 8px; }
.token-row { display: flex; gap: 10px; }
input {
    background: #08111f;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    min-width: 0;
    padding: 12px 14px;
    width: 100%;
}

button, .button {
    background: var(--accent);
    border: 0;
    border-radius: 10px;
    color: #06221f;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-size: .85rem;
    font-weight: 800;
    padding: 12px 16px;
    text-decoration: none;
    white-space: nowrap;
}
button:disabled { cursor: wait; opacity: .6; }
.button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.toolbar { margin: 30px 0 18px; }
.toolbar-actions { display: flex; gap: 10px; }
.table-wrap { border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--border); padding: 16px; text-align: left; }
th { color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
td { font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
code { color: #c4b5fd; font-size: .76rem; }
.error-message { color: #fca5a5 !important; font-size: .82rem; min-height: 1.2em; }
.backup-health { color: var(--muted); font-size: .82rem; margin: 5px 0 0; }
.backup-health.warning { color: #fcd34d; }
.backup-health.success { color: #86efac; }
.backup-health.running { color: #93c5fd; }
.empty { border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); padding: 36px; text-align: center; }
.hidden { display: none !important; }

@media (max-width: 760px) {
    .shell { padding-top: 28px; }
    .hero, .page-header, .toolbar { align-items: flex-start; flex-direction: column; }
    .navigation-grid, .status-grid, .auth-panel { grid-template-columns: 1fr; }
    .hero { min-height: 260px; }
    .token-row, .toolbar-actions { align-items: stretch; flex-direction: column; width: 100%; }
}
