/* Admin page. Colours, fonts and the header come from styles.css. */
main.admin { padding-top: 20px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
.aview { display: flex; flex-direction: column; gap: 18px; }
.aview[hidden], .admin [hidden] { display: none !important; }
.admin .panel h3 { margin-top: 0; }
.admin .muted { color: var(--muted); font-weight: 400; font-size: 0.86rem; }
.admin .hint { color: var(--ink-2); font-size: 0.84rem; margin: 10px 0 0; line-height: 1.45; }

.aform { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.aform label { display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); flex: 1 1 180px; }
.aform input, .aform select, .atable select { font: inherit; font-size: 0.9rem; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; min-width: 0; }
.aform input:focus-visible, .aform select:focus-visible, .atable select:focus-visible, .admin button:focus-visible, .drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }

.admin button { font: inherit; font-weight: 600; font-size: 0.88rem; border-radius: 6px; padding: 9px 16px; cursor: pointer; }
.admin button.primary { color: var(--band-ink); background: var(--band); border: 1px solid var(--band); }
.admin button.ghost { color: var(--band); background: transparent; border: 1px solid var(--line-2); }
:root[data-theme="dark"] .admin button.ghost { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin button.ghost { color: var(--ink); } }
.admin button.danger { color: var(--bad); background: transparent; border: 1px solid transparent; padding: 6px 8px; }
.admin button.danger:hover { border-color: var(--bad); }
.admin button:disabled { opacity: 0.55; cursor: default; }
.arow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.amsg { font-size: 0.86rem; color: var(--ink-2); }
.amsg.bad { color: var(--bad); }
.amsg.ok { color: var(--good); }

.atable { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.atable th { text-align: left; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.atable td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); text-align: left; }
.atable th:last-child, .atable td:last-child { text-align: right; }
#audit-table td:last-child, #audit-table th:last-child { text-align: left; }
.atable td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atable td.when, .atable td.ip { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.atable td.det { color: var(--ink-2); max-width: 520px; overflow-wrap: anywhere; }
.atable tr.changed td { background: color-mix(in srgb, var(--target) 12%, transparent); }
.atable .tag { display: inline-block; font-size: 0.74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--chip-ink); white-space: nowrap; }
.atable .tag.warn { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.atable .you { color: var(--muted); font-size: 0.78rem; }
.compare td:nth-child(2), .compare td:nth-child(3) { text-align: right; font-variant-numeric: tabular-nums; }
.compare th:nth-child(2), .compare th:nth-child(3) { text-align: right; }

.steps { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: st; font-size: 0.86rem; color: var(--muted); }
.steps li { counter-increment: st; display: flex; align-items: center; gap: 8px; }
.steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); font-weight: 700; font-size: 0.76rem; }
.steps li.on { color: var(--ink); font-weight: 600; }
.steps li.on::before { background: var(--band); border-color: var(--band); color: var(--band-ink); }
.steps li.done::before { content: "✓"; background: var(--good); border-color: var(--good); color: #fff; }

.drop { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; text-align: center; padding: 28px 16px; border: 2px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.drop.over { border-color: var(--band); background: var(--chip); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-t { font-size: 0.95rem; color: var(--ink); }
.drop-s { font-size: 0.82rem; color: var(--ink-2); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; width: 30%; background: var(--band); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress span { animation: none; width: 100%; opacity: 0.5; } }
.warnbox { border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--ink); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 0.88rem; }
.warnbox ul { margin: 6px 0 0; padding-left: 18px; }

@media (max-width: 640px) {
  main.admin { padding-top: 12px; }
  .aform label { flex-basis: 100%; }
  .aform button { width: 100%; }
  .atable { font-size: 0.82rem; }
  .atable th, .atable td { padding: 7px 6px; }
}
.atable td.acts { white-space: nowrap; }
.atable td.acts > * + * { margin-left: 6px; }
.atable td.ctr { text-align: center; }
.atable tr.live td { background: color-mix(in srgb, var(--good) 8%, transparent); }
.atable .tag { margin-left: 8px; }
.admin a.alink { color: var(--band); font-weight: 600; font-size: 0.86rem; padding: 6px 4px; }
:root[data-theme="dark"] .admin a.alink { color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .admin a.alink { color: var(--ink); } }
.admin button.small { padding: 5px 10px; font-size: 0.82rem; }
.admin button.plain { color: var(--ink-2); }
.aform label.acheck { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 0.86rem; font-weight: 500; color: var(--ink); flex: 1 1 100%; }
.aform label.acheck input { width: 16px; height: 16px; }
