/* Agency admin and login pages */
:root {
  --ink: #101828;
  --muted: #5d6b7e;
  --line: #e4e7ec;
  --bg: #f6f7f9;
  --card: #ffffff;
  --brand: #3b5bfd;
  --brand-ink: #2b47e0;
  --side: #101828;
  --side-ink: #cbd2dc;
  --ok-bg: #ecfdf3;
  --ok-ink: #067647;
  --err-bg: #fef3f2;
  --err-ink: #b42318;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; }
a { color: var(--brand-ink); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid #9db0ff; outline-offset: 2px; }
h1 { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 0 0 10px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; }
.brand b { font-weight: 500; color: #98a2b3; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.alert { padding: 12px 14px; border-radius: 10px; margin: 12px 0; font-weight: 600; }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-error { background: var(--err-bg); color: var(--err-ink); }

.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-family: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--brand-ink); color: #fff; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-ink); text-decoration: underline; cursor: pointer; }
.link-button.danger { color: var(--err-ink); }

.stack { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.stack .button { margin-top: 12px; }
.narrow { max-width: 420px; }
label { font-weight: 600; font-size: 14px; margin-top: 8px; }
input[type="email"], input[type="password"], input[type="text"], input:not([type]), .code-input {
  height: 46px; padding: 0 14px; border: 1.5px solid #c9d2dc; border-radius: 10px; font-family: inherit; font-weight: 500; font-size: 16px; color: var(--ink); background: #fff; width: 100%;
}
.code-input { letter-spacing: 0.2em; font-size: 20px; }

/* Login and two-step pages */
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: 0 18px 40px rgba(16, 24, 40, 0.08); }
.auth-card .brand { margin-bottom: 22px; }
.qr { display: flex; justify-content: center; margin: 16px 0 8px; }
.qr img { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 12px; }
.key { display: inline-block; padding: 8px 12px; background: var(--bg); border-radius: 8px; font-size: 15px; letter-spacing: 0.06em; word-break: break-all; }
.codes { columns: 2; padding-left: 22px; margin: 16px 0 22px; }
.codes li { margin-bottom: 6px; }
.codes code { font-size: 16px; }

/* Logged-in admin */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 240px; background: var(--side); color: var(--side-ink); padding: 22px 16px; display: flex; flex-direction: column; gap: 20px; }
.side .brand { color: #fff; }
.side .agency { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; background: #1d2939; }
.side .agency strong { color: #fff; }
.side .agency span { font-size: 13px; color: #98a2b3; }
.side .links { display: flex; flex-direction: column; gap: 2px; }
.side .links a { color: var(--side-ink); text-decoration: none; padding: 10px 12px; border-radius: 9px; font-weight: 500; }
.side .links a:hover, .side .links a[aria-current="page"] { background: #1d2939; color: #fff; }
.side .logout { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid #1d2939; }
.side .logout .link-button { color: #cbd2dc; }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 36px 48px; }
.cards { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.card { flex: 1 1 260px; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; margin-top: 16px; }
.cards .card { margin-top: 0; }
.big { font-size: 30px; font-weight: 800; margin: 0; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef2ff; color: var(--brand-ink); font-size: 12px; font-weight: 700; }
.plain { list-style: none; padding: 0; margin: 0 0 8px; }
.note { margin-top: 24px; }
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.upload label { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; }
td { padding: 12px; border-top: 1px solid #f0f2f5; }
td.actions { display: flex; gap: 14px; align-items: center; }
td.actions form { margin: 0; }

@media (max-width: 640px) {
  .content { padding: 20px 16px 40px; }
  .auth-card { padding: 24px 20px; }
}
