:root {
    --bg: #0f1420;
    --panel: #161d2e;
    --border: #273049;
    --text: #e4e8f1;
    --muted: #8b95ab;
    --accent: #4f8cff;
    --danger: #ff5d6c;
    --warn: #f5a623;
    --ok: #35c283;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}
.topnav {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }
.topnav .brand { color: var(--text); font-weight: 600; margin-right: 12px; }
.topnav .right { margin-left: auto; }
.content { padding: 24px; max-width: 1200px; margin: 0 auto; }

h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 24px 0 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.card .num { font-size: 28px; font-weight: 600; }
.card .label { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.card.warn .num { color: var(--warn); }
.card.danger .num { color: var(--danger); }
.card.ok .num { color: var(--ok); }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 11px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.badge.success { background: rgba(53,194,131,.15); color: var(--ok); }
.badge.failed { background: rgba(255,93,108,.15); color: var(--danger); }
.badge.running, .badge.partial { background: rgba(245,166,35,.15); color: var(--warn); }

form.inline { display: inline; }
input[type=text], input[type=password], input[type=file], select {
    background: #0d1220; border: 1px solid var(--border); color: var(--text);
    padding: 6px 10px; border-radius: 6px; font-size: 13px;
}
label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
button, input[type=submit] {
    background: var(--accent); color: #fff; border: none; padding: 7px 14px;
    border-radius: 6px; cursor: pointer; font-size: 13px;
}
button.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
button.danger { background: var(--danger); }
button:hover { opacity: .9; }

.tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 6px 6px 0 0; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.tabs a.active { background: var(--panel); border-color: var(--border); border-bottom-color: var(--panel); color: var(--text); }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.notice { background: rgba(79,140,255,.12); border: 1px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
pre.log-output { background: #0d1220; padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-box { background: var(--panel); border: 1px solid var(--border); padding: 32px; border-radius: 10px; width: 300px; max-width: 88vw; box-sizing: border-box; }
.login-box h1 { font-size: 18px; }
.login-box button { width: 100%; margin-top: 8px; }

/* Site-wide footer (includes/legal_footer.php) — carries the Privacy/Terms links that
   the Google OAuth consent screen points at, so they're reachable from every page. */
.km-footer {
    margin: 32px auto 0;
    padding: 14px 24px 20px;
    max-width: 1200px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.km-footer a { color: var(--muted); text-decoration: none; }
.km-footer a:hover { color: var(--text); text-decoration: underline; }
.km-footer-sep { margin: 0 8px; opacity: .5; }

/* The login pages centre a fixed-width box; keep the footer under it, not stretched. */
.login-body .km-footer {
    border-top: none;
    margin-top: 22px;
    padding-bottom: 8px;
}

/* Login pages stack vertically: tagline, login box, footer. The base .login-body rule
   above is a flex ROW, which laid the footer out beside the box rather than under it —
   and the tagline needs to sit above it, so the column direction is set here. Also swap
   the fixed 100vh for min-height, so a short viewport scrolls instead of clipping. */
.login-body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    padding: 24px 16px;
    box-sizing: border-box;
}
.login-tagline {
    width: 300px;
    max-width: 88vw;
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}
