:root {
  /* Mister IT house style: navy + orange */
  --navy: #1E3552; --orange: #E2672D;
  --bg: #f6f7f9; --card: #fff; --text: #1d2430; --muted: #657084; --line: #e2e5ea;
  --brand: #1E3552; --brand-ink: #fff; --accent: #E2672D; --header: #1E3552; --header-ink: #fff;
  --ok: #1a7f4b; --warn: #a76700; --bad: #c62828;
  --plate: #f6c500;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0f1621; --card: #172131; --text: #e6e9ee; --muted: #98a2b3; --line: #26324a; --brand: #E2672D; --brand-ink: #fff; --accent: #F08A55; --header: #0b1320; --header-ink: #fff; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--header); color: var(--header-ink); border-bottom: 3px solid var(--orange); }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.top nav a, .top button.link { color: var(--header-ink); opacity: .9; text-decoration: none; }
.top nav a:hover, .top button.link:hover { opacity: 1; color: var(--orange); }
.brand { font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--header-ink); letter-spacing: .2px; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand b { color: var(--orange); }
/* The logo has navy parts: on the navy header it sits on a white chip (logo itself unchanged) */
.brand img { background: #fff; border-radius: 50%; padding: 2px; }
h1 { color: var(--text); } h1::after { content: ""; display: block; width: 44px; height: 3px; background: var(--orange); border-radius: 2px; margin-top: 6px; }
main { max-width: 1100px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; } h2 { font-size: 1.15rem; margin: 0 0 .6em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 480px; margin: 24px auto; } .center { text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.park { text-decoration: none; color: inherit; border-top: 3px solid var(--orange); } .park:hover { border-color: var(--orange); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-items: end; margin-top: 12px; }
.grid-form .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); min-width: 0; }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; } .btn.danger.ghost { background: transparent; color: var(--bad); margin-top: 12px; }
.btn.big { font-size: 1.1rem; padding: 14px 22px; width: 100%; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.danger { color: var(--bad); }
.inline { display: inline; }
details > summary { list-style: none; cursor: pointer; margin-top: 12px; } details > summary::-webkit-details-marker { display: none; }
details.cam { border-top: 1px solid var(--line); padding: 8px 0; }
.gates { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.gate { display: flex; flex-direction: column; gap: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.right { text-align: right; } .muted { color: var(--muted); } .small { font-size: .85rem; }
tr.blocked td { opacity: .6; }
.plate { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-weight: 700; background: var(--plate); color: #111; border-radius: 4px; padding: 1px 8px; border-left: 6px solid #1f4aa8; }
.tag { display: inline-block; font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--text); }
.tag.ok { background: #d8f2e3; color: var(--ok); } .tag.warn { background: #fdecc8; color: var(--warn); } .tag.bad { background: #fbdcdc; color: var(--bad); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; background: #d8f2e3; color: #0f5132; }
.flash.error { background: #fbdcdc; color: #842029; }
/* Phones: the log and the plates list become two-line cards instead of wide tables */
@media (max-width: 700px) {
  table.log thead, table.plates thead { display: none; }
  table.log, table.log tbody, table.plates, table.plates tbody { display: block; }
  table.log td, table.plates td { display: block; border: 0; padding: 0; min-width: 0; }
  table.log tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; row-gap: 4px;
    grid-template-areas: "plate kind photo" "time time photo" "detail detail photo"; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.log .ev-plate { grid-area: plate; } table.log .ev-kind { grid-area: kind; font-weight: 600; }
  table.log .ev-time { grid-area: time; } table.log .ev-detail { grid-area: detail; }
  table.log .ev-photo { grid-area: photo; } table.log .thumb img { width: 92px; }
  table.log tr td[colspan] { grid-column: 1 / -1; }
  table.plates tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px;
    grid-template-areas: "plate guest" "period period" "source actions"; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.plates .pl-plate { grid-area: plate; } table.plates .pl-guest { grid-area: guest; }
  table.plates .pl-from, table.plates .pl-until { display: none; }
  table.plates .pl-period[hidden] { display: block; grid-area: period; color: var(--muted); }
  table.plates .pl-source { grid-area: source; } table.plates .pl-actions { grid-area: actions; }
  table.plates tr td[colspan] { grid-column: 1 / -1; }
}
.armed, button.link.armed { background: var(--bad) !important; border-color: var(--bad) !important; color: #fff !important; padding: 4px 10px; border-radius: 6px; }
.cam-form[data-ctype="autoreg"] .only-http, .cam-form[data-ctype="http"] .only-autoreg { display: none; }
.mono { font-family: ui-monospace, Menlo, monospace; } .btn.small { padding: 6px 10px; font-size: .85rem; }
.help { max-width: 820px; margin: 0 auto; } .help-logo { display: block; margin: 0 auto 8px; background: #fff; border-radius: 50%; padding: 8px; } .help code { background: var(--bg); padding: 1px 6px; border-radius: 4px; }
/* Primary action (open barrier) in Mister IT orange */
.btn.big { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.big:hover { filter: brightness(1.05); }
.qr { display: flex; justify-content: center; margin: 12px 0; } .qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; }
.codes { background: var(--bg); padding: 12px 16px; border-radius: 8px; font-size: 1.1rem; line-height: 1.8; }
.user.blocked { opacity: .65; } .user-actions { gap: 14px; font-size: .9rem; } .memberships { margin-top: 8px; } .memberships td { padding: 6px 4px; } .memberships select { padding: 4px 8px; }
.card.dupe { border-left: 4px solid var(--warn); } .org-name { min-width: 260px; font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; } .btn.disabled { opacity: .4; pointer-events: none; }

/* Photo thumbnails in the passage log + large view */
.thumb img { display: block; width: 112px; height: auto; border-radius: 6px; border: 1px solid var(--line); }
.thumb:hover img, .thumb:focus img { outline: 2px solid var(--brand); outline-offset: 1px; }
#lightbox { padding: 8px; border: 0; border-radius: 10px; background: var(--card); max-width: 96vw; cursor: zoom-out; }
#lightbox::backdrop { background: rgba(0,0,0,.8); }
#lightbox img { display: block; max-width: calc(96vw - 16px); max-height: 86vh; height: auto; border-radius: 6px; }
#lightbox p { margin: 6px 2px 0; text-align: center; }

/* Park tabs: Kentekens / Logboek / Instellingen */
.tabs { display: flex; gap: 4px; margin: 4px 0 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a { padding: 8px 14px; border-bottom: 3px solid transparent; color: inherit; text-decoration: none; font-weight: 600; opacity: .75; }
.tabs a:hover { opacity: 1; }
.tabs a.active { border-bottom-color: var(--brand); opacity: 1; }
.nowrap { white-space: nowrap; }
table.log td { vertical-align: middle; }
.card form + h2 { margin-top: 16px; }

/* Live log indicator and the highlight of rows that just came in */
.live { color: #2E9E5B; font-weight: 600; white-space: nowrap; }
.live.warn { color: var(--accent); }
.live.off { color: var(--muted); }
tr.fresh { animation: fresh 3s ease-out; }
@keyframes fresh { from { background: color-mix(in srgb, var(--orange) 22%, transparent); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { tr.fresh { animation: none; } }

/* Staging / test environment: impossible to miss */
.env-bar { background: repeating-linear-gradient(45deg, #b45309 0 18px, #92400e 18px 36px); color: #fff; text-align: center;
  font-weight: 700; padding: 6px 12px; font-size: .9rem; letter-spacing: .02em; }
