/* Small, classless-first stylesheet for the admin portal — no build step,
   no CDN dependency (keeps this self-contained and CSP-friendly). */

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #273449;
    --border: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --danger: #f87171;
    --success: #4ade80;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-nav .brand { font-weight: 700; color: var(--text); text-decoration: none; }
.admin-nav nav a { color: var(--text-muted); text-decoration: none; margin-left: 1rem; }
.admin-nav nav a:hover { color: var(--accent); }

.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

h1, h2, h3 { line-height: 1.25; }
a { color: var(--accent); }
code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 4px; }

form { max-width: 480px; }
form.inline-form { display: inline-block; max-width: none; margin: 0 .25rem 0 0; }

label { display: block; margin: 1rem 0 .35rem; font-size: .95rem; }
label.checkbox { display: flex; align-items: center; gap: .5rem; }

input[type=text], input[type=email], input[type=password], input[type=number], select {
    width: 100%;
    padding: .65rem .75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

button {
    margin-top: 1.25rem;
    padding: .75rem 1.25rem;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #0f172a;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
}
button.btn-danger { background: var(--danger); }
form.inline-form button { margin-top: 0; padding: .45rem .8rem; font-size: .85rem; }

.flash { padding: .75rem 1rem; border-radius: 8px; margin: 1rem 0; }
.flash-error { background: #450a0a; color: #fecaca; }
.flash-success { background: #052e16; color: #bbf7d0; }
.flash-info { background: var(--surface-2); color: var(--text); }

.secret-key {
    background: var(--surface-2);
    padding: .85rem 1rem;
    border-radius: 8px;
    word-break: break-all;
    white-space: pre-wrap;
    font-size: .95rem;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin: .75rem 0 1.5rem; }
th, td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); font-size: .9rem; white-space: nowrap; }
th { color: var(--text-muted); font-weight: 600; }

.status { padding: .15rem .5rem; border-radius: 999px; font-size: .8rem; }
.status-sent { background: #1e3a8a; color: #bfdbfe; }
.status-viewed { background: #78350f; color: #fde68a; }
.status-approved, .status-ok { background: #052e16; color: #bbf7d0; }
.status-declined, .status-bad_password, .status-bad_totp, .status-bad_token { background: #450a0a; color: #fecaca; }
.status-expired { background: #334155; color: #cbd5e1; }
.status-revoked { background: #450a0a; color: #fecaca; }

@media (max-width: 480px) {
    .admin-nav nav a { margin-left: .6rem; }
    .container { padding: 1rem .85rem 3rem; }
}
