:root {
  --bg: #0b1220;
  --bg-2: #121c30;
  --panel: #172238;
  --border: #26344f;
  --text: #eef2f8;
  --muted: #9aa8c0;
  --accent: #2f8cff;
  --accent-2: #1f6fd6;
  --danger: #e5484d;
  --ok: #2ecc71;
  --warn: #f5a623;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body { display: flex; flex-direction: column; min-height: 100dvh; }

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.brand { font-weight: 500; letter-spacing: 0.2px; white-space: nowrap; }
.brand strong { color: var(--accent); }
.inline { display: inline; margin: 0; }
.muted { color: var(--muted); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  width: 100%;
}

.screen {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.screen.narrow { max-width: 420px; }
.screen-video { max-width: 1100px; gap: 12px; }

h1 { font-size: 1.5rem; margin: 8px 0 0; }
.lead { font-size: 1.1rem; margin: 0; }
.hint { color: var(--muted); margin: 0; }
.hint.small { font-size: 0.9rem; }
/* Footer: version, seneste genstart og build. Ligger altid i bunden (body er flex-kolonne, main fylder resten). */
.buildinfo {
  margin: 0;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  text-align: center;
  width: 100%;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  font-variant-numeric: tabular-nums;
}
.buildinfo strong { color: var(--text); font-weight: 500; }
.error { color: var(--danger); min-height: 1.4em; margin: 0; font-size: 0.95rem; }
.error:empty { display: none; }

.facts {
  text-align: left;
  margin: 0;
  padding: 16px 20px 16px 36px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
}
.facts li + li { margin-top: 6px; }

.code {
  font-size: clamp(3rem, 16vw, 5.5rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  width: 100%;
  user-select: all;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-muted { background: #2a3650; color: var(--muted); }
.badge-ok { background: rgba(46, 204, 113, 0.18); color: var(--ok); }
.badge-warn { background: rgba(245, 166, 35, 0.18); color: var(--warn); }
.badge-danger { background: rgba(229, 72, 77, 0.18); color: var(--danger); }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: #1d2a44; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(229, 72, 77, 0.12); }
.btn-big { width: 100%; font-size: 1.15rem; min-height: 60px; }
.btn-small { padding: 6px 12px; min-height: 34px; font-size: 0.9rem; }

.form { width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.form label { color: var(--muted); font-size: 0.95rem; }
.form input {
  font: inherit;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  width: 100%;
}
.form input[type="password"] { letter-spacing: normal; font-size: 1.1rem; }
.form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 70dvh;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.tech .video-wrap { aspect-ratio: 16 / 10; max-height: 75dvh; }
.video-wrap video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}
.tech .video-wrap video { object-fit: contain; transition: transform 0.15s ease-out; }
.overlay-label {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 0.85rem;
}
.overlay-msg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(11, 18, 32, 0.75);
  font-size: 1.05rem;
}
.overlay-msg[hidden] { display: none; }

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
}
.controls .btn { flex: 1 1 140px; }

.session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: center;
  width: 100%;
  font-size: 0.95rem;
}

.waiting { width: 100%; }
.waiting-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.waiting-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.waiting-item:hover { border-color: var(--accent); background: #1d2a44; }
.waiting-item-mine { border-color: var(--warn); }
.waiting-item-mine .waiting-meta { color: var(--warn); }
.waiting-code { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
.waiting-meta { color: var(--muted); font-size: 0.9rem; }
.confirm {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: rgba(47, 140, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.log-wrap { width: 100%; text-align: left; color: var(--muted); font-size: 0.85rem; }
.log-wrap summary { cursor: pointer; }
.log {
  margin: 8px 0 0;
  padding: 10px 12px;
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 180px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}

@media (min-width: 700px) {
  .customer .video-wrap { aspect-ratio: 4 / 3; }
}

.disclaimer {
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: left;
}
.disclaimer strong { color: var(--text); }
.disclaimer p { margin: 0; }
.disclaimer p + p { margin-top: 10px; }

/* ---- Microsoft-login, aktive sessioner og log ------------------------------------------- */
.btn-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.topbar-name { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

.active-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.active-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  text-align: left;
}
.active-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.active-owner { font-weight: 600; }
.active-item .btn-danger { flex: 0 0 auto; }
.confirm-danger { border-color: var(--danger); background: rgba(229, 72, 77, 0.08); }

.screen-audit { max-width: 900px; text-align: left; align-items: stretch; }
.audit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.audit-block { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.audit-online { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.audit-online-item {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(46, 204, 113, 0.14);
  color: var(--ok);
  font-size: 0.9rem;
}
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.table tr:last-child td { border-bottom: 0; }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.audit-events {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-2);
  max-height: 60dvh;
  overflow: auto;
  font-size: 0.9rem;
}
.audit-event { display: grid; grid-template-columns: 6.5em minmax(7em, 12em) 1fr; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); align-items: baseline; }
.audit-event:last-child { border-bottom: 0; }
.audit-when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-what { min-width: 0; }
.audit-login .audit-what { color: var(--ok); }
.audit-login_denied .audit-what, .audit-session_force_end .audit-what { color: var(--danger); }
@media (max-width: 600px) {
  .audit-event { grid-template-columns: 1fr; gap: 2px; }
}

/* Kundesiden åbnet på en pc: enkel splash med besked om at bruge telefonen */
.splash { justify-content: center; flex: 1; gap: 12px; }
.splash-icon { font-size: 4rem; line-height: 1; }
