:root {
  --navy: #163d72; --bg: #f5f8fc; --card: #fff; --text: #162a43; --muted: #5b6b80; --line: #e2e8f0;
  --green: #16a36d; --amber: #b45309; --red: #c2414b; --link: #2566a7;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
main { max-width: 1100px; margin: 0 auto; padding: 32px 16px; }
h1 { font-size: 22px; margin: 0 0 4px; color: var(--navy); }
p.lead { color: var(--muted); margin: 0 0 24px; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }

/* sign-in */
body.login main { max-width: 380px; margin-top: 12vh; }
body.login .card { padding: 28px; }
body.login label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
body.login input { width: 100%; font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; }
body.login button { width: 100%; margin-top: 20px; font: inherit; font-weight: 600; padding: 10px; border: 0; border-radius: 6px; background: var(--green); color: #fff; cursor: pointer; }
body.login .note { text-align: center; }
.err { color: var(--red); font-size: 14px; margin: 0 0 8px; }

/* page */
.who { float: right; font-size: 13px; color: var(--muted); }
form.inline { display: inline; }
button.link { border: 0; background: none; padding: 0; color: var(--link); text-decoration: underline; font: inherit; font-size: 13px; cursor: pointer; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 14px; }
.filters input, .filters select, .pager select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
.filters input { flex: 1 1 260px; min-width: 0; }
.filters .count { margin-left: auto; font-size: 13px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.mono, .api { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
td.seen { font-size: 13px; line-height: 1.4; }
.sub { color: var(--muted); font-size: 12px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pending { background: #fef0c7; color: var(--amber); }
.granted { background: #d1fadf; color: var(--green); }
.off, .revoked { background: #fee4e2; color: var(--red); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions button, .pager button { font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.actions button.approve { background: var(--green); border-color: var(--green); color: #fff; }
button:disabled { opacity: .4; cursor: default; }
tr.detail td { background: #fafbfc; padding: 0 14px 14px; }
.history { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.history th, .history td { padding: 6px 10px; font-size: 13px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pager .range { margin-right: auto; }
@media (max-width: 760px) { th:nth-child(2), td:nth-child(2), th:nth-child(4), td:nth-child(4) { display: none; } .who { float: none; margin-bottom: 8px; } }
.more { padding: 8px 10px; }
