:root {
  color-scheme: dark;
  --bg: #0d1720;
  --panel: #16212b;
  --panel-2: #1d2d3b;
  --text: #edf2f0;
  --muted: #a9bac7;
  --line: #31495d;
  --accent: #168bc7;
  --accent-2: #3b237d;
  --danger: #ef6b6b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--text);
  min-height: 38px;
  padding: 0 12px;
  cursor: pointer;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.ghost { background: transparent; }
button.danger { border-color: rgba(239, 107, 107, .65); color: #ffd8d8; }
input, select {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0e1112;
  color: var(--text);
  padding: 0 10px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.field-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #1289c8;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-mark { width: 34px; height: 34px; border-radius: 4px; background: #fff; display: grid; place-items: center; color: #168bc7; overflow: hidden; }
.portal-logo { width: 30px; height: 30px; display: block; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.app-download { color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 8px 10px; text-decoration: none; font-size: 13px; font-weight: 800; }
.user-menu { position: relative; }
.user-menu-btn { width: 38px; min-width: 38px; padding: 8px; }
.user-menu-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; min-width: 180px; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 12px 28px rgba(0, 0, 0, .35); }
.user-menu-pop span { color: var(--muted); font-size: 13px; word-break: break-word; }
.user-menu-pop button { justify-content: flex-start; }
.content { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-box { width: min(420px, 100%); display: grid; gap: 16px; padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.login-box h1 { margin: 0; font-size: 24px; }
.login-box p { margin: 0; color: var(--muted); }
.remember-login { display: flex; grid-template-columns: none; align-items: center; gap: 8px; color: var(--text); }
.remember-login input { width: 16px; min-height: 16px; padding: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.live-grid { align-items: start; }
.live-size-4 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.live-size-8, .live-size-16 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.camera-card { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; min-width: 0; }
.camera-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.camera-label { min-width: 0; }
.camera-title { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.camera-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.badge { color: #fff; background: var(--accent-2); border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 800; }
.player { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #050606; }
.live-recording-player { object-fit: contain; }
.live-playback-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #101516;
}
.live-playback-bar button { min-height: 30px; padding: 0 9px; font-size: 12px; }
.live-playback-bar span { color: var(--muted); font-size: 12px; }
.live-card-timeline { padding: 2px 10px 8px; border-top: 1px solid var(--line); background: #101516; }
.compact-timeline { gap: 4px; }
.compact-timeline .timeline-marks { height: 18px; margin: 0 6px -4px; }
.compact-timeline .timeline-mark { font-size: 10px; }
.compact-timeline .timeline-mark i { height: 6px; }
.compact-timeline .timeline-times { font-size: 11px; }
.compact-timeline .timeline-times strong { font-size: 11px; }
.player-open { color: var(--text); text-decoration: none; display: grid; place-items: center; border-top: 0; }
.player-open span { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; background: #121617; font-weight: 800; }
.tabs, .toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { align-self: start; }
.top-action {
  min-height: 30px;
  height: 30px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .12);
  color: #fff;
}
.top-action:hover { background: rgba(255, 255, 255, .2); }
.admin-title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.admin-title-row h2 { flex: 0 0 auto; }
.admin-subtabs { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; margin: 0; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.admin-subtabs button { min-height: 28px; height: 28px; padding: 0 10px; border-radius: 3px; background: #f4f8fa; color: #176c98; border-color: #b9d5e3; }
.admin-subtabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.admin-subtabs .save-filtered-cameras { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.admin-subtabs .save-filtered-cameras:disabled { opacity: .6; cursor: progress; }
.admin-settings { display: grid; grid-template-columns: minmax(180px, 260px) auto minmax(120px, 1fr); gap: 10px; align-items: end; margin-top: 10px; }
.live-toolbar { width: 100%; justify-content: space-between; align-items: center; gap: 8px; }
.filter-bar, .live-controls, .layout-switch, .live-pager { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.filter-bar { min-width: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.live-controls { margin-left: auto; justify-content: flex-end; }
.mode-switch { display: flex; gap: 4px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #0e1112; }
.mode-switch button { min-height: 30px; padding: 0 9px; border-color: transparent; background: transparent; }
.mode-switch button.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.layout-btn {
  width: 38px;
  min-height: 32px;
  padding: 0;
  display: inline-grid;
  grid-template-columns: 16px auto;
  place-content: center;
  gap: 4px;
  font-weight: 800;
}
.layout-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.layout-icon {
  width: 16px;
  height: 16px;
  display: grid;
  gap: 2px;
}
.layout-icon::before,
.layout-icon::after,
.layout-icon span { content: ""; display: block; }
.layout-icon-4 { grid-template-columns: repeat(2, 1fr); }
.layout-icon-8, .layout-icon-16 { grid-template-columns: repeat(4, 1fr); }
.layout-icon::before { box-shadow: 0 0 0 1px currentColor inset; }
.layout-icon-4::before { grid-column: 1; grid-row: 1; box-shadow: 0 0 0 1px currentColor inset, 9px 0 0 -1px currentColor, 0 9px 0 -1px currentColor, 9px 9px 0 -1px currentColor; }
.layout-icon-8::before { grid-column: 1 / -1; height: 6px; box-shadow: 0 0 0 1px currentColor inset, 0 8px 0 -1px currentColor; }
.layout-icon-16::before { grid-column: 1 / -1; height: 14px; background:
  linear-gradient(currentColor 0 0) 0 0 / 3px 3px,
  linear-gradient(currentColor 0 0) 5px 0 / 3px 3px,
  linear-gradient(currentColor 0 0) 10px 0 / 3px 3px,
  linear-gradient(currentColor 0 0) 15px 0 / 3px 3px,
  linear-gradient(currentColor 0 0) 0 5px / 3px 3px,
  linear-gradient(currentColor 0 0) 5px 5px / 3px 3px,
  linear-gradient(currentColor 0 0) 10px 5px / 3px 3px,
  linear-gradient(currentColor 0 0) 15px 5px / 3px 3px,
  linear-gradient(currentColor 0 0) 0 10px / 3px 3px,
  linear-gradient(currentColor 0 0) 5px 10px / 3px 3px,
  linear-gradient(currentColor 0 0) 10px 10px / 3px 3px,
  linear-gradient(currentColor 0 0) 15px 10px / 3px 3px;
  background-repeat: no-repeat;
}
.featured-live { display: grid; gap: 8px; max-width: 1180px; width: 100%; margin: 0 auto; }
.ad-slot {
  min-height: 58px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #0b0d0e;
  color: var(--muted);
  font-weight: 800;
}
.featured-player-card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.featured-player { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #050606; }
.thumb-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(96px, 128px);
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.thumb-card {
  height: auto;
  min-height: 78px;
  padding: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  text-align: left;
  background: var(--panel);
}
.thumb-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.thumb-card iframe, .thumb-card img { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; background: #050606; pointer-events: none; object-fit: cover; }
.thumb-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #171d1f, #0b0d0e);
  color: var(--muted);
}
.thumb-placeholder .ico { width: 22px; height: 22px; opacity: .75; }
.thumb-placeholder .ico svg { width: 22px; height: 22px; }
.thumb-card span { padding: 5px 6px; font-size: 11px; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.page-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.pager-btn:disabled { opacity: .45; cursor: default; }
.filter { min-height: 32px; height: 32px; padding: 0 10px; white-space: nowrap; }
.tab.active, .filter.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 800; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 12px; display: grid; gap: 12px; }
.panel h2 { margin: 0; font-size: 18px; }
.section-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-row { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; align-items: end; }
.compact-form { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(140px, .7fr) repeat(4, minmax(110px, .5fr)) auto auto; gap: 10px; align-items: end; }
.camera-filter-grid { display: grid; grid-template-columns: .7fr 1.3fr 1fr .8fr; gap: 10px; align-items: end; }
.group-filter-grid { display: grid; grid-template-columns: .8fr 1fr 1fr; gap: 10px; align-items: end; }
.camera-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; color: var(--text); }
.check input { width: auto; min-height: auto; }
.table { display: grid; gap: 8px; }
.sheet {
  display: grid;
  overflow: auto;
  border: 1px solid #c9d0d2;
  border-radius: 4px;
  background: #f7f7f7;
  color: #111;
  max-height: calc(100vh - 238px);
  scrollbar-width: thin;
}
.sheet-header, .sheet-row {
  display: grid;
  min-width: max-content;
}
.sheet-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(#f9f9f9, #e8ecee);
  border-bottom: 1px solid #c9d0d2;
  font-size: 12px;
  font-weight: 800;
  color: #4b5154;
}
.sheet-header span, .sheet-row > span {
  position: relative;
  min-height: 24px;
  padding: 2px 8px;
  border-right: 1px solid #d8dcde;
  border-bottom: 1px solid #e2e4e5;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sheet-filter-btn {
  margin-left: auto;
  width: 18px;
  min-width: 18px;
  height: 22px;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-left: 1px solid #c3c9cc;
  border-radius: 0;
  background: transparent;
}
.sheet-filter-btn::after {
  content: "";
  display: block;
  margin: 8px auto 0;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #8f979b;
}
.sheet-filter-btn.active { background: #d8edf8; }
.sheet-menu {
  position: absolute;
  top: 100%;
  right: -1px;
  z-index: 10;
  min-width: 190px;
  display: grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid #c9d0d2;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
  color: #111;
}
.sheet-menu button {
  justify-content: flex-start;
  border: 0;
  background: #fff;
  color: #111;
  min-height: 26px;
  text-align: left;
}
.sheet-menu button:hover { background: #d8edf8; }
.sheet-menu label {
  display: grid;
  gap: 3px;
  padding: 5px;
  color: #111;
  font-weight: 700;
}
.sheet-menu input {
  min-height: 26px;
  height: 26px;
  border-color: #aab4b9;
  color: #111;
  background: #fff;
}
.sheet-row {
  background: #fff;
  color: #111;
  font-size: 12px;
  min-height: 25px;
}
.sheet-row:nth-child(odd) { background: #f4f4f4; }
.sheet-row:hover { background: #e8f4fb; }
.sheet-row.active { background: #b9dded; }
.sheet-row strong { color: #111; }
.sheet-row input, .sheet-row select {
  min-height: 22px;
  height: 22px;
  padding: 2px 6px;
  border-radius: 2px;
  border-color: #c9d0d2;
  background: #fff;
  color: #111;
  font-size: 12px;
}
.sheet-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: 14px;
  padding: 0;
}
.sheet-row button {
  min-height: 22px;
  height: 22px;
  padding: 0 8px;
  border-radius: 3px;
  font-size: 12px;
}
.sheet-actions { gap: 4px; flex-wrap: nowrap; }
.sheet-empty {
  padding: 12px;
  color: #666;
  font-size: 13px;
  background: #fff;
}
.ok-text { color: #008000; font-weight: 800; }
.danger-text { color: #d60000; font-weight: 800; }
.bad-text { color: #d60000; font-weight: 800; }
.family-panel h2, .family-panel h3 { margin: 0; }
.family-panel p { margin: 4px 0 0; color: var(--muted); }
.family-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 12px; align-items: start; }
.family-header { grid-template-columns: 1.4fr 90px 110px 180px 270px; }
.family-table { overflow: auto; border: 1px solid #c9d0d2; border-radius: 4px; background: #fff; color: #111; }
.family-table table { width: 100%; border-collapse: collapse; min-width: 820px; }
.family-table td { height: 34px; padding: 4px 8px; border-right: 1px solid #d8dcde; border-bottom: 1px solid #e2e4e5; font-size: 13px; }
.family-table tr:nth-child(odd) { background: #f4f4f4; }
.family-table tr:hover { background: #e8f4fb; }
.family-table input { min-height: 28px; height: 28px; background: #fff; color: #111; border-color: #c9d0d2; }
.inline-field { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 6px; color: #4b5154; }
.inline-field span { font-size: 12px; }
.row-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.row-actions button { min-height: 28px; height: 28px; padding: 0 9px; }
.family-form { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.family-form.disabled-form { opacity: .72; }
.camera-sheet .sheet-header, .camera-sheet .camera-row {
  grid-template-columns: 136px 196px 136px 116px 48px 54px 72px 72px 68px 126px 238px;
}
.camera-row > span:first-child {
  overflow: hidden;
  white-space: nowrap;
}
.camera-row > span:first-child strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.camera-row .camera-last-recording {
  gap: 0;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}
.camera-row .camera-last-recording small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.camera-row .sheet-actions button {
  padding: 0 6px;
}
.group-sheet .sheet-header, .group-sheet .group-row {
  grid-template-columns: 150px 220px 150px 190px minmax(320px, 1fr) 90px;
}
.user-result-sheet .sheet-header, .user-result-sheet .user-result {
  grid-template-columns: minmax(190px, 1.4fr) minmax(190px, 1.4fr) minmax(150px, 1fr) 70px 90px;
}
.user-result.sheet-row {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
  padding: 0;
  justify-items: stretch;
  background: #fff;
}
.user-result.sheet-row.active { background: #fff5ce; box-shadow: inset 3px 0 0 var(--accent-2); }
.user-admin-layout { grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.user-admin-layout #userEditorMount { min-width: 0; }
.status-sheet .sheet-header, .status-sheet .status-row {
  grid-template-columns: 112px minmax(210px, 1.35fr) minmax(150px, .85fr) 90px 90px minmax(190px, 1fr) minmax(190px, 1fr) 110px;
}
.status-row.active { background: #fff5ce; box-shadow: inset 3px 0 0 var(--accent-2); }
.status-row small { display: block; color: #777; font-size: 11px; }
.status-row .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}
.status-row .status-pill.online {
  color: #052e16;
  background: #7ee787;
  border: 1px solid #238636;
}
.status-row .status-pill.offline {
  color: #fff;
  background: #d60000;
  border: 1px solid #8f0000;
}
.admin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, .8fr); gap: 14px; align-items: start; }
.user-row { display: grid; grid-template-columns: 1.1fr .7fr 2.4fr auto; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #121617; }
.user-search { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px; align-items: end; }
.user-workspace { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(0, 1.8fr); gap: 12px; align-items: start; }
.user-results { display: grid; gap: 8px; align-content: start; }
.user-result { min-height: auto; padding: 10px; display: grid; gap: 3px; justify-items: start; text-align: left; background: #121617; }
.user-result.active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(31, 191, 117, .3) inset; }
.user-result span { color: var(--muted); font-size: 12px; }
.user-result small { color: #b8d8cc; font-size: 11px; }
.user-editor { display: grid; gap: 10px; padding: 10px; }
.ixc-user-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding: 10px; border: 1px solid rgba(31, 191, 117, .35); border-radius: 8px; background: rgba(31, 191, 117, .06); }
.ixc-user-info div { display: grid; gap: 2px; min-width: 0; }
.ixc-user-info .wide { grid-column: 1 / -1; }
.ixc-user-info span { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 800; }
.ixc-user-info strong { overflow-wrap: anywhere; }
.password-reset-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; align-items: end; }
.password-field { display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: stretch; }
.password-field input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.password-toggle {
  min-height: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.password-toggle .ico,
.password-toggle .ico svg { width: 18px; height: 18px; display: block; }
.subuser-box { display: grid; gap: 8px; border-top: 1px solid #d8dcde; padding-top: 10px; }
.subuser-list { display: grid; gap: 5px; }
.subuser-row { min-height: 32px; padding: 6px 8px; display: grid; gap: 2px; text-align: left; background: #fff; color: #111; border-color: #c9d0d2; }
.subuser-row span { color: #566268; font-size: 11px; }
.subuser-form { display: grid; gap: 8px; }
.compact-checks { max-height: 130px; overflow: auto; align-content: start; padding-right: 2px; }
.camera-row { align-items: center; }
.camera-source-field { display: grid; grid-template-columns: 150px minmax(220px, 1fr); gap: 6px 8px; color: #111; }
.camera-retention { min-width: 0; }
.camera-last-recording { display: grid; gap: 2px; color: #555; font-size: 12px; }
.camera-last-recording small { color: #777; overflow-wrap: anywhere; }
.copy-field { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; }
.camera-rtmp-link { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.nvr-settings { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 10px; align-items: end; }
.nvr-settings .wide { grid-column: span 2; }
.nvr-admin-grid { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(0, 1.5fr); gap: 12px; }
.nvr-list { display: grid; align-content: start; gap: 8px; }
.nvr-sheet .sheet-header, .nvr-sheet .nvr-row { grid-template-columns: minmax(180px, 1.2fr) minmax(170px, 1fr) 120px 70px; }
.nvr-row.sheet-row {
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  text-align: left;
  padding: 0;
  justify-items: stretch;
  background: #fff;
}
.nvr-row.sheet-row.active { background: #fff5ce; box-shadow: inset 3px 0 0 var(--accent-2); }
.nvr-row small { display: block; color: #777; font-size: 11px; }
.nvr-list-item { min-height: auto; display: grid; gap: 3px; text-align: left; border-color: var(--line); background: #101516; }
.nvr-list-item.active { border-color: var(--accent); }
.nvr-list-item span, .nvr-list-item small { color: var(--muted); }
.group-row { align-items: center; }
.group-cameras { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.group-meta { display: block; margin: 3px 0 8px; color: var(--muted); font-size: 12px; }
.permission-block { display: grid; gap: 8px; }
.permission-title { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.alert-permission-block { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(15, 23, 42, .04); }
.alert-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.group-check { border-color: rgba(31, 191, 117, .55); background: rgba(31, 191, 117, .08); }
.audit-table { display: grid; gap: 6px; }
.audit-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 13px; }
.admin-sheet-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); gap: 10px; align-items: start; }
.admin-sheet-main { min-width: 0; display: grid; gap: 10px; }
.sheet-toolbar { margin: 0; }
.admin-work-panel {
  background: #eef2f4;
  color: #111;
  border-color: #b9c7ce;
  padding: 8px;
  gap: 8px;
}
.admin-work-panel h2 {
  color: #111;
  font-size: 15px;
  line-height: 1.1;
}
.admin-work-panel .section-actions {
  min-height: 34px;
  padding: 0;
}
.admin-work-panel .muted {
  color: #506168;
}
.admin-work-panel .actions button {
  min-height: 30px;
  height: 30px;
  border-radius: 3px;
}
.admin-work-panel .admin-sheet-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 8px;
}
.admin-work-panel .camera-admin-layout {
  grid-template-columns: minmax(0, 1fr);
}
.admin-work-panel .camera-admin-layout.side-open {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
}
#adminCameraSideMount:empty { display: none; }
.admin-work-panel .table {
  gap: 0;
}
.admin-side-panel {
  position: sticky;
  top: 64px;
  min-height: 292px;
  border: 1px solid #b9c7ce;
  border-radius: 4px;
  background: #fff;
  color: #111;
  overflow: hidden;
}
.side-tabs {
  display: flex;
  background: #168bc7;
  color: #fff;
}
.side-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-weight: 800;
}
.side-tabs button.active { background: #e9f4fb; color: #3b237d; }
.side-form {
  display: grid;
  gap: 6px;
  padding: 8px;
}
.side-form label {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #111;
  font-size: 12px;
}
.side-form input, .side-form select {
  min-height: 24px;
  height: 24px;
  background: #fff;
  color: #111;
  border-color: #c9d0d2;
  border-radius: 2px;
  font-size: 12px;
}
.side-form .check {
  display: flex;
  grid-template-columns: none;
  border-color: #c9d0d2;
  background: #fff;
  color: #111;
  padding: 5px 8px;
}
.admin-side-panel .check {
  border-color: #c9d0d2;
  background: #fff;
  color: #111;
}
.admin-side-panel .check input {
  accent-color: var(--accent);
}
.side-status {
  display: grid;
  gap: 3px;
  padding: 7px;
  border: 1px solid #d8dcde;
  background: #fff;
  color: #555;
  font-size: 12px;
}
.side-actions { display: flex; gap: 6px; justify-content: flex-end; }
.admin-side-panel > .side-actions { padding: 0 10px 10px; }
.status-summary-panel { gap: 8px; }
.status-summary-panel .section-actions { margin-bottom: -2px; }
.status-summary-panel #refreshStatus { min-height: 34px; }
.status-cards { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 8px; }
.status-filter-grid { display: grid; grid-template-columns: .8fr 1.1fr .9fr .75fr .85fr .85fr; gap: 8px; align-items: end; }
.status-filter-grid label { gap: 4px; font-size: 12px; }
.status-filter-grid input, .status-filter-grid select { min-height: 34px; height: 34px; }
.status-card { border: 1px solid #c9d0d2; border-radius: 4px; background: #fff; color: #111; padding: 8px 10px; display: grid; gap: 3px; }
.status-card span { color: #506168; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.status-card strong { font-size: 24px; line-height: 1; }
.status-card small { color: #506168; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-updated { margin-top: -2px; font-size: 13px; }
.status-workspace-panel { min-height: calc(100vh - 224px); align-content: start; }
.status-layout { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.status-layout:not(.side-open) { display: block; }
.status-layout.side-open { grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
#statusSideMount { min-width: 0; }
#statusSideMount:empty { display: none; }
.status-layout:not(.side-open) #statusSideMount { display: none; }
.status-layout .admin-sheet-main { gap: 8px; width: 100%; }
.status-layout .section-actions h2 { font-size: 17px; }
.status-layout .sheet { max-height: calc(100vh - 344px); width: 100%; justify-self: stretch; }
.status-sheet {
  width: 100%;
}
.status-sheet .sheet-header,
.status-sheet .status-row {
  min-width: 100%;
}
.status-side-panel {
  top: 64px;
  min-height: 0;
  height: fit-content;
  align-self: start;
}
.status-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid #c9d0d2;
  background: #168bc7;
  color: #111;
}
.status-side-head div {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.status-side-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-side-head strong, .status-side-head span { color: #fff; }
.status-side-head span { font-size: 12px; font-weight: 800; }
.status-side-head button {
  flex: 0 0 auto;
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border-radius: 3px;
  font-size: 12px;
}
.status-side-grid {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0;
  padding: 8px 10px 10px;
  font-size: 12px;
}
.status-side-grid span,
.status-side-grid strong {
  min-height: 26px;
  padding: 5px 0;
  border-bottom: 1px solid #e1e5e7;
}
.status-side-grid span { color: #566268; font-weight: 700; }
.status-side-grid strong { color: #111; overflow-wrap: anywhere; }
.status-card.warn { border-color: rgba(245, 185, 66, .65); }
.status-card.danger { border-color: rgba(239, 107, 107, .75); }
.status-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.status-table { width: 100%; min-width: 860px; border-collapse: collapse; background: #121617; }
.status-table th, .status-table td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: middle; }
.status-table th { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; background: var(--panel-2); }
.status-table td span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex !important; align-items: center; width: fit-content; margin: 0 !important; border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--text) !important; font-weight: 800; }
.status-pill.ok { color: #07120d !important; background: var(--accent); border-color: var(--accent); }
.status-pill.warn { color: #07120d !important; background: var(--accent-2); border-color: var(--accent-2); }
.muted { color: var(--muted); }
.error { color: #ffd8d8; background: rgba(239, 107, 107, .14); border: 1px solid rgba(239, 107, 107, .4); padding: 10px; border-radius: 6px; }
.status-box { color: #07120d; background: var(--accent-2); border: 1px solid rgba(245, 185, 66, .7); padding: 10px; border-radius: 6px; font-weight: 800; }
.hidden { display: none !important; }
.ico { display: inline-grid; place-items: center; width: 18px; height: 18px; vertical-align: -4px; }
.ico svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.brand-mark .ico { width: 18px; height: 18px; }
.stream-links { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.stream-links a { color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #121617; font-size: 13px; }
.stream-links a:hover { border-color: var(--accent); }
.recording-form { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 10px; align-items: end; }
.recording-list { display: grid; gap: 10px; }
.recording-row { display: grid; grid-template-columns: 220px minmax(280px, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 10px; }
.recording-row div { display: grid; gap: 4px; }
.recording-row span { color: var(--muted); font-size: 13px; }
.recording-row video { width: 100%; max-height: 260px; background: #050606; border-radius: 6px; }
.playback-nvr { height: calc(100vh - 118px); min-height: 520px; display: grid; grid-template-columns: 200px minmax(0, 1fr) 210px; grid-template-rows: minmax(260px, 1fr) 128px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0b0d0e; }
.playback-camera-list { overflow-y: auto; background: #f7f7f7; color: #111; padding: 6px; display: grid; align-content: start; gap: 2px; }
.playback-camera { min-height: 24px; padding: 3px 5px; border: 0; background: transparent; color: #111; display: flex; align-items: center; gap: 6px; text-align: left; font-size: 13px; }
.playback-camera .ico { width: 13px; height: 13px; color: #111; }
.playback-camera.active { color: #e31722; font-weight: 700; }
.playback-main { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr); background: #303030; overflow: hidden; }
.playback-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 2px; background: #101010; }
.playback-cell { position: relative; min-height: 120px; background: #303030; border: 1px solid #151515; overflow: hidden; }
.playback-cell.active { border-color: #ffe100; }
.playback-cell.assigned { background: #262626; cursor: pointer; }
.playback-cell.empty { cursor: pointer; }
.playback-cell.empty:hover, .playback-cell.assigned:hover { border-color: #777; }
.playback-cell-title { position: absolute; top: 6px; left: 8px; z-index: 2; color: #fff; font-size: 12px; text-shadow: 0 1px 2px #000; }
.playback-cell video { width: 100%; height: 100%; display: block; object-fit: contain; background: #050505; }
.playback-empty-hint { height: 100%; display: grid; place-items: center; color: #d8d8d8; font-size: 13px; }
.playback-controls { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 6px; background: #f5f5f5; color: #111; border-top: 1px solid #ccc; }
.playback-controls button { min-height: 26px; padding: 4px 10px; color: #111; background: #fff; border-color: #c8c8c8; }
.playback-controls button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.playback-search { background: #f4f4f4; color: #111; border-left: 1px solid #c8c8c8; padding: 10px; display: grid; align-content: start; gap: 10px; }
.playback-search label { color: #111; }
.playback-search input { background: #fff; color: #111; border-color: #c8c8c8; }
.playback-search .muted { color: #666; }
.playback-search-form { display: grid; gap: 10px; }
.playback-search-form button { background: #de1722; border-color: #de1722; color: #fff; }
.playback-timeline { grid-column: 1 / -1; background: #050505; border-top: 1px solid #252525; padding: 5px 18px 7px; min-height: 128px; touch-action: none; cursor: grab; }
.playback-timeline:active { cursor: grabbing; }
.playback-timeline .muted { color: #c8c8c8; }
.nvr-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.nvr-table { width: 100%; border-collapse: collapse; min-width: 760px; background: #121617; }
.nvr-table th, .nvr-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: middle; }
.nvr-table th { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; background: var(--panel-2); }
.nvr-table tr { cursor: pointer; }
.nvr-table tr:hover { background: rgba(31, 191, 117, .08); }
.nvr-table tr.active { background: rgba(245, 185, 66, .12); }
.nvr-table td:first-child, .nvr-table td:nth-child(2), .nvr-table th:first-child, .nvr-table th:nth-child(2) { width: 48px; text-align: center; }
.nvr-table td:nth-child(4) { width: 110px; white-space: nowrap; }
.nvr-table td:last-child { width: 110px; }
.nvr-table span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.nvr-select { width: auto; min-height: auto; }
.nvr-player { display: grid; gap: 10px; }
.nvr-player video { width: 100%; max-width: 1100px; max-height: 520px; aspect-ratio: 16 / 9; justify-self: center; background: #000; border: 1px solid var(--line); border-radius: 8px; }
.nvr-player-placeholder { width: 100%; max-width: 1100px; aspect-ratio: 16 / 9; justify-self: center; display: grid; place-items: center; background: #11181d; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-weight: 800; text-align: center; padding: 20px; }
.player-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.nvr-search-form { grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; align-items: end; }
.nvr-help-text { font-size: 13px; }
.nvr-scrub { width: 100%; display: grid; gap: 6px; touch-action: none; user-select: none; }
.nvr-scrub-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; }
.nvr-scrub-head strong { color: #fff; font-size: 15px; font-weight: 900; text-align: center; }
.nvr-scrub-head span:last-child { text-align: right; }
.nvr-scrub-body { position: relative; height: 86px; overflow: hidden; border-radius: 8px; background: #070909; border: 1px solid #32434d; cursor: grab; touch-action: none; user-select: none; }
.nvr-scrub-body.dragging { cursor: grabbing; }
.nvr-scrub-records { position: absolute; left: 0; right: 0; bottom: 12px; height: 34px; background: rgba(255, 255, 255, .09); }
.nvr-scrub-block { position: absolute; top: 0; bottom: 0; background: #eef4f8; border-left: 1px solid rgba(0, 0, 0, .2); border-right: 1px solid rgba(0, 0, 0, .2); }
.nvr-scrub-marks { position: absolute; inset: 8px 0 auto; height: 30px; }
.nvr-scrub-mark { position: absolute; top: 0; transform: translateX(-50%); color: #d9e7ee; font-size: 12px; font-weight: 800; text-shadow: 0 1px 2px #000; pointer-events: none; }
.nvr-scrub-mark i { width: 1px; height: 10px; margin: 0 auto 2px; display: block; background: #d9e7ee; opacity: .9; }
.nvr-scrub-playhead { position: absolute; top: 4px; bottom: 5px; left: 50%; width: 0; pointer-events: none; }
.nvr-scrub-playhead i { position: absolute; top: 0; bottom: 0; width: 3px; transform: translateX(-50%); background: #ff2b3a; box-shadow: 0 0 0 1px rgba(255, 255, 255, .5), 0 0 8px rgba(255, 43, 58, .55); }
.nvr-native-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: .01; cursor: pointer; touch-action: pan-x; accent-color: var(--accent); z-index: 4; }
.nvr-scrub-help { color: var(--muted); font-size: 12px; text-align: center; }
.nvr-app-playback + .panel { display: none; }
.nvr-app-playback { padding: 6px 10px; gap: 6px; }
.nvr-app-playback h2 { display: none; }
.nvr-app-playback .nvr-player { gap: 4px; }
.nvr-app-playback .nvr-player video,
.nvr-app-playback .nvr-player-placeholder {
  max-width: 1040px;
  max-height: min(360px, 38vh);
  border-radius: 6px;
}
.nvr-app-playback .player-controls {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  padding: 2px 0;
  gap: 6px;
}
.nvr-app-playback .player-controls button { min-height: 32px; height: 32px; padding: 0 10px; }
.nvr-app-playback .stream-links,
.nvr-app-playback > .muted { display: none; }
.nvr-app-playback .recording-form { margin-top: 0; gap: 6px; }
.nvr-app-playback .recording-form label { gap: 3px; font-size: 12px; }
.nvr-app-playback .recording-form input,
.nvr-app-playback .recording-form select { min-height: 34px; height: 34px; padding: 0 8px; }
.nvr-app-playback .recording-form button { min-height: 34px; height: 34px; }
.nvr-app-playback .status-box { padding: 6px 10px; min-height: 32px; }
.nvr-app-playback .nvr-scrub { gap: 2px; }
.nvr-app-playback .nvr-scrub-head { font-size: 11px; }
.nvr-app-playback .nvr-scrub-head strong { font-size: 14px; }
.nvr-app-playback .nvr-scrub-body { height: 66px; border-radius: 6px; }
.nvr-app-playback .nvr-scrub-records { bottom: 10px; height: 30px; }
.nvr-app-playback .nvr-scrub-marks { top: 6px; }
.nvr-app-playback .nvr-scrub-help { display: none; }
@media (max-width: 760px) {
  .nvr-search-form { grid-template-columns: 1fr; }
  .nvr-app-playback .nvr-player video,
  .nvr-app-playback .nvr-player-placeholder { max-height: 34vh; }
}
.timeline { min-height: 36px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(20px, 1fr); gap: 3px; align-items: stretch; }
.timeline-segment { min-height: 28px; padding: 0; background: var(--accent); border-color: rgba(31, 191, 117, .8); }
.timeline-segment.active { outline: 2px solid var(--accent-2); outline-offset: 2px; background: var(--accent-2); }
.timeline-segment.disabled { background: var(--panel-2); border-color: var(--line); cursor: not-allowed; opacity: .55; }
.timeline.local-timeline { display: flex; gap: 3px; cursor: pointer; user-select: none; }
.timeline.local-timeline .timeline-segment { display: block; border: 1px solid rgba(31, 191, 117, .8); border-radius: 6px; pointer-events: none; }
.timeline-range-wrap { display: grid; gap: 4px; width: 100%; min-height: 112px; align-content: center; }
.timeline-zoom-controls { display: flex; justify-content: flex-end; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; touch-action: manipulation; }
.timeline-zoom-controls button { min-width: 42px; height: 26px; min-height: 26px; padding: 0 8px; display: grid; place-items: center; background: #1b2022; color: #eef5f1; border-color: #3a4447; white-space: nowrap; }
.timeline-speed { display: flex; align-items: center; gap: 4px; color: #eef5f1; white-space: nowrap; }
.timeline-speed select { min-height: 26px; height: 26px; width: 62px; padding: 0 6px; background: #1b2022; color: #eef5f1; border: 1px solid #3a4447; border-radius: 6px; font-weight: 700; }
.timeline-selection-controls { display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: #eef5f1; font-size: 12px; touch-action: manipulation; }
.timeline-selection-controls button { min-height: 24px; height: 24px; padding: 0 8px; background: #1b2022; color: #eef5f1; border-color: #3a4447; white-space: nowrap; }
.timeline-selection-controls strong { min-width: 172px; text-align: center; color: var(--accent-2); font-size: 12px; }
.timeline-marks { position: relative; height: 24px; margin: 0 8px -2px; color: rgba(238, 245, 241, .82); cursor: grab; }
.timeline-mark { position: absolute; top: 0; transform: translateX(-50%); display: grid; justify-items: center; gap: 1px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.timeline-mark i { width: 1px; height: 8px; background: rgba(238, 245, 241, .82); display: block; }
.timeline-mark b { font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
.alarm-marker {
  position: absolute;
  left: 0;
  bottom: -10px;
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--danger);
  transform: translateX(-50%);
  z-index: 3;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.alarm-marker:hover { background: #ff9b5f; border-color: var(--accent-2); }
.timeline-range { width: 100%; height: 28px; accent-color: var(--accent); cursor: pointer; }
.timeline-selection-track { position: relative; height: 6px; margin: -4px 9px -7px; background: rgba(255, 255, 255, .18); border-radius: 999px; overflow: hidden; }
.timeline-selection-track span { position: absolute; top: 0; bottom: 0; background: rgba(255, 193, 68, .92); border-radius: 999px; }
.timeline-range::-webkit-slider-runnable-track { height: 10px; border-radius: 999px; }
.timeline-range::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -7px; }
.timeline-range::-moz-range-track { height: 10px; border-radius: 999px; }
.timeline-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 999px; }
.timeline-times { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; font-size: 12px; color: var(--muted); cursor: grab; }
.timeline-times strong { color: var(--accent-2); font-size: 13px; text-align: center; }
.timeline-times span:last-child { text-align: right; }
.download-link { color: #fff; background: var(--accent); border-radius: 6px; padding: 10px 12px; text-decoration: none; font-weight: 800; text-align: center; }
.apps-panel { max-width: 860px; }
.app-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 12px; }
.app-grid.compact { max-width: 640px; }
.app-card { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: #101516; padding: 14px; }
.app-card h3 { margin: 0; }
.app-card p { margin: 0; color: var(--muted); }
.notice-box { display: grid; gap: 8px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #101516; color: var(--muted); }
.notice-box strong { color: #fff; }
.notice-box p { margin: 0; }
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 107, 107, .16); }
.status-dot.online { background: var(--accent); box-shadow: 0 0 0 3px rgba(31, 191, 117, .16); }
.alarm-filter-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)) auto auto auto; gap: 8px; align-items: end; }
.alarm-filter-grid button { min-height: 38px; }
.alarm-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #121617; }
.alarm-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.alarm-table th, .alarm-table td { border-bottom: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: middle; line-height: 1.2; }
.alarm-table th { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; background: var(--panel-2); }
.alarm-table td { font-size: 13px; }
.alarm-table td span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.alarm-table tr:hover { background: rgba(31, 191, 117, .08); }
@media (max-width: 900px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 12px; }
  .content { padding: 8px; gap: 8px; }
  .form-row, .user-row, .user-search, .user-workspace, .camera-row, .camera-filter-grid, .group-filter-grid, .status-filter-grid, .audit-row, .admin-grid, .admin-settings, .compact-form, .recording-form, .recording-row, .alarm-filter-grid, .nvr-settings, .nvr-admin-grid { grid-template-columns: 1fr; }
  .family-layout { grid-template-columns: 1fr; }
  .family-table table { min-width: 720px; }
  .family-header { grid-template-columns: 1.2fr 80px 95px 160px 250px; }
  .admin-sheet-layout { grid-template-columns: 1fr; }
  .admin-side-panel { position: static; min-height: 0; }
  .side-form label { grid-template-columns: 1fr; }
  .nvr-settings .wide { grid-column: auto; }
  .grid, .app-grid { grid-template-columns: 1fr; }
  .live-toolbar { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
  .live-controls { margin-left: 0; justify-content: flex-start; flex: 0 0 auto; }
  .mode-switch button { min-height: 28px; padding: 0 8px; }
  .featured-live { gap: 6px; }
  .ad-slot { min-height: 46px; font-size: 12px; }
  .stream-links { overflow-x: auto; }
  .thumb-strip { grid-auto-columns: minmax(78px, 96px); padding-bottom: 6px; }
  .thumb-card { min-height: 66px; }
  .thumb-card span { font-size: 11px; padding: 5px 6px; }
  .nvr-player video { max-height: 58vh; }
  .playback-nvr { grid-template-columns: 1fr; grid-template-rows: auto minmax(260px, 38vh) auto auto; height: auto; min-height: 0; }
  .playback-nvr.mobile-single { grid-template-rows: auto minmax(230px, 34vh) auto auto; }
  .playback-camera-list { max-height: none; overflow-x: auto; overflow-y: hidden; display: flex; gap: 6px; padding: 6px; }
  .playback-camera { flex: 0 0 auto; border: 1px solid #d5d5d5; border-radius: 6px; padding: 7px 9px; }
  .playback-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(140px, 1fr)); }
  .playback-nvr.mobile-single .playback-grid { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  .playback-search { border-left: 0; border-top: 1px solid #c8c8c8; }
  .timeline-zoom-controls { justify-content: stretch; display: grid; grid-template-columns: 44px 1fr auto 1fr 44px 74px; gap: 5px; }
  .timeline-zoom-controls button { height: 34px; min-height: 34px; font-size: 13px; }
  .timeline-speed { gap: 3px; font-size: 12px; justify-content: end; }
  .timeline-speed select { width: 48px; height: 34px; min-height: 34px; padding: 0 3px; font-size: 13px; }
  .timeline-selection-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .timeline-selection-controls strong { grid-column: 1 / -1; min-width: 0; order: -1; }
  .timeline-selection-controls button { height: 32px; min-height: 32px; font-size: 13px; }
  .timeline-marks { height: 30px; margin-inline: 16px; }
  .timeline-mark { font-size: 11px; }
  .timeline-mark b { background: rgba(5, 5, 5, .72); border-radius: 4px; padding: 1px 3px; }
  .timeline-times { font-size: 12px; gap: 6px; }
  .timeline-times strong { font-size: 13px; }
  .timeline-range { height: 38px; }
  .timeline-range::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -10px; }
  .timeline-range::-moz-range-thumb { width: 30px; height: 30px; }
}
