:root {
  --bg: #121418; --panel: #1B1E24; --panel2: #23272F; --line: #2C313A; --line2: #3A404B;
  --text: #E8EAED; --text2: #C9CFD8; --muted: #9AA3AF; --soft: #B4BBC5;
  --accent: #8AB8FF; --accent-ink: #0E1420; --accent-bg: #2B3A55;
  --ok: #7FD49B; --warn: #F2C66D; --warn-bg: #3A2E14; --bad: #FF9B9B; --bad-bg: #3A1C1C;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 15px; }
a { color: var(--accent); } a:hover { color: #B5D2FF; }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
h2 { margin: 0; font-size: 20px; font-weight: 700; }
p { line-height: 1.5; }
.muted { color: var(--muted); } .soft { color: var(--soft); } .small { font-size: 13px; }

.topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--panel); }
.topbar .left, .topbar .right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.who { font-size: 14px; color: var(--soft); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text2); font-size: 12px; }
.pill.admin { background: var(--warn-bg); border-color: transparent; color: var(--warn); font-weight: 600; }
.badge { width: 24px; height: 24px; border-radius: 6px; background: var(--accent-bg); color: var(--accent); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.switcher { position: relative; }
.switcher select { appearance: none; min-height: 36px; padding: 0 30px 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.switcher::after { content: "▾"; position: absolute; right: 10px; top: 8px; color: var(--muted); pointer-events: none; }

.layout { display: flex; flex-wrap: wrap; min-height: calc(100vh - 57px); }
.sidenav { flex: 1 1 200px; max-width: 240px; padding: 20px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sidenav a { padding: 10px 12px; border-radius: 8px; color: var(--text2); text-decoration: none; }
.sidenav a:hover { background: var(--panel2); }
.sidenav a.active { background: var(--accent-bg); color: var(--text); font-weight: 600; }
.sidenav .foot { margin-top: 24px; padding: 10px 12px; font-size: 12px; color: var(--muted); }
.content { flex: 999 1 560px; min-width: 0; padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.page { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 24px; display: flex; flex-direction: column; gap: 28px; }
.head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

button, .btn { min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel2); color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.danger { background: var(--bad-bg); border-color: transparent; color: var(--bad); }
button.link { background: none; border: none; color: var(--accent); padding: 0; min-height: 0; font-weight: 500; }
button.small { min-height: 34px; padding: 0 12px; font-size: 13px; }
button:disabled { opacity: .5; cursor: default; }

label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=search], textarea, select.input {
  min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--text); font: inherit; font-size: 15px; }
textarea { padding: 10px 14px; min-height: 160px; resize: vertical; line-height: 1.5; }
select.input { padding: 0 10px; min-height: 36px; font-size: 14px; background: var(--panel2); }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--panel); color: var(--muted); text-align: left; font-weight: 600; padding: 12px 16px; white-space: nowrap; }
td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: #171A20; }
.tag { display: inline-block; margin: 0 4px 4px 0; padding: 2px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line2); color: var(--text2); font-size: 12px; }
.ok { color: var(--ok); } .bad { color: var(--bad); }

.card { padding: 22px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
a.card { text-decoration: none; color: var(--text); } a.card:hover { border-color: var(--line2); background: #1F232A; }

.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 36px; display: flex; flex-direction: column; gap: 22px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.google { background: #fff; color: #1F1F1F; border-color: #fff; width: 100%; }
.or { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.error { padding: 12px 14px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--panel2); color: var(--text2); font-size: 14px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 12px; padding: 24px; width: min(640px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.form { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.meta { font-size: 12px; color: var(--muted); }
details.diff summary { cursor: pointer; color: var(--accent); font-size: 13px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg); padding: 10px; border-radius: 6px; font-size: 12px; color: var(--text2); }
.checks { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.checks label { display: flex; gap: 8px; align-items: center; }

@media (max-width: 700px) {
  .layout { display: block; min-height: 0; }
  .sidenav { max-width: none; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: none; border-bottom: 1px solid var(--line); padding: 8px 10px; }
  .sidenav a { padding: 8px 10px; }
  table { min-width: 560px; }
  .sidenav .foot { margin-top: 0; }
  .content { padding: 20px 16px; }
  .auth { padding: 26px 20px; }
}
