/* Admin panel. Tokens per theme: the system setting by default, the ◐ button overrides it. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f0efec;
  --border: #e2e1dc;
  --text: #0b0b0b;
  --text-2: #52514e;
  --link: #1c5cab;
  --accent: #2a78d6;
  --ok-bg: #e3f4e3;
  --ok-ink: #006300;
  --err-bg: #fbe5e5;
  --err-ink: #a32424;
  --warn-ink: #7a5300;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #262624;
    --border: #383835;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --link: #86b6ef;
    --accent: #3987e5;
    --ok-bg: #16301a;
    --ok-ink: #5fd35f;
    --err-bg: #3a1a1a;
    --err-ink: #f08a8a;
    --warn-ink: #fab219;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #262624;
  --border: #383835;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --link: #86b6ef;
  --accent: #3987e5;
  --ok-bg: #16301a;
  --ok-ink: #5fd35f;
  --err-bg: #3a1a1a;
  --err-ink: #f08a8a;
  --warn-ink: #fab219;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.warn { color: var(--warn-ink); }
.nowrap { white-space: nowrap; }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; color: var(--text); }
.brand-sub { font-weight: 400; color: var(--text-2); margin-left: 6px; }
.topnav { display: flex; gap: 16px; flex: 1; }
.topnav a { color: var(--text-2); }
.who { color: var(--text-2); font-size: 0.9rem; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; display: grid; gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; min-width: 0;
}
.narrow { max-width: 460px; }
.login-card { max-width: 380px; margin: 8vh auto 0; width: 100%; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tile { color: var(--text); display: block; }
.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile.disabled { opacity: 0.6; }
.tile p { margin: 0; }

.notice, .error { margin: 0; padding: 10px 14px; border-radius: 8px; }
.notice { background: var(--ok-bg); color: var(--ok-ink); }
.error { background: var(--err-bg); color: var(--err-ink); }

form.stack { display: grid; gap: 12px; }
form.stack label { display: grid; gap: 4px; }
form.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
form.row label { display: grid; gap: 4px; }
form.inline { display: inline-flex; gap: 6px; align-items: center; margin: 2px 6px 2px 0; }
input, button, select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
}
button { cursor: pointer; background: var(--surface-2); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
table.data th { text-align: left; color: var(--text-2); font-weight: 600; font-size: 0.85rem; }
table.data th, table.data td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.actions input[type="password"] { width: 11em; }
.theme-toggle { border-radius: 999px; width: 34px; height: 34px; padding: 0; line-height: 1; }
.login-tools { display: flex; justify-content: flex-end; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
