:root {
  --blue: #187cc2;
  --navy: #012d45;
  --bg: #f3f6f9;
  --line: #dbe3ea;
  --muted: #6b7a88;
  --red: #c0392b;
  --amber: #b9770e;
  --green: #1e8449;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1c2b36; background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; color: var(--navy); margin: 4px 0 16px; }
h2 { font-size: 15px; color: var(--navy); margin: 18px 0 8px; }
h2:first-child { margin-top: 0; }
code { font: 12px ui-monospace, Consolas, monospace; background: #eef2f5; padding: 1px 4px; border-radius: 3px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 24px; background: var(--navy); color: #fff; padding: 0 20px; height: 54px; }
.top a { color: #d6e6f2; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: #fff !important; }
.brand img { height: 32px; background: #fff; border-radius: 4px; padding: 2px; }
.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.top nav a { padding: 6px 10px; border-radius: 4px; }
.top nav a.on, .top nav a:hover { background: var(--blue); color: #fff; text-decoration: none; }
.me { display: flex; align-items: center; gap: 12px; }
.me form { margin: 0; }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }
main.center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }

.card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 16px; overflow-x: auto; }
.card.narrow { max-width: 420px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .top { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; } }

.login { width: 360px; max-width: 100%; text-align: center; }
.login .logo { display: block; max-width: 100%; height: auto; max-height: 72px; margin: 0 auto 6px; }
.login h1 { margin-bottom: 0; }
.login form { text-align: left; margin-top: 12px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 600; color: var(--navy); background: #f7f9fb; white-space: nowrap; }
td form { margin: 0; }

label { display: block; margin-bottom: 10px; font-weight: 500; }
label input, label select { display: block; width: 100%; margin-top: 3px; }
label.check { display: flex; gap: 6px; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: 4px; }
input, select { font: inherit; padding: 6px 8px; border: 1px solid #c3ced8; border-radius: 4px; background: #fff; }
input:focus, select:focus { outline: 2px solid #9cc9ea; border-color: var(--blue); }
.row { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.row input { flex: 1; min-width: 200px; }

button, .btn { display: inline-block; font: inherit; font-weight: 500; padding: 6px 14px; border: 1px solid var(--blue); border-radius: 4px; background: var(--blue); color: #fff; cursor: pointer; }
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--blue); }
button.warn { background: var(--amber); border-color: var(--amber); }
button.danger { background: #fff; color: var(--red); border-color: var(--red); }
button.danger:hover { background: var(--red); color: #fff; }
button.small { padding: 2px 8px; font-size: 12px; }
button.link { background: none; border: 0; color: #d6e6f2; padding: 0; }
.login button { width: 100%; padding: 8px; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge.active { background: #e3f4ea; color: var(--green); }
.badge.revoked { background: #fbe7e5; color: var(--red); }
.badge.expired { background: #fdf1dc; color: var(--amber); }

.flash { padding: 8px 12px; border-radius: 4px; margin: 0 0 14px; }
.flash.ok { background: #e3f4ea; color: var(--green); border: 1px solid #b9e2c8; }
.flash.err { background: #fbe7e5; color: var(--red); border: 1px solid #f1c0ba; }
