:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: #0d1b2d;
  --line: #20344e;
  --text: #f5f8fc;
  --muted: #98abc4;
  --cyan: #24d6c8;
  --blue: #3c82f6;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% 0, #123158 0, transparent 32rem), var(--bg); color: var(--text); }
a { color: var(--cyan); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.topbar { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.brand { color: var(--text); font-weight: 800; letter-spacing: -.03em; }
.brand span { color: var(--cyan); }
.user-menu, .user-menu form, .actions { display: flex; align-items: center; gap: 1rem; }
.link-button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.container { width: min(1180px, 90vw); margin: 0 auto; padding: 4rem 0; }
.hero { padding: 2rem 0 4rem; max-width: 760px; }
.hero.compact { padding-bottom: 2rem; }
h1 { font-size: clamp(2.3rem, 6vw, 4.8rem); line-height: .96; letter-spacing: -.06em; margin: .5rem 0 1rem; }
h2 { letter-spacing: -.03em; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; color: var(--cyan); font-size: .78rem; font-weight: 800; }
.hero p:not(.eyebrow), small, .section-heading span, .access-message { color: var(--muted); }
.panel { background: color-mix(in srgb, var(--panel) 90%, transparent); border: 1px solid var(--line); border-radius: 1rem; box-shadow: 0 1rem 3rem #0004; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.camera-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1.2rem; color: var(--text); }
.camera-card small { display: block; margin-top: .35rem; }
.status-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #65758b; }
.status-dot.online { background: var(--cyan); box-shadow: 0 0 1rem var(--cyan); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
tr:last-child td { border: 0; }
.login-panel { width: min(420px, 100%); margin: 8vh auto; padding: 2rem; }
.stack { display: grid; gap: .75rem; }
input, select, textarea { width: 100%; padding: .85rem 1rem; color: var(--text); background: #07111f; border: 1px solid var(--line); border-radius: .55rem; }
.checkbox-field { display: flex; align-items: flex-start; gap: .65rem; color: var(--muted); line-height: 1.35; }
.checkbox-field input { width: auto; margin-top: .18rem; accent-color: var(--cyan); }
textarea { resize: vertical; overflow-wrap: anywhere; }
button.primary, button.secondary, a.primary { border-radius: .55rem; padding: .8rem 1.1rem; cursor: pointer; }
button.primary, a.primary { border: 0; color: #03110f; background: var(--cyan); font-weight: 800; }
a.primary { display: inline-block; text-decoration: none; }
button.secondary { border: 1px solid var(--line); color: var(--text); background: transparent; }
button:disabled { opacity: .55; cursor: wait; }
.error { color: #ff8585; }
.back { display: inline-block; margin-bottom: 1rem; }
.player-panel { padding: 1.25rem; }
.player-panel video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: .65rem; }
.csrf-source { display: none; }
.empty { padding: 1rem; }
.search-panel { padding: 1.25rem; }
.search-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.search-grid label { display: grid; gap: .45rem; color: var(--muted); font-size: .86rem; }
.field-error, .form-errors { color: #ff8585; }
.form-errors ul { margin-top: 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; border-radius: .55rem; padding: .8rem 1.1rem; }
.button-link.secondary { border: 1px solid var(--line); color: var(--text); background: transparent; }
.timeline-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.video-card { min-width: 0; overflow: hidden; }
.thumbnail { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; color: var(--muted); background: #03070c; }
.thumbnail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s ease; }
.thumbnail.is-loaded img { opacity: 1; }
.thumbnail.has-error { color: #ff8585; }
.table-thumbnail { width: 8rem; min-width: 8rem; border: 1px solid var(--line); border-radius: .55rem; }
.table-thumbnail span { padding: .5rem; text-align: center; font-size: .72rem; }
.video-card-body { padding: 1rem; }
.video-card-body h3 { margin: .25rem 0 .5rem; font-size: 1.2rem; }
.video-card-body time { color: var(--muted); }
.video-card-body dl { display: flex; gap: 1.5rem; margin: 1rem 0; }
.video-card-body dl div { display: grid; gap: .2rem; }
.video-card-body dt { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.video-card-body dd { margin: 0; }
.card-action { font-weight: 700; }
.pagination { display: flex; justify-content: center; margin: 2rem 0; }
.messages { margin: 0 0 1rem; }
.message { padding: 1rem 1.2rem; color: var(--cyan); }
.current-session { display: block; margin-top: .3rem; color: var(--cyan); font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; }
.session-table { table-layout: fixed; }
.session-table th:first-child, .session-table td:first-child { width: 36%; white-space: normal; overflow-wrap: anywhere; }
.session-table th:nth-child(2), .session-table td:nth-child(2) { width: 13%; }
.session-table th:nth-child(3), .session-table td:nth-child(3), .session-table th:nth-child(4), .session-table td:nth-child(4) { width: 16%; }
.session-table th:last-child, .session-table td:last-child { width: 19%; }
@media (max-width: 820px) { .search-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .topbar { align-items: flex-start; gap: 1rem; padding-block: 1rem; } .user-menu { flex-wrap: wrap; justify-content: flex-end; gap: .65rem 1rem; } .container { width: min(94vw, 1180px); padding-top: 2rem; } .user-menu > span { display: none; } .search-grid { grid-template-columns: 1fr; } .section-heading { align-items: flex-start; gap: .75rem; } .video-table th:nth-child(4), .video-table td:nth-child(4), .video-table th:nth-child(5), .video-table td:nth-child(5), .session-table th:nth-child(3), .session-table td:nth-child(3), .session-table th:nth-child(4), .session-table td:nth-child(4) { display: none; } .table-thumbnail { width: 6rem; min-width: 6rem; } .session-table th:first-child, .session-table td:first-child { width: 43%; } .session-table th:nth-child(2), .session-table td:nth-child(2) { width: 24%; white-space: normal; } .session-table th:last-child, .session-table td:last-child { width: 33%; padding-inline: .35rem; } .session-table button { width: 100%; padding-inline: .35rem; font-size: .76rem; } }
