:root {
  --bg: #0f1114; --panel: #181b20; --panel-2: #1f232a; --line: #2a2f37;
  --text: #e6e9ee; --muted: #8c95a3; --accent: #1f7ae0; --accent-2: #3b8ff0;
  --ok: #2fbf71; --err: #e5534b; --warn: #f0a93b;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #0b0d10; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; font-size: 13px; }
h2, h3 { margin: 0 0 12px; font-weight: 700; }
.muted { color: var(--muted); }

.brand { display: flex; flex-direction: column; line-height: 1.02; font-weight: 800; font-size: 26px; letter-spacing: -.5px; }
.brand .accent { color: var(--accent); }

/* ----- login ----- */
.login-page { min-height: 100vh;
  background: radial-gradient(1200px 600px at 70% 30%, rgba(31,122,224,.14), transparent 60%),
              radial-gradient(800px 500px at 20% 90%, rgba(47,191,113,.07), transparent 60%), var(--bg); }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.login-card .brand { margin-bottom: 4px; }
.card.wide { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
input, select { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 10px 12px; font: inherit; outline: none; min-width: 0; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,122,224,.25); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; font: inherit; font-weight: 600; white-space: nowrap; }
.btn:hover { border-color: #3a414c; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.login-card .btn.primary { padding: 11px; margin-top: 4px; }
.alert { background: rgba(229,83,75,.12); border: 1px solid rgba(229,83,75,.4); color: #ffb4ae; border-radius: 8px; padding: 10px 12px; }
.alert.ok { background: rgba(47,191,113,.1); border-color: rgba(47,191,113,.4); color: #b6f0cf; }
.foot { margin: 6px 0 0; text-align: center; font-size: 11px; letter-spacing: .12em; color: #5d6572; }

/* ----- admin ----- */
.topbar { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 16px 24px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .brand { font-size: 18px; flex-direction: row; gap: 6px; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 8px 14px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.tabs a.on { background: rgba(31,122,224,.15); color: #cfe3ff; box-shadow: inset 0 0 0 1px rgba(31,122,224,.5); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.who { margin-left: auto; color: var(--muted); }
.admin { padding: 20px 24px 60px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  background: var(--panel); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.tbl td { padding: 8px 12px; border-bottom: 1px solid #20242b; vertical-align: top; }
.tbl tr:hover td { background: #15181c; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.small { color: var(--muted); }
.ua { color: var(--muted); max-width: 380px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: #232830; color: #b9c2cf; }
.t-login_ok { background: rgba(47,191,113,.15); color: #7de2a9; }
.t-login_fail, .t-blocked, .t-login_disabled { background: rgba(229,83,75,.15); color: #ff9a92; }
.t-logout { background: rgba(140,149,163,.15); }
.t-admin, .t-admin_reset, .t-admin_create { background: rgba(31,122,224,.18); color: #9cc6ff; }
.actions .inline { display: flex; gap: 6px; flex-wrap: wrap; }
.actions input { padding: 7px 10px; width: 200px; }
.actions .btn { padding: 7px 10px; font-size: 12px; }
.create { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px; max-width: 760px; }
.create h3 { width: 100%; margin: 0; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; max-width: 720px; }
.bar { display: grid; grid-template-columns: 200px 1fr 50px; gap: 10px; align-items: center; margin: 6px 0; font-size: 13px; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { height: 8px; background: #232830; border-radius: 999px; overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; gap: 12px; }
  .who { margin-left: 0; width: 100%; }
  .admin { padding: 16px; }
  .bar { grid-template-columns: 110px 1fr 40px; }
}
