:root {
  --bg: #11131a; --card: #1b1e29; --fg: #eef1f8; --muted: #9aa3b8;
  --accent: #c9a24b; --ok: #3ecf8e; --err: #ff6b6b; --line: #2a2e3c;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #15171f;
}
.brand { font-weight: 700; letter-spacing: .02em; color: var(--accent); }
.navlink { color: var(--fg); text-decoration: none; opacity: .85; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; margin-top: 16px;
}
h1 { font-size: 1.3rem; margin: 0 0 .4rem; }
.muted { color: var(--muted); }
.fineprint { color: var(--muted); font-size: .82rem; margin-top: 14px; }
.error { color: var(--err); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; }
input[type=text], input:not([type]) , input[name] {
  padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1017; color: var(--fg); font-size: 1rem;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: #232739; color: var(--fg); font-size: 1rem; cursor: pointer;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: #1a1400; border-color: var(--accent); font-weight: 700; }
.filebtn { cursor: pointer; }
.camera-frame { background: #000; border-radius: 12px; overflow: hidden; }
#cam { width: 100%; max-height: 60vh; display: block; }
progress { width: 100%; height: 10px; }
.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.results .ok { color: var(--ok); }
.results .fail { color: var(--err); }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 14px;
}
.tile { margin: 0; }
.tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background:#0e1017; }
.tile figcaption { margin-top: 4px; text-align: center; }
.badge { font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.badge.ok { background: rgba(62,207,142,.18); color: var(--ok); }
.badge.pending { background: rgba(201,162,75,.18); color: var(--accent); }
.badge.err { background: rgba(255,107,107,.18); color: var(--err); }

/* --- Admin -------------------------------------------------------------- */
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }
.navgroup { display: inline-flex; align-items: center; gap: 12px; }
.inline { display: inline; margin: 0; }
.btn.small { padding: 6px 10px; font-size: .82rem; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.stat { background: #0e1017; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .9rem; }
.stat b { font-size: 1.1rem; }
.stat.ok b { color: var(--ok); }
.stat.pending b { color: var(--accent); }
.stat.err b { color: var(--err); }
.warn { color: var(--accent); }
.setting {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 0; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.setting p { margin: 4px 0 0; font-size: .85rem; }
.setting-action { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.window-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-label { font-size: .8rem; gap: 4px; }
.window-form input[type=datetime-local] { padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: #0e1017; color: var(--fg); }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .9rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.admin-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #0e1017; display: block; }
.row-blocked { opacity: .5; }
.nowrap { white-space: nowrap; }
.btn.danger { border-color: var(--err); color: var(--err); }
.btn.primary.danger { background: var(--err); color: #2a0000; border-color: var(--err); }
.window-form input[type=number] { width: 84px; padding: 8px; border-radius: 8px; border: 1px solid var(--line); background: #0e1017; color: var(--fg); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }

/* --- Beamer slideshow --------------------------------------------------- */
body.beamer { background: #000; height: 100vh; overflow: hidden; }
.beamer-slide { width: 100vw; height: 100vh; object-fit: contain; display: block; }
.beamer-empty { color: var(--muted); display: grid; place-items: center; height: 100vh; font-size: 1.2rem; }
.beamer-close { position: fixed; top: 12px; right: 18px; color: #fff; opacity: .5; text-decoration: none; font-size: 2rem; line-height: 1; }
.beamer-close:hover { opacity: 1; }
