:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-strong: #eef3f9;
  --sidebar: rgba(255, 255, 255, 0.94);
  --text: #111c2e;
  --text-soft: #344158;
  --muted: #6b778c;
  --muted-strong: #536077;
  --border: #e1e7ef;
  --border-strong: #cfd8e5;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eaf1ff;
  --accent: #6d4aff;
  --success: #19a55a;
  --success-soft: #e9f9f0;
  --warning: #f59e0b;
  --warning-soft: #fff6df;
  --danger: #ef4444;
  --danger-strong: #dc2626;
  --danger-soft: #fff0f0;
  --purple-soft: #f2edff;
  --shadow-xs: 0 1px 2px rgba(17, 28, 46, 0.04);
  --shadow-sm: 0 8px 24px rgba(17, 28, 46, 0.06);
  --shadow-md: 0 18px 50px rgba(17, 28, 46, 0.1);
  --shadow-lg: 0 28px 80px rgba(17, 28, 46, 0.16);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --sidebar-width: 272px;
  --topbar-height: 74px;
  --transition: 180ms cubic-bezier(.2, .8, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1420;
  --bg-elevated: rgba(18, 27, 42, 0.9);
  --surface: #151f2f;
  --surface-soft: #192536;
  --surface-strong: #213047;
  --sidebar: rgba(15, 23, 36, 0.95);
  --text: #edf3ff;
  --text-soft: #c4cfe0;
  --muted: #8d9ab0;
  --muted-strong: #aab6c8;
  --border: #27364c;
  --border-strong: #354761;
  --brand: #6b91ff;
  --brand-strong: #87a6ff;
  --brand-soft: rgba(61, 105, 255, 0.15);
  --success-soft: rgba(25, 165, 90, 0.14);
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger-soft: rgba(239, 68, 68, 0.14);
  --purple-soft: rgba(109, 74, 255, 0.15);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 18px 50px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% -8%, rgba(37, 99, 235, 0.12), transparent 28rem),
    radial-gradient(circle at 42% 110%, rgba(109, 74, 255, 0.08), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

button, a, input, select, summary {
  outline: none;
}

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.fill-current { fill: currentColor; stroke: none; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ambient {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(1px);
  opacity: .5;
  z-index: -1;
}

.ambient-one {
  width: 520px;
  height: 520px;
  right: -330px;
  top: 90px;
  background: radial-gradient(circle, rgba(74, 126, 255, .12), transparent 70%);
}

.ambient-two {
  width: 440px;
  height: 440px;
  left: 22%;
  bottom: -340px;
  background: radial-gradient(circle, rgba(109, 74, 255, .09), transparent 70%);
}

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  transition: transform var(--transition), background var(--transition);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 2px 8px 10px;
}

.brand {
  display: flex;
  align-items: center;
  width: 202px;
  min-height: 60px;
  border-radius: 12px;
}

.brand-logo {
  width: 194px;
  height: auto;
  object-fit: contain;
}

.sidebar-close { display: none !important; }

.primary-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.nav-label {
  margin: 10px 13px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nav-label-spaced { margin-top: 22px; }

.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  padding: 5px 12px 5px 7px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--text-soft);
  font-weight: 600;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-soft);
  transform: translateX(1px);
}

.nav-item.is-active {
  color: var(--brand-strong);
  background: linear-gradient(135deg, rgba(37, 99, 235, .13), rgba(109, 74, 255, .07));
  border-color: rgba(37, 99, 235, .12);
  box-shadow: inset 0 1px rgba(255, 255, 255, .45);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--muted-strong);
}

.nav-item.is-active .nav-icon { color: var(--brand); }

.nav-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .1);
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.nav-count-accent {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
}

.storage-widget,
.user-card {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
}

.storage-widget:hover,
.user-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.storage-widget {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  text-align: left;
}

.storage-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--purple-soft);
  color: var(--accent);
}

.storage-copy { min-width: 0; }
.storage-title-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.storage-title-row strong { font-size: 13px; }
.storage-title-row span { color: var(--muted); font-weight: 700; }
.storage-track { display: block; height: 6px; margin: 7px 0 5px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.storage-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.storage-caption { color: var(--muted); font-size: 11px; }

.user-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  text-align: left;
}

.avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e9efff, #f0edff);
  color: #38527e;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .02em;
}

html[data-theme="dark"] .avatar { background: linear-gradient(145deg, #263957, #332c61); color: #dce6ff; }

.avatar-small { width: 36px; height: 36px; font-size: 12px; }

.avatar-online {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
}

.user-copy { display: flex; flex-direction: column; min-width: 0; }
.user-copy strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: var(--muted); font-size: 12px; }
.user-chevron { width: 16px; color: var(--muted); }

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: none;
  border: 0;
  background: rgba(10, 18, 30, .38);
  backdrop-filter: blur(3px);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 35;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: var(--bg-elevated);
  border-bottom: 1px solid rgba(207, 216, 229, .75);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

html[data-theme="dark"] .topbar { border-bottom-color: rgba(53, 71, 97, .8); }

.topbar-mobile-brand { display: none; align-items: center; gap: 10px; }
.topbar-mobile-brand img { width: 34px; height: 34px; object-fit: contain; }
.topbar-mobile-brand > span { display: flex; flex-direction: column; font-weight: 800; line-height: 1.02; }
.topbar-mobile-brand small { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.topbar-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 550;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(25, 165, 90, .1);
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid rgba(25, 165, 90, .45);
  border-radius: 50%;
  animation: pulse-ring 2.3s ease-out infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(.45); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(1.35); opacity: 0; }
}

.topbar-time {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-soft);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.notification-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border: 2px solid var(--bg-elevated);
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 800;
}

.theme-icon-dark { display: none; }
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="dark"] .theme-icon-dark { display: block; }

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  margin-left: 4px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.topbar-profile:hover { background: var(--surface); border-color: var(--border); }
.topbar-profile-copy { display: flex; flex-direction: column; min-width: 98px; text-align: left; line-height: 1.2; }
.topbar-profile-copy strong { font-size: 13px; }
.topbar-profile-copy small { color: var(--muted); font-size: 11px; }
.topbar-profile > .icon { width: 16px; color: var(--muted); }

.page-content { padding: 30px 28px 20px; }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  max-width: 1800px;
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
}

.eyebrow span { margin: 0 6px; color: var(--border-strong); }

.heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }
.heading-line h1 { margin: 0; font-size: clamp(28px, 2.4vw, 40px); line-height: 1.08; letter-spacing: -.035em; }

.online-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 11px;
  border: 1px solid rgba(25, 165, 90, .18);
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
}

.online-chip > span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(25, 165, 90, .12); }
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 3px;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.view-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.view-button:hover { color: var(--text); }
.view-button.is-active { color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .1); }

.select-control {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 182px;
  height: 46px;
  padding-left: 13px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--muted-strong);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select-control:focus-within { border-color: rgba(37, 99, 235, .5); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.select-control > .icon:first-of-type { width: 18px; }
.select-control select { width: 100%; height: 100%; padding: 0 37px 0 9px; border: 0; appearance: none; background: transparent; color: var(--text-soft); cursor: pointer; font-weight: 650; }
.select-chevron { position: absolute; right: 12px; width: 16px; pointer-events: none; }

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 17px;
  border-radius: 13px;
  font-weight: 750;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.primary-button {
  border: 1px solid var(--brand);
  background: linear-gradient(135deg, #2e6cf5, #2459d9);
  color: white;
  box-shadow: 0 9px 22px rgba(37, 99, 235, .22), inset 0 1px rgba(255, 255, 255, .2);
}

.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 27px rgba(37, 99, 235, .29), inset 0 1px rgba(255, 255, 255, .22); }
.primary-button:active { transform: translateY(0); }
.primary-button.is-loading .icon { animation: spin .8s linear infinite; }

.secondary-button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.secondary-button:hover { border-color: var(--border-strong); background: var(--surface-soft); transform: translateY(-1px); }

@keyframes spin { to { transform: rotate(360deg); } }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1800px;
  margin: 26px auto 18px;
}

.summary-card {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.summary-card::before {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  right: -48px;
  top: -48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, .05), transparent 70%);
}

.summary-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.summary-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; }
.summary-icon-blue { background: var(--brand-soft); color: var(--brand); }
.summary-icon-green { background: var(--success-soft); color: var(--success); }
.summary-icon-orange { background: var(--warning-soft); color: var(--warning); }
.summary-icon-purple { background: var(--purple-soft); color: var(--accent); }
.summary-card > div { display: flex; flex-direction: column; min-width: 0; }
.summary-value { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.summary-label { margin-top: 2px; color: var(--muted); font-size: 12px; }
.summary-meta, .summary-trend { align-self: end; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 700; }
.summary-trend { display: inline-flex; align-items: center; gap: 3px; }
.summary-trend .icon { width: 13px; height: 13px; }
.summary-trend-positive { color: var(--success); }

.camera-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 1800px;
  margin: 0 auto 16px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  max-width: 500px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--muted);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.search-field:focus-within { border-color: rgba(37, 99, 235, .48); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.search-field > .icon { width: 18px; margin-left: 13px; }
.search-field input { min-width: 0; flex: 1; height: 100%; padding: 0 10px; border: 0; background: transparent; color: var(--text); }
.search-field input::placeholder { color: var(--muted); opacity: .82; }
.search-field kbd { margin-right: 8px; padding: 3px 7px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-family: inherit; font-size: 10px; font-weight: 650; }

.toolbar-filters { display: flex; align-items: center; gap: 7px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.filter-chip span { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--surface-strong); color: var(--muted); font-size: 10px; }
.filter-chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.filter-chip.is-active { border-color: rgba(37, 99, 235, .18); background: var(--brand-soft); color: var(--brand-strong); }
.filter-chip.is-active span { background: rgba(37, 99, 235, .12); color: var(--brand-strong); }

.last-refresh { display: flex; align-items: center; gap: 7px; margin-left: auto; white-space: nowrap; color: var(--muted); font-size: 11px; }
.last-refresh time { color: var(--muted-strong); font-weight: 650; }
.status-mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }

.camera-grid {
  display: grid;
  grid-template-columns: repeat(var(--camera-columns), minmax(0, 1fr));
  gap: 16px;
  max-width: 1800px;
  margin: 0 auto;
  transition: opacity var(--transition);
}

.camera-card {
  position: relative;
  min-width: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  isolation: isolate;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), opacity var(--transition);
}

.camera-card:hover { z-index: 3; border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.camera-card.is-filtered-out { display: none; }

.camera-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #172033;
}

.camera-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1), filter var(--transition), opacity var(--transition);
}

.camera-card:hover .camera-media img { transform: scale(1.018); }
.camera-media-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(5, 10, 20, .33), transparent 34%, transparent 65%, rgba(5, 10, 20, .28)); pointer-events: none; }

.camera-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 7px; }
.live-badge, .rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  color: #18854b;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .12);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .04em;
  transition: opacity var(--transition), transform var(--transition);
}
.live-badge span, .rec-badge span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rec-badge { color: var(--danger); }
.rec-badge span { animation: rec-blink 1.15s ease-in-out infinite; }
.camera-card[data-recording="false"] .rec-badge { opacity: 0; transform: translateY(-4px); pointer-events: none; }

@keyframes rec-blink { 50% { opacity: .28; } }

.camera-timestamp {
  position: absolute;
  top: 14px;
  right: 12px;
  color: rgba(255, 255, 255, .94);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .65);
  font-variant-numeric: tabular-nums;
}

.media-icon-button {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(10, 18, 30, .35);
  color: white;
  opacity: .92;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.media-icon-button .icon { width: 17px; height: 17px; }
.media-icon-button:hover { background: rgba(10, 18, 30, .62); transform: scale(1.04); opacity: 1; }

.camera-main { min-width: 0; }
.camera-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 13px 13px 8px; }
.camera-title-row h2 { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: -.015em; }
.camera-title-row p { margin: 3px 0 0; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-title-row p span { margin: 0 3px; color: var(--border-strong); }

.camera-menu { position: relative; flex: 0 0 auto; }
.camera-menu summary {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: -3px;
  border-radius: 9px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  transition: background var(--transition), color var(--transition);
}
.camera-menu summary::-webkit-details-marker { display: none; }
.camera-menu summary:hover, .camera-menu[open] summary { background: var(--surface-soft); color: var(--text); }
.camera-menu summary .icon { width: 18px; }
.camera-menu-popover {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 20;
  width: 194px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform-origin: top right;
  animation: menu-in 120ms ease-out;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.camera-menu-popover button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 38px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--text-soft); text-align: left; cursor: pointer; font-size: 12px; }
.camera-menu-popover button:hover { background: var(--surface-soft); color: var(--text); }
.camera-menu-popover .icon { width: 16px; }

.camera-health {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0 13px 12px;
  overflow: hidden;
}

.camera-health span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.camera-health span:first-child { background: var(--success-soft); color: var(--success); }
.health-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.camera-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: linear-gradient(to bottom, transparent, rgba(247, 249, 252, .65));
  border-radius: 0 0 16px 16px;
}
html[data-theme="dark"] .camera-actions { background: linear-gradient(to bottom, transparent, rgba(12, 18, 29, .14)); }

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.action-button .icon { width: 16px; height: 16px; }
.action-button:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-soft); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.action-primary { color: var(--brand-strong); border-color: rgba(37, 99, 235, .18); background: var(--brand-soft); }
.action-primary:hover { color: var(--brand-strong); border-color: rgba(37, 99, 235, .3); background: var(--brand-soft); }
.action-record { color: var(--muted-strong); }
.action-record.is-recording { color: var(--danger-strong); border-color: rgba(239, 68, 68, .19); background: var(--danger-soft); }
.action-record.is-recording:hover { color: var(--danger-strong); border-color: rgba(239, 68, 68, .31); background: var(--danger-soft); }

.camera-grid.is-refreshing .camera-card { pointer-events: none; }
.camera-grid.is-refreshing .camera-media img { filter: saturate(.75); opacity: .58; }
.camera-grid.is-refreshing .camera-media::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(105deg, transparent 25%, rgba(255, 255, 255, .28) 48%, transparent 72%);
  animation: shimmer .8s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

.camera-grid.is-list { grid-template-columns: 1fr !important; }
.camera-grid.is-list .camera-card { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); overflow: visible; }
.camera-grid.is-list .camera-media { height: 100%; min-height: 215px; aspect-ratio: auto; border-radius: 16px 0 0 16px; }
.camera-grid.is-list .camera-main { display: flex; flex-direction: column; }
.camera-grid.is-list .camera-title-row { padding: 18px 18px 10px; }
.camera-grid.is-list .camera-title-row h2 { font-size: 19px; }
.camera-grid.is-list .camera-title-row p { font-size: 12px; }
.camera-grid.is-list .camera-health { padding: 0 18px 16px; }
.camera-grid.is-list .camera-actions { margin-top: auto; padding: 13px 18px; border-radius: 0 0 16px 0; grid-template-columns: repeat(3, minmax(120px, 180px)); justify-content: start; }

.empty-state {
  max-width: 540px;
  margin: 80px auto;
  padding: 36px;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  background: var(--surface);
  text-align: center;
}
.empty-icon { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 18px; background: var(--brand-soft); color: var(--brand); }
.empty-state h2 { margin: 0; font-size: 19px; }
.empty-state p { margin: 7px 0 20px; color: var(--muted); }

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1800px;
  margin: 22px auto 0;
  padding: 17px 2px 5px;
  color: var(--muted);
  font-size: 11px;
}
.page-footer strong { color: var(--muted-strong); }

.notification-panel {
  position: fixed;
  top: 13px;
  right: 13px;
  z-index: 90;
  width: min(390px, calc(100vw - 26px));
  max-height: calc(100vh - 26px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px) scale(.985);
  transition: opacity var(--transition), visibility var(--transition), transform var(--transition);
}
.notification-panel.is-open { opacity: 1; visibility: visible; transform: translateX(0) scale(1); }
.notification-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.notification-head h2 { margin: 0; font-size: 18px; }
.notification-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.notification-list { padding: 6px; overflow-y: auto; }
.notification-item { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 8px; gap: 11px; align-items: start; padding: 12px; border-radius: 13px; }
.notification-item:hover { background: var(--surface-soft); }
.notification-item.is-new { background: linear-gradient(90deg, rgba(37, 99, 235, .045), transparent); }
.notification-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--surface-strong); color: var(--muted-strong); }
.notification-icon .icon { width: 18px; }
.notification-warning { background: var(--warning-soft); color: var(--warning); }
.notification-info { background: var(--brand-soft); color: var(--brand); }
.notification-success { background: var(--success-soft); color: var(--success); }
.notification-item strong { display: block; margin-top: 1px; font-size: 13px; }
.notification-item p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.new-dot { align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.notification-footer { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border: 0; border-top: 1px solid var(--border); background: var(--surface-soft); color: var(--brand-strong); cursor: pointer; font-size: 12px; font-weight: 750; }
.notification-footer:hover { background: var(--brand-soft); }
.notification-footer .icon { width: 15px; }

.camera-dialog {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  padding: 0;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.camera-dialog::backdrop { background: rgba(8, 14, 24, .62); backdrop-filter: blur(8px); }
.camera-dialog[open] { animation: dialog-in 180ms cubic-bezier(.2, .8, .2, 1); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
.dialog-shell { overflow: hidden; border-radius: inherit; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px 15px 12px 18px; border-bottom: 1px solid var(--border); }
.dialog-title-wrap { display: flex; align-items: center; min-width: 0; gap: 11px; }
.dialog-camera-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }
.dialog-title-wrap h2 { margin: 0; font-size: 17px; }
.dialog-title-wrap p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.dialog-online { display: inline-flex; align-items: center; gap: 6px; margin-left: 5px; padding: 5px 9px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 10px; font-weight: 800; }
.dialog-online span { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.dialog-close { width: 40px; height: 40px; }
.dialog-content { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: minmax(0, 1fr) auto; max-height: calc(100vh - 110px); }
.dialog-video { position: relative; grid-column: 1; grid-row: 1; min-height: 360px; aspect-ratio: 16 / 9; overflow: hidden; background: #08101d; }
.dialog-video > img { width: 100%; height: 100%; object-fit: cover; }
.dialog-video-shade { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(0, 0, 0, .25), transparent 30%, transparent 70%, rgba(0, 0, 0, .25)); }
.dialog-live { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(236, 255, 243, .92); color: #18854b; box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: 10px; font-weight: 850; }
.dialog-live span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dialog-time { position: absolute; top: 18px; right: 17px; color: white; text-shadow: 0 1px 4px rgba(0,0,0,.7); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.dialog-center-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(8, 16, 29, .66); color: white; font-size: 12px; }
.loader { width: 30px; height: 30px; border: 3px solid rgba(255,255,255,.25); border-top-color: white; border-radius: 50%; animation: spin .8s linear infinite; }
.dialog-controls { grid-column: 1; grid-row: 2; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 67px; padding: 10px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.dialog-controls-left, .dialog-controls-right { display: flex; align-items: center; gap: 8px; }
.round-control { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); color: var(--muted-strong); cursor: pointer; }
.round-control:hover { border-color: var(--border-strong); color: var(--text); }
.round-control.is-active { color: var(--danger); background: var(--danger-soft); border-color: rgba(239,68,68,.2); }
.dialog-record-button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px; border: 1px solid rgba(239,68,68,.19); border-radius: 11px; background: var(--danger-soft); color: var(--danger-strong); cursor: pointer; font-size: 11px; font-weight: 750; }
.dialog-record-button:hover { border-color: rgba(239,68,68,.35); }
.dialog-record-button.is-recording { background: var(--danger); border-color: var(--danger); color: white; }
.stream-quality { display: inline-flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--muted); font-size: 10px; font-weight: 650; }
.stream-quality i { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.dialog-info { grid-column: 2; grid-row: 1 / 3; padding: 20px; border-left: 1px solid var(--border); background: var(--surface-soft); overflow-y: auto; }
.dialog-info h3 { margin: 0 0 16px; font-size: 13px; }
.dialog-info dl { margin: 0; }
.dialog-info dl div { padding: 11px 0; border-bottom: 1px solid var(--border); }
.dialog-info dt { color: var(--muted); font-size: 10px; font-weight: 650; }
.dialog-info dd { margin: 4px 0 0; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.latency-dot { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: var(--success); }
.dialog-settings { width: 100%; margin-top: 18px; font-size: 11px; }
.dialog-settings .icon { width: 16px; }

.toast-viewport {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 285px;
  max-width: min(390px, calc(100vw - 32px));
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toast-in 180ms ease-out;
}
.toast.is-leaving { animation: toast-out 170ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(7px) scale(.98); } }
.toast-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.toast-success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast-warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-icon .icon { width: 17px; }
.toast strong { display: block; font-size: 12px; }
.toast p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }

@media (max-width: 1450px) {
  :root { --sidebar-width: 250px; }
  .brand { width: 184px; }
  .brand-logo { width: 178px; }
  .page-content { padding-inline: 22px; }
  .topbar { padding-inline: 22px; }
  .camera-grid { gap: 13px; }
  .action-button { font-size: 10px; padding-inline: 5px; }
  .camera-health span:nth-last-child(-n+1) { display: none; }
}

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .camera-toolbar { flex-wrap: wrap; }
  .search-field { max-width: none; }
  .last-refresh { order: 3; width: 100%; justify-content: flex-end; }
  .topbar-profile-copy { display: none; }
  .topbar-profile { padding-right: 4px; }
}

@media (max-width: 1050px) {
  :root { --sidebar-width: 272px; }
  .sidebar { transform: translateX(-105%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-scrim { display: block; }
  .sidebar-close { display: inline-grid !important; }
  .main { margin-left: 0; }
  .topbar-mobile-brand { display: flex; }
  .topbar-status { margin-left: auto; }
  .camera-grid:not(.is-list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .topbar-status { display: none; }
  .topbar { padding-inline: 14px; }
  .page-content { padding: 22px 14px 16px; }
  .page-heading { flex-direction: column; gap: 18px; }
  .heading-actions { width: 100%; justify-content: flex-start; }
  .summary-grid { margin-top: 20px; }
  .camera-toolbar { align-items: stretch; }
  .search-field { flex-basis: 100%; width: 100%; }
  .toolbar-filters { flex: 1 1 auto; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .toolbar-filters::-webkit-scrollbar { display: none; }
  .last-refresh { justify-content: flex-start; }
  .camera-grid.is-list .camera-card { grid-template-columns: 1fr; }
  .camera-grid.is-list .camera-media { min-height: 0; aspect-ratio: 16 / 9; border-radius: 16px 16px 0 0; }
  .camera-grid.is-list .camera-actions { border-radius: 0 0 16px 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 10px; }
  .dialog-content { grid-template-columns: 1fr; overflow-y: auto; }
  .dialog-video { grid-column: 1; grid-row: 1; min-height: 0; }
  .dialog-controls { grid-column: 1; grid-row: 2; }
  .dialog-info { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--border); }
}

@media (max-width: 620px) {
  :root { --topbar-height: 64px; }
  .topbar-actions { gap: 5px; }
  .topbar-profile { display: none; }
  .icon-button { width: 39px; height: 39px; }
  .topbar-mobile-brand > span { display: none; }
  .heading-line { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-subtitle { max-width: 94%; }
  .heading-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  .view-switch { grid-row: 1; }
  .select-control { grid-row: 1; min-width: 0; }
  .primary-button { grid-column: 1 / -1; width: 100%; }
  .summary-grid { grid-template-columns: 1fr; gap: 10px; }
  .summary-card { min-height: 70px; }
  .camera-grid:not(.is-list) { grid-template-columns: 1fr; }
  .camera-card:hover { transform: none; }
  .camera-health span:nth-last-child(-n+2) { display: none; }
  .camera-actions { gap: 5px; }
  .action-button { min-height: 42px; font-size: 11px; }
  .page-footer { flex-direction: column; gap: 5px; }
  .camera-dialog { width: calc(100vw - 14px); max-height: calc(100vh - 14px); border-radius: 17px; }
  .dialog-header { padding-left: 12px; }
  .dialog-camera-icon { display: none; }
  .dialog-online { display: none; }
  .dialog-controls { flex-wrap: wrap; }
  .dialog-controls-left, .dialog-controls-right { width: 100%; justify-content: space-between; }
  .dialog-record-button { flex: 1; justify-content: center; }
  .stream-quality { margin-right: auto; }
  .toast-viewport { right: 10px; bottom: 10px; left: 10px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Additional refinements */
.camera-menu-popover a {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}
.camera-menu-popover a:hover { background: var(--surface-soft); color: var(--text); }
.camera-menu-popover a .icon { width: 16px; }
.input-with-icon > .icon { position:absolute; left:12px; top:50%; width:17px; transform:translateY(-50%); color:var(--muted); pointer-events:none; }
.password-field .password-toggle .icon { position:static; left:auto; top:auto; width:18px; transform:none; }

.camera-admin-grid.is-compact { grid-template-columns: 1fr; }
.camera-admin-grid.is-compact .managed-camera-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 230px;
  align-items: stretch;
}
.camera-admin-grid.is-compact .managed-camera-media { aspect-ratio: auto; min-height: 150px; }
.camera-admin-grid.is-compact .managed-camera-copy { display:flex; flex-direction:column; justify-content:center; }
.camera-admin-grid.is-compact .managed-camera-footer { border-top:0; border-left:1px solid var(--border); flex-direction:column; justify-content:center; }

.camera-detail-hero { display:grid; grid-template-columns:minmax(0,1.6fr) 340px; gap:18px; }
.camera-detail-video { position:relative; min-height:420px; aspect-ratio:16/9; overflow:hidden; border:1px solid var(--border); border-radius:20px; background:#06101d; box-shadow:var(--shadow-sm); }
.camera-detail-video img { width:100%; height:100%; object-fit:cover; }
.camera-detail-video::after { content:""; position:absolute; inset:0; background:linear-gradient(to bottom,rgba(0,0,0,.28),transparent 32%,transparent 62%,rgba(0,0,0,.58)); pointer-events:none; }
.camera-detail-video-top { position:absolute; z-index:2; top:15px; left:15px; right:15px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.camera-detail-video-bottom { position:absolute; z-index:2; left:15px; right:15px; bottom:15px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.camera-detail-video-actions { display:flex; align-items:center; gap:7px; }
.camera-detail-dark-button { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:0 11px; border:1px solid rgba(255,255,255,.2); border-radius:10px; background:rgba(8,16,29,.52); color:white; backdrop-filter:blur(8px); cursor:pointer; font-size:10px; font-weight:750; }
.camera-detail-dark-button:hover { background:rgba(8,16,29,.72); }
.camera-detail-dark-button.is-recording { background:rgba(239,68,68,.88); border-color:rgba(255,255,255,.22); }
.camera-detail-side { display:grid; gap:12px; }
.camera-detail-info { padding:17px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-xs); }
.camera-detail-info h2 { margin:0 0 13px; font-size:14px; }
.ptz-card { padding:17px; border:1px solid var(--border); border-radius:18px; background:var(--surface); box-shadow:var(--shadow-xs); }
.ptz-card-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:13px; }
.ptz-card-head h2 { margin:0; font-size:14px; }
.ptz-pad { display:grid; grid-template-columns:repeat(3,44px); grid-template-rows:repeat(3,44px); justify-content:center; gap:5px; }
.ptz-pad button { display:grid; place-items:center; border:1px solid var(--border); border-radius:11px; background:var(--surface-soft); color:var(--muted-strong); cursor:pointer; }
.ptz-pad button:hover { color:var(--brand); border-color:rgba(37,99,235,.25); background:var(--brand-soft); }
.ptz-pad .ptz-center { border-radius:50%; color:var(--brand); }
.ptz-zoom { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:12px; }
.camera-detail-event-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.camera-detail-event { overflow:hidden; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.camera-detail-event img { width:100%; aspect-ratio:16/9; object-fit:cover; }
.camera-detail-event div { padding:10px; }
.camera-detail-event strong { display:block; font-size:10px; }
.camera-detail-event span { color:var(--muted); font-size:8px; }

.not-found-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 50% 10%,rgba(37,99,235,.14),transparent 34rem),var(--bg); }
.not-found-card { max-width:600px; padding:50px; border:1px solid var(--border); border-radius:24px; background:var(--surface); box-shadow:var(--shadow-md); text-align:center; }
.not-found-card img { width:110px; margin:0 auto 22px; }
.not-found-card h1 { margin:0; font-size:34px; letter-spacing:-.035em; }
.not-found-card p { margin:12px auto 24px; max-width:440px; color:var(--muted); font-size:12px; }
.not-found-code { display:inline-block; margin-bottom:12px; color:var(--brand); font-size:11px; font-weight:850; letter-spacing:.14em; }

@media (max-width: 1100px) {
  .camera-admin-grid.is-compact .managed-camera-card { grid-template-columns:220px minmax(0,1fr); }
  .camera-admin-grid.is-compact .managed-camera-footer { grid-column:1/-1; border-left:0; border-top:1px solid var(--border); flex-direction:row; }
  .camera-detail-hero { grid-template-columns:1fr; }
  .camera-detail-side { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .camera-detail-event-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .camera-admin-grid.is-compact .managed-camera-card { grid-template-columns:1fr; }
  .camera-admin-grid.is-compact .managed-camera-media { min-height:0; aspect-ratio:16/9; }
  .camera-detail-video { min-height:0; }
  .camera-detail-side { grid-template-columns:1fr; }
  .camera-detail-video-bottom { align-items:flex-end; }
  .camera-detail-video-actions { flex-wrap:wrap; }
  .camera-detail-event-grid { grid-template-columns:1fr; }
  .not-found-card { padding:34px 22px; }
}
/* ========================================================================== 
   POLZIN KAMERY — MULTI-PAGE APPLICATION LAYER
   ========================================================================== */

/* Shared utility and content primitives */
.content-max,
.toolbar,
.panel-card,
.data-section,
.archive-layout,
.events-layout,
.inventory-grid,
.camera-detail-layout,
.notification-workspace,
.role-grid,
.system-health-hero,
.resource-grid,
.storage-panel,
.system-bottom-grid,
.settings-layout {
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
  margin-bottom: 16px;
}

.toolbar-spacer { flex: 1 1 auto; }
.muted-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.muted-line strong { color: var(--muted-strong); }

.button,
.ghost-button,
.compact-button,
.table-icon-button,
.round-control,
.player-play-button,
.speed-button,
.danger-button,
.danger-text-button {
  font: inherit;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.ghost-button:hover { color: var(--text); background: var(--surface-soft); border-color: var(--border); }
.compact-button { min-height: 36px; padding: 0 11px; border-radius: 10px; font-size: 12px; }
.compact-select { min-width: 155px; height: 42px; }
.compact-search { flex: 0 1 340px; max-width: 380px; height: 42px; }
.summary-link { align-self: end; color: var(--brand); font-size: 12px; font-weight: 750; }
.summary-link:hover { color: var(--brand-strong); text-decoration: underline; }

/* Cards and section headers */
.panel-card,
.data-section {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.panel-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-header h2,
.panel-header h3 { margin: 2px 0 0; font-size: 17px; letter-spacing: -.015em; }
.panel-header p:not(.panel-kicker) { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-header-wrap { flex-wrap: wrap; }
.panel-header-actions { display: flex; align-items: center; gap: 8px; }
.panel-kicker {
  margin: 0;
  color: var(--brand);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.panel-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  vertical-align: 2px;
}
.panel-body { padding: 18px; }

/* Topbar profile menu */
.profile-menu { position: relative; margin-left: 4px; }
.profile-menu > summary { list-style: none; }
.profile-menu > summary::-webkit-details-marker { display: none; }
.profile-menu[open] .topbar-profile {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.profile-menu[open] .topbar-profile > .icon { transform: rotate(180deg); }
.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 90;
  width: 218px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.profile-popover a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}
.profile-popover a:hover { color: var(--text); background: var(--surface-soft); }
.profile-popover a:last-child { color: var(--danger); }
.profile-popover > span { display: block; height: 1px; margin: 5px 4px; background: var(--border); }
.profile-popover .icon { width: 18px; }

/* Badges and statuses */
.status-chip,
.event-type,
.severity-chip,
.role-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
}
.status-chip-success { color: var(--success); border-color: rgba(25,165,90,.18); background: var(--success-soft); }
.status-chip-danger { color: var(--danger); border-color: rgba(239,68,68,.18); background: var(--danger-soft); }
.status-chip-muted { color: var(--muted); }
.online-chip-warning { color: #c47700; background: var(--warning-soft); border-color: rgba(245,158,11,.22); }
.online-chip-warning > span { box-shadow: 0 0 0 3px rgba(245,158,11,.12); }
.event-type-motion { color: #c47700; background: var(--warning-soft); border-color: rgba(245,158,11,.2); }
.event-type-person { color: var(--brand-strong); background: var(--brand-soft); border-color: rgba(37,99,235,.18); }
.event-type-vehicle { color: var(--accent); background: var(--purple-soft); border-color: rgba(109,74,255,.18); }
.event-type-continuous { color: var(--success); background: var(--success-soft); border-color: rgba(25,165,90,.18); }
.severity-wysoki { color: var(--danger); background: var(--danger-soft); border-color: rgba(239,68,68,.2); }
.severity-średni { color: #c47700; background: var(--warning-soft); border-color: rgba(245,158,11,.2); }
.severity-niski { color: var(--muted-strong); background: var(--surface-strong); }
.role-chip { border-color: transparent; }
.role-administrator { color: var(--danger); background: var(--danger-soft); }
.role-operator { color: var(--brand-strong); background: var(--brand-soft); }
.role-podglad { color: var(--success); background: var(--success-soft); }

/* Forms */
.field-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}
.form-control,
.form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-textarea { min-height: 100px; padding-top: 12px; resize: vertical; }
.form-control::placeholder,
.form-textarea::placeholder { color: var(--muted); }
.form-control:focus,
.form-textarea:focus { border-color: rgba(37,99,235,.5); box-shadow: 0 0 0 3px rgba(37,99,235,.11); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.form-span-2 { grid-column: 1 / -1; }
.fieldset-clean { min-width: 0; margin: 0; padding: 0; border: 0; }
.check-row { display: inline-flex; flex-direction: row; align-items: center; gap: 9px; cursor: pointer; color: var(--text-soft); font-size: 12px; font-weight: 650; }
.check-row input { width: 17px; height: 17px; accent-color: var(--brand); }
.check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 16px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > .icon { position: absolute; left: 13px; z-index: 1; width: 18px; color: var(--muted); pointer-events: none; }
.input-with-icon .form-control { padding-left: 42px; }
.input-with-icon > button {
  position: absolute;
  right: 7px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.input-with-icon > button:hover { color: var(--text); background: var(--surface-soft); }
.range-input { width: 100%; accent-color: var(--brand); }

/* Tables */
.table-shell { width: 100%; overflow-x: auto; }
.data-table { width: 100%; min-width: 820px; border-collapse: collapse; }
.data-table th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-soft);
  vertical-align: middle;
  font-size: 12px;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--surface-soft); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-primary { display: flex; flex-direction: column; min-width: 130px; }
.table-primary strong { color: var(--text); font-size: 13px; }
.table-primary small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.table-icon-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted-strong);
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition), transform var(--transition);
}
.table-icon-button:hover { color: var(--brand); background: var(--brand-soft); border-color: rgba(37,99,235,.2); transform: translateY(-1px); }
.table-icon-button .icon { width: 16px; }
.table-empty { display: grid; place-items: center; gap: 6px; min-height: 220px; padding: 28px; color: var(--muted); text-align: center; }
.table-empty .icon { width: 34px; height: 34px; color: var(--brand); }
.table-empty strong { color: var(--text); }
.table-empty p { margin: 0; }

/* Switch */
.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 25px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 6px rgba(17,28,46,.18);
  transition: transform var(--transition);
}
.switch-control.is-on { border-color: var(--brand); background: var(--brand); }
.switch-control.is-on::after { transform: translateX(19px); }

/* Dialogs */
.form-dialog,
.modal {
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.form-dialog::backdrop,
.modal::backdrop { background: rgba(7,14,25,.52); backdrop-filter: blur(5px); }
.form-dialog-shell { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.form-dialog-header,
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.form-dialog-header h2,
.modal-head h2 { margin: 0; font-size: 19px; }
.form-dialog-header p,
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.form-dialog-body,
.modal-body { padding: 20px; overflow-y: auto; }
.form-dialog-footer,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

/* Page tabs */
.page-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 1800px;
  margin: 22px auto 16px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.page-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}
.page-tab:hover { color: var(--text); background: var(--surface-soft); }
.page-tab.is-active { color: var(--brand-strong); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.1); }
.page-tab > span { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: rgba(37,99,235,.12); font-size: 10px; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* --------------------------------------------------------------------------
   LIVE VIEW / INDEX
   -------------------------------------------------------------------------- */
.camera-body { padding: 13px 14px 11px; }
.camera-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.camera-title-row h3 { margin: 0; font-size: 15px; }
.camera-meta { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.camera-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-size: 10px;
  font-weight: 800;
}
.camera-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.camera-actions {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 0;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--border);
}
.camera-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 7px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: color var(--transition), background var(--transition);
}
.camera-action:hover { color: var(--brand); background: var(--brand-soft); }
.camera-action.is-recording { color: var(--danger); background: var(--danger-soft); }
.camera-action .icon { width: 16px; }
.camera-overlay-top { position: absolute; inset: 12px 12px auto; z-index: 2; display: flex; align-items: center; justify-content: space-between; color: white; }
.expand-button {
  position: absolute;
  right: 11px;
  bottom: 11px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 10px;
  background: rgba(10,18,30,.46);
  color: white;
  opacity: 0;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: opacity var(--transition), transform var(--transition);
}
.camera-card:hover .expand-button { opacity: 1; }
.expand-button:hover { transform: scale(1.05); }
.camera-grid.is-list { display: flex; flex-direction: column; }
.camera-grid.is-list .camera-card { display: grid; grid-template-columns: 260px minmax(0,1fr) 300px; align-items: center; overflow: hidden; }
.camera-grid.is-list .camera-media { height: 150px; border-radius: 0; }
.camera-grid.is-list .camera-body { padding: 18px; }
.camera-grid.is-list .camera-actions { border-top: 0; border-left: 1px solid var(--border); padding: 10px; }
.camera-grid.is-refreshing { opacity: .55; pointer-events: none; }

.camera-modal { width: min(1050px, calc(100vw - 26px)); }
.camera-modal-body { padding: 0; }
.big-live { position: relative; overflow: hidden; background: #07101d; aspect-ratio: 16/9; }
.big-live > img { width: 100%; height: 100%; object-fit: cover; }
.big-live::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(4,10,18,.2),transparent 32%,transparent 66%,rgba(4,10,18,.65)); }
.big-live-top,
.big-live-bottom { position: absolute; z-index: 2; left: 16px; right: 16px; display: flex; align-items: center; gap: 8px; color: white; }
.big-live-top { top: 15px; justify-content: space-between; font-size: 12px; font-weight: 700; }
.big-live-bottom { bottom: 14px; }
.live-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 39px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 11px;
  background: rgba(8,16,27,.55);
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(9px);
}
.live-control:hover { background: rgba(8,16,27,.76); }
.live-control.is-recording { background: rgba(220,38,38,.82); }
.live-spacer { flex: 1; }

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 79;
  visibility: hidden;
  border: 0;
  background: rgba(7,14,25,.34);
  opacity: 0;
  transition: opacity var(--transition), visibility var(--transition);
}
.notification-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  width: min(410px, 100vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: translateX(105%);
  transition: transform var(--transition);
}
body.drawer-open .drawer-scrim { visibility: visible; opacity: 1; }
body.drawer-open .notification-drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 76px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { margin: 0 0 2px; font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px; }
.drawer-item { display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 12px; padding: 12px; border-radius: 13px; }
.drawer-item:hover { background: var(--surface-soft); }
.drawer-item strong { font-size: 13px; }
.drawer-item p { margin: 3px 0 2px; color: var(--muted); font-size: 11px; }
.drawer-item time { color: var(--muted); font-size: 10px; }
.drawer-footer { padding: 13px 16px; border-top: 1px solid var(--border); }
.drawer-footer .button { width: 100%; }

/* --------------------------------------------------------------------------
   RECORDINGS
   -------------------------------------------------------------------------- */
.archive-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px,.62fr); gap: 16px; margin-top: 18px; }
.archive-player-panel { min-width: 0; }
.archive-side-panel { min-width: 0; }
.archive-player { position: relative; min-height: 390px; overflow: hidden; background: #050b14; }
.archive-player img { width: 100%; height: 100%; min-height: 390px; object-fit: cover; }
.player-shade { position: absolute; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.22),transparent 35%,transparent 65%,rgba(0,0,0,.42)); }
.archive-badge { position: absolute; top: 16px; left: 16px; padding: 6px 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(8,16,27,.55); color: white; font-size: 10px; font-weight: 850; letter-spacing: .08em; backdrop-filter: blur(8px); }
.archive-player > time { position: absolute; top: 18px; right: 17px; color: white; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.player-main-button { position: absolute; inset: 50% auto auto 50%; display: grid; place-items: center; width: 66px; height: 66px; padding: 0; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.88); color: #15223a; box-shadow: 0 15px 40px rgba(0,0,0,.25); cursor: pointer; transform: translate(-50%,-50%); }
.player-main-button:hover { transform: translate(-50%,-50%) scale(1.05); }
.player-main-button .icon { width: 27px; height: 27px; margin-left: 3px; }
.player-controls { display: flex; align-items: center; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--border); }
.round-control,
.player-play-button,
.speed-button { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted-strong); cursor: pointer; font-size: 11px; font-weight: 750; }
.round-control:hover,
.speed-button:hover { color: var(--brand); background: var(--brand-soft); border-color: rgba(37,99,235,.2); }
.player-play-button { gap: 7px; min-width: 98px; padding: 0 12px; border-color: var(--brand); background: var(--brand); color: white; }
.player-time { min-width: 90px; color: var(--muted-strong); white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.player-range { flex: 1; min-width: 90px; accent-color: var(--brand); }
.speed-button { min-width: 45px; }
.archive-timeline { padding: 15px 18px 18px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.timeline-hours { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.timeline-track { position: relative; height: 36px; margin-top: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.segment { position: absolute; top: 5px; bottom: 5px; border-radius: 5px; }
.segment-blue { background: linear-gradient(90deg,#5e8df9,#3570ed); }
.segment-orange { background: linear-gradient(90deg,#ffbd4a,#f59e0b); }
.timeline-legend { display: flex; align-items: center; gap: 18px; margin-top: 9px; color: var(--muted); font-size: 10px; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend-blue { background: var(--brand); }
.legend-orange { background: var(--warning); }
.filter-stack { display: flex; flex-direction: column; gap: 15px; }
.quick-range { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.quick-range button { min-height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--muted-strong); cursor: pointer; font-size: 11px; font-weight: 700; }
.quick-range button:hover,
.quick-range button.is-active { color: var(--brand-strong); border-color: rgba(37,99,235,.22); background: var(--brand-soft); }
.archive-info-box { padding: 13px; border: 1px solid rgba(37,99,235,.13); border-radius: 12px; background: var(--brand-soft); color: var(--muted-strong); font-size: 11px; line-height: 1.55; }
.archive-info-box strong { display: block; margin-bottom: 3px; color: var(--brand-strong); }
.data-section { margin-top: 16px; }
.recording-thumb { position: relative; display: block; width: 92px; height: 54px; padding: 0; overflow: hidden; border: 0; border-radius: 9px; background: #0a1220; cursor: pointer; }
.recording-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recording-thumb span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(7,14,25,.2); color: white; opacity: 0; transition: opacity var(--transition); }
.recording-thumb:hover span { opacity: 1; }
.recording-thumb .icon { width: 19px; }
.recording-row.is-selected td { background: var(--brand-soft); }

/* --------------------------------------------------------------------------
   EVENTS
   -------------------------------------------------------------------------- */
.events-toolbar { margin-top: 18px; }
.events-layout { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.event-stream { display: flex; flex-direction: column; gap: 10px; }
.event-card { display: grid; grid-template-columns: 58px 146px minmax(0,1fr); gap: 14px; padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), opacity var(--transition); }
.event-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.event-card.is-acknowledged { opacity: .68; }
.event-time { position: relative; display: flex; flex-direction: column; align-items: flex-end; padding-top: 4px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.event-time strong { color: var(--text-soft); font-size: 11px; }
.event-line { position: absolute; top: 40px; right: 3px; bottom: -26px; width: 1px; background: var(--border); }
.event-card:last-child .event-line { display: none; }
.event-thumb { position: relative; height: 96px; overflow: hidden; border-radius: 12px; background: var(--surface-strong); }
.event-thumb > img { width: 100%; height: 100%; object-fit: cover; }
.event-system-thumb { display: grid; place-items: center; width: 100%; height: 100%; color: var(--brand); background: linear-gradient(135deg,var(--brand-soft),var(--purple-soft)); }
.event-system-thumb .icon { width: 34px; height: 34px; }
.event-category-icon { position: absolute; right: 7px; bottom: 7px; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid rgba(255,255,255,.8); border-radius: 9px; background: rgba(16,27,45,.78); color: white; }
.event-category-icon .icon { width: 15px; }
.event-copy { min-width: 0; }
.event-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.event-title-row h3 { margin: 1px 0 3px; font-size: 14px; letter-spacing: -.01em; }
.event-title-row p { margin: 0; color: var(--muted); font-size: 11px; }
.event-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 11px; color: var(--muted); font-size: 10px; }
.event-meta span { display: inline-flex; align-items: center; gap: 5px; }
.event-meta .icon { width: 14px; }
.event-status-label { color: var(--muted-strong); }
.event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.events-sidebar { display: flex; flex-direction: column; gap: 16px; }
.donut-wrap { display: grid; grid-template-columns: 130px minmax(0,1fr); align-items: center; gap: 18px; padding: 18px; }
.donut-chart { position: relative; display: grid; place-items: center; width: 126px; height: 126px; border-radius: 50%; background: conic-gradient(var(--warning) 0 35%, var(--brand) 35% 62%, var(--accent) 62% 78%, var(--muted) 78% 100%); }
.donut-chart::after { content: ""; width: 78px; height: 78px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.donut-chart > div { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.donut-chart strong { font-size: 22px; }
.donut-chart span { color: var(--muted); font-size: 9px; }
.chart-legend { display: flex; flex-direction: column; gap: 9px; }
.chart-legend span { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; }
.chart-legend b { color: var(--text-soft); }
.legend-motion { background: var(--warning); }
.legend-person { background: var(--brand); }
.legend-vehicle { background: var(--accent); }
.legend-system { background: var(--muted); }
.ranked-list { display: flex; flex-direction: column; padding: 8px 18px 16px; }
.ranked-list > div { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--border); }
.ranked-list > div:last-child { border-bottom: 0; }
.ranked-list > div > span:first-child { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-strong); color: var(--muted); font-size: 10px; font-weight: 800; }
.ranked-list strong { font-size: 12px; }
.ranked-list small { color: var(--muted); }

/* --------------------------------------------------------------------------
   CAMERAS / INVENTORY
   -------------------------------------------------------------------------- */
.inventory-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.inventory-card { overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-xs); transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition); }
.inventory-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.inventory-card.is-offline { opacity: .75; }
.inventory-card.is-offline .inventory-media img { filter: grayscale(.75) brightness(.78); }
.inventory-media { position: relative; height: 168px; overflow: hidden; background: #0b1524; }
.inventory-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.inventory-card:hover .inventory-media img { transform: scale(1.025); }
.inventory-media .status-chip { position: absolute; top: 11px; left: 11px; border: 0; box-shadow: 0 5px 20px rgba(0,0,0,.12); }
.inventory-body { padding: 14px 15px; }
.inventory-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inventory-title h3 { margin: 0; font-size: 15px; }
.inventory-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.inventory-data { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.inventory-data span { display: flex; flex-direction: column; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.inventory-data strong { margin-top: 3px; color: var(--text-soft); font-size: 11px; letter-spacing: 0; text-transform: none; }
.health-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 13px; }
.health-bars > div { display: grid; grid-template-columns: 62px minmax(0,1fr) 34px; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.health-bars i { height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.health-bars i::after { content: ""; display: block; width: var(--value,85%); height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#66a0ff); }
.health-bars b { color: var(--muted-strong); text-align: right; }
.inventory-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 9px; border-top: 1px solid var(--border); }
.connection-method { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.method-card { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 88px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.method-card:hover { border-color: var(--border-strong); background: var(--surface-soft); }
.method-card input { position: absolute; opacity: 0; }
.method-card:has(input:checked) { border-color: rgba(37,99,235,.42); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.09); }
.method-card strong { font-size: 12px; }
.method-card small { color: var(--muted); font-size: 10px; }
.scan-button { width: 100%; margin-top: 10px; }

/* --------------------------------------------------------------------------
   CAMERA DETAILS
   -------------------------------------------------------------------------- */
.camera-detail-heading { align-items: center; }
.camera-detail-layout { display: grid; grid-template-columns: minmax(0,1.7fr) 340px; gap: 16px; margin-top: 18px; }
.camera-live-panel { min-width: 0; }
.detail-live-frame { position: relative; min-height: 480px; overflow: hidden; background: #060d17; }
.detail-live-frame > img { width: 100%; height: 100%; min-height: 480px; object-fit: cover; }
.detail-live-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(0,0,0,.28),transparent 32%,transparent 65%,rgba(0,0,0,.52)); }
.detail-live-badge { position: absolute; top: 16px; left: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(20,165,90,.86); color: white; font-size: 10px; font-weight: 850; }
.detail-stream-info { position: absolute; top: 18px; right: 18px; z-index: 2; color: white; font-size: 11px; font-weight: 700; text-align: right; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.detail-stream-info span { display: block; margin-top: 2px; opacity: .76; font-size: 9px; }
.detail-live-controls { position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.control-spacer { flex: 1; }
.detail-side-panel { display: flex; flex-direction: column; }
.ptz-pad { display: grid; grid-template-columns: repeat(3,48px); grid-template-rows: repeat(3,48px); justify-content: center; gap: 6px; padding: 18px 18px 10px; }
.ptz-pad button,
.ptz-home { display: grid; place-items: center; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); color: var(--muted-strong); cursor: pointer; }
.ptz-pad button:hover { color: var(--brand); border-color: rgba(37,99,235,.2); background: var(--brand-soft); }
.ptz-pad .ptz-home { color: var(--brand); background: var(--brand-soft); }
.zoom-control { display: grid; grid-template-columns: 40px minmax(0,1fr) 40px; align-items: center; gap: 9px; padding: 8px 18px 16px; }
.zoom-control button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); color: var(--muted-strong); cursor: pointer; }
.preset-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 0 18px 18px; }
.preset-list button { min-height: 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); color: var(--muted-strong); cursor: pointer; font-size: 10px; font-weight: 700; }
.preset-list button:hover { color: var(--brand-strong); background: var(--brand-soft); }
.detail-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--border); }
.detail-metrics > div { padding: 14px; border-right: 1px solid var(--border); }
.detail-metrics > div:last-child { border-right: 0; }
.detail-metrics span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.detail-metrics strong { display: block; margin-top: 3px; font-size: 12px; }
.camera-config-card { max-width: 1800px; margin: 16px auto 0; }
.camera-config-tabs { padding: 0 18px; border-bottom: 1px solid var(--border); }
.settings-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 18px; }
.settings-block { padding: 17px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.settings-block h3 { margin: 0 0 4px; font-size: 14px; }
.settings-block > p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.detail-definition { display: grid; grid-template-columns: 130px minmax(0,1fr); gap: 10px 16px; margin: 0; }
.detail-definition dt { color: var(--muted); font-size: 11px; }
.detail-definition dd { margin: 0; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: 0; }
.setting-row > div { min-width: 0; }
.setting-row strong { display: block; font-size: 12px; }
.setting-row p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.range-settings { display: flex; flex-direction: column; gap: 14px; }
.range-settings label { display: grid; grid-template-columns: 120px minmax(0,1fr) 42px; align-items: center; gap: 10px; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.range-settings output { text-align: right; color: var(--brand); font-weight: 800; }
.choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.choice-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; }
.choice-card:has(input:checked) { border-color: rgba(37,99,235,.38); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.choice-card strong { font-size: 11px; }
.choice-card small { color: var(--muted); font-size: 9px; }
.detection-preview,
.zone-preview { position: relative; min-height: 240px; overflow: hidden; border-radius: 13px; background: #0b1320; }
.detection-preview img,
.zone-preview img { width: 100%; height: 100%; min-height: 240px; object-fit: cover; }
.zone-shape { position: absolute; border: 2px solid rgba(58,132,255,.92); background: rgba(37,99,235,.16); box-shadow: inset 0 0 18px rgba(37,99,235,.15); }
.zone-one { top: 20%; left: 12%; width: 42%; height: 48%; clip-path: polygon(5% 12%,90% 0,100% 85%,0 100%); }
.zone-two { right: 8%; bottom: 12%; width: 33%; height: 35%; clip-path: polygon(10% 0,100% 12%,85% 100%,0 88%); border-color: rgba(245,158,11,.95); background: rgba(245,158,11,.14); }

/* --------------------------------------------------------------------------
   NOTIFICATIONS
   -------------------------------------------------------------------------- */
.notification-workspace { margin-top: 18px; }
.notification-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.inbox-list { display: flex; flex-direction: column; }
.inbox-item { position: relative; display: grid; grid-template-columns: 36px 44px minmax(0,1fr) auto auto; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); transition: background var(--transition), opacity var(--transition), transform var(--transition); }
.inbox-item:last-child { border-bottom: 0; }
.inbox-item:hover { background: var(--surface-soft); }
.inbox-item.is-unread { background: linear-gradient(90deg,rgba(37,99,235,.055),transparent 45%); }
.inbox-item.is-unread::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.inbox-item.is-removing { opacity: 0; transform: translateX(16px); }
.inbox-check { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); cursor: pointer; }
.inbox-check:hover { color: var(--success); border-color: rgba(25,165,90,.22); background: var(--success-soft); }
.inbox-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--surface-strong); color: var(--muted-strong); }
.inbox-icon-warning { color: #c47700; background: var(--warning-soft); }
.inbox-icon-success { color: var(--success); background: var(--success-soft); }
.inbox-icon-info { color: var(--brand); background: var(--brand-soft); }
.inbox-icon-default { color: var(--accent); background: var(--purple-soft); }
.inbox-copy { min-width: 0; }
.inbox-copy strong { display: block; font-size: 13px; }
.inbox-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.inbox-actions { display: flex; align-items: center; gap: 5px; }
.section-intro { padding: 18px; border-bottom: 1px solid var(--border); }
.section-intro h2 { margin: 0; font-size: 17px; }
.section-intro p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.rules-table .setting-row { padding: 13px 16px; }
.channel-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 18px; }
.channel-card { padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-soft); }
.channel-card-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 13px; }
.channel-mail { color: var(--brand); background: var(--brand-soft); }
.channel-push { color: var(--accent); background: var(--purple-soft); }
.channel-webhook { color: var(--success); background: var(--success-soft); }
.channel-card h3 { margin: 0; font-size: 14px; }
.channel-card p { min-height: 36px; margin: 5px 0 13px; color: var(--muted); font-size: 10px; }
.channel-icons { display: flex; align-items: center; gap: 6px; color: var(--muted); }

/* --------------------------------------------------------------------------
   USERS
   -------------------------------------------------------------------------- */
.role-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.role-card { padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-xs); }
.role-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.role-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; }
.role-icon-admin { color: var(--danger); background: var(--danger-soft); }
.role-icon-operator { color: var(--brand); background: var(--brand-soft); }
.role-icon-viewer { color: var(--success); background: var(--success-soft); }
.role-card h3 { margin: 11px 0 4px; font-size: 15px; }
.role-card p { min-height: 34px; margin: 0; color: var(--muted); font-size: 10px; }
.role-members { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; }
.avatar-mini { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: -6px; border: 2px solid var(--surface); border-radius: 9px; background: linear-gradient(135deg,var(--brand-soft),var(--purple-soft)); color: var(--brand-strong); font-size: 9px; font-weight: 850; }
.avatar-mini:first-child { margin-left: 0; }
.header-filter-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-table-person { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.user-table-person > span:not(.avatar) { display: flex; flex-direction: column; }
.user-table-person strong { font-size: 12px; }
.user-table-person small { color: var(--muted); font-size: 10px; }
.user-row[hidden] { display: none; }

/* --------------------------------------------------------------------------
   SYSTEM
   -------------------------------------------------------------------------- */
.system-health-hero { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(280px,.6fr); gap: 16px; margin-top: 18px; }
.health-score-card { display: flex; align-items: center; gap: 24px; padding: 22px; border: 1px solid rgba(25,165,90,.18); border-radius: 18px; background: linear-gradient(135deg,var(--surface),var(--success-soft)); box-shadow: var(--shadow-xs); }
.health-ring { position: relative; display: grid; place-items: center; flex: 0 0 124px; width: 124px; height: 124px; border-radius: 50%; background: conic-gradient(var(--success) 0 98%, var(--surface-strong) 98% 100%); }
.health-ring::after { content: ""; width: 92px; height: 92px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.health-ring > div { position: absolute; z-index: 1; text-align: center; }
.health-ring strong { display: block; font-size: 26px; }
.health-ring span { color: var(--muted); font-size: 9px; }
.health-score-card h2 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.health-score-card p { max-width: 600px; margin: 7px 0 14px; color: var(--muted); font-size: 12px; }
.health-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.health-tags span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; background: rgba(25,165,90,.09); color: var(--success); font-size: 10px; font-weight: 750; }
.system-version-card { padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-xs); }
.system-version-card h3 { margin: 0 0 14px; font-size: 15px; }
.system-version-card dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; margin: 0; }
.system-version-card dt { color: var(--muted); font-size: 10px; }
.system-version-card dd { margin: 0; color: var(--text-soft); font-size: 10px; font-weight: 700; }
.resource-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.resource-card { padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-xs); }
.resource-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.resource-card header span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.resource-card header strong { font-size: 18px; }
.spark-chart { width: 100%; height: 74px; margin-top: 10px; overflow: visible; }
.chart-grid-line { stroke: var(--border); stroke-width: 1; }
.spark-area { fill: rgba(37,99,235,.1); }
.spark-line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark-line-purple { stroke: var(--accent); }
.chart-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 9px; }
.storage-panel { margin-top: 16px; }
.storage-overview { display: grid; grid-template-columns: 180px minmax(260px,.8fr) minmax(300px,1.2fr); align-items: center; gap: 26px; padding: 22px; }
.storage-donut { position: relative; display: grid; place-items: center; width: 164px; height: 164px; border-radius: 50%; background: conic-gradient(var(--brand) 0 42%, var(--accent) 42% 54%, var(--warning) 54% 60%, var(--surface-strong) 60% 100%); }
.storage-donut::after { content: ""; width: 108px; height: 108px; border-radius: 50%; background: var(--surface); }
.storage-donut > div { position: absolute; z-index: 1; text-align: center; }
.storage-donut strong { display: block; font-size: 23px; }
.storage-donut span { color: var(--muted); font-size: 9px; }
.storage-breakdown { display: flex; flex-direction: column; gap: 11px; }
.storage-breakdown > div { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 9px; align-items: center; color: var(--muted); font-size: 10px; }
.storage-breakdown i { width: 9px; height: 9px; border-radius: 3px; }
.storage-breakdown b { color: var(--text-soft); }
.storage-free { background: var(--surface-strong); }
.storage-projection { padding: 17px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.storage-projection h3 { margin: 0; font-size: 14px; }
.storage-projection p { margin: 5px 0 12px; color: var(--muted); font-size: 10px; }
.storage-projection .progress { margin: 10px 0; }
.drive-table { min-width: 700px; }
.service-list { display: flex; flex-direction: column; }
.service-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto auto; align-items: center; gap: 12px; min-height: 66px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.service-card:last-child { border-bottom: 0; }
.service-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.service-card strong { display: block; font-size: 12px; }
.service-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.device-list { display: flex; flex-direction: column; }
.device-list > div { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.device-list > div:last-child { border-bottom: 0; }
.device-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-strong); color: var(--muted-strong); }
.device-list strong { font-size: 12px; }
.device-list p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.system-bottom-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(320px,.8fr); gap: 16px; margin-top: 16px; }
.backup-card { padding: 18px; }
.backup-last { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid rgba(25,165,90,.16); border-radius: 13px; background: var(--success-soft); }
.backup-last > span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(25,165,90,.12); color: var(--success); }
.backup-last strong { display: block; font-size: 12px; }
.backup-last p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.backup-destination { margin: 15px 0; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.backup-destination strong { display: block; margin-bottom: 3px; color: var(--text-soft); }
.backup-progress { margin: 15px 0; }
.backup-progress > div { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.backup-progress span { display: block; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.backup-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),var(--accent)); transition: width .18s linear; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-zone { padding: 18px; border: 1px solid rgba(239,68,68,.18); border-radius: 16px; background: linear-gradient(135deg,var(--surface),var(--danger-soft)); }
.danger-zone h3 { margin: 0; color: var(--danger); font-size: 15px; }
.danger-zone p { margin: 6px 0 14px; color: var(--muted); font-size: 10px; }
.danger-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 13px; border: 1px solid rgba(239,68,68,.26); border-radius: 11px; background: var(--danger-soft); color: var(--danger); cursor: pointer; font-size: 11px; font-weight: 750; }
.danger-button:hover { background: var(--danger); color: white; }

.privacy-control {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid rgba(25, 165, 90, .2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--success-soft) 62%, var(--surface));
  box-shadow: var(--shadow-xs);
}
.privacy-control.is-enabled {
  border-color: rgba(37, 99, 235, .24);
  background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface));
}
.privacy-control-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--success);
  box-shadow: var(--shadow-xs);
}
.privacy-control.is-enabled .privacy-control-icon { color: var(--brand); }
.privacy-control-icon .icon { width: 25px; height: 25px; }
.privacy-control-copy { display: flex; flex-direction: column; min-width: 0; }
.privacy-control-copy strong { color: var(--text); font-size: 15px; }
.privacy-control-copy span { margin-top: 3px; color: var(--muted-strong); font-size: 11px; }
.privacy-control-copy small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.privacy-duration { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 750; }
.privacy-duration select {
  min-width: 150px;
  min-height: 40px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.privacy-control > button { min-height: 44px; white-space: nowrap; }
.privacy-control > button:disabled { cursor: not-allowed; opacity: .55; }
.privacy-camera-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #0c1726;
  color: white;
}
.privacy-camera-cover .icon { width: 30px; height: 30px; color: #8dbbff; }
.privacy-camera-cover strong { font-size: 14px; }
.privacy-camera-cover span { color: #aebdcd; font-size: 10px; }
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(18, 42, 74, .9);
  color: #dcecff;
  font-size: 9px;
  font-weight: 850;
}
.privacy-badge .icon { width: 13px; height: 13px; }
.camera-card.is-private .health-dot { background: var(--brand); }
.camera-card.is-private .action-button:disabled { cursor: not-allowed; opacity: .45; }

@media (max-width: 900px) {
  .privacy-control { grid-template-columns: 46px minmax(0, 1fr); }
  .privacy-control-icon { width: 46px; height: 46px; }
  .privacy-duration,
  .privacy-control > button { grid-column: 1 / -1; width: 100%; }
  .privacy-duration select { width: 100%; }
}

/* --------------------------------------------------------------------------
   SETTINGS
   -------------------------------------------------------------------------- */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 16px; margin-top: 18px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 18px); overflow: hidden; border: 1px solid var(--border); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow-xs); }
.settings-nav-head { padding: 15px 16px; border-bottom: 1px solid var(--border); }
.settings-nav-head strong { display: block; font-size: 13px; }
.settings-nav-head span { color: var(--muted); font-size: 10px; }
.settings-nav .page-tabs { flex-direction: column; align-items: stretch; gap: 3px; margin: 0; padding: 7px; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
.settings-nav .page-tab { justify-content: flex-start; width: 100%; }
.settings-content { min-width: 0; }
.settings-page-card { margin-bottom: 16px; }
.profile-settings { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 22px; padding: 20px; }
.profile-avatar-large { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 28px; background: linear-gradient(135deg,var(--brand),var(--accent)); color: white; box-shadow: 0 15px 34px rgba(37,99,235,.2); font-size: 28px; font-weight: 850; }
.password-strength { display: flex; align-items: center; gap: 5px; margin-top: 8px; }
.password-strength i { height: 5px; flex: 1; border-radius: 999px; background: var(--success); }
.password-strength span { margin-left: 6px; color: var(--success); font-size: 9px; font-weight: 750; }
.choice-grid-wide { grid-template-columns: repeat(4,minmax(0,1fr)); }
.theme-choice-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; padding: 18px; }
.theme-choice { padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: left; }
.theme-choice:hover { border-color: var(--border-strong); }
.theme-choice.is-active { border-color: rgba(37,99,235,.42); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(37,99,235,.08); }
.theme-choice strong { display: block; margin-top: 9px; font-size: 11px; }
.theme-choice span { color: var(--muted); font-size: 9px; }
.theme-preview { position: relative; height: 105px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.theme-preview::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 25%; background: #eef2f8; }
.theme-preview::after { content: ""; position: absolute; left: 31%; right: 7%; top: 14%; height: 14%; border-radius: 4px; background: #dbe4ef; box-shadow: 0 26px 0 #e8edf4, 0 52px 0 #e8edf4; }
.theme-preview-light { background: #fff; }
.theme-preview-dark { background: #111b2a; border-color: #30415b; }
.theme-preview-dark::before { background: #0d1522; }
.theme-preview-dark::after { background: #33445e; box-shadow: 0 26px 0 #24344a, 0 52px 0 #24344a; }
.theme-preview-system { background: linear-gradient(90deg,#fff 50%,#111b2a 50%); }
.retention-control { display: grid; grid-template-columns: minmax(0,1fr) 70px; align-items: center; gap: 16px; }
.retention-control strong { text-align: right; color: var(--brand); }
.retention-estimate { margin-top: 12px; padding: 12px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.security-hero { display: flex; align-items: center; gap: 15px; padding: 18px; border-bottom: 1px solid var(--border); }
.security-hero-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; background: var(--success-soft); color: var(--success); }
.security-hero h3 { margin: 0; font-size: 14px; }
.security-hero p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.danger-text-button { padding: 0; border: 0; background: transparent; color: var(--danger); cursor: pointer; font-size: 10px; font-weight: 750; }
.danger-text-button:hover { text-decoration: underline; }
.session-list,
.api-key-list,
.integration-list { display: flex; flex-direction: column; }
.session-list > div,
.api-key-list > div,
.integration-list > div { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 68px; padding: 11px 17px; border-bottom: 1px solid var(--border); }
.session-list > div:last-child,
.api-key-list > div:last-child,
.integration-list > div:last-child { border-bottom: 0; }
.api-key-icon,
.integration-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.api-key-icon { color: var(--accent); background: var(--purple-soft); }
.integration-onvif { color: var(--brand); background: var(--brand-soft); }
.integration-ha { color: var(--warning); background: var(--warning-soft); }
.integration-nas { color: var(--success); background: var(--success-soft); }
.session-list strong,
.api-key-list strong,
.integration-list strong { display: block; font-size: 12px; }
.session-list p,
.api-key-list p,
.integration-list p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }

/* --------------------------------------------------------------------------
   LOGIN & ERROR
   -------------------------------------------------------------------------- */
.login-page { overflow: auto; background: var(--surface); }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(480px,1.1fr) minmax(430px,.9fr); }
.login-visual { position: relative; min-height: 100vh; overflow: hidden; background: #07101d; }
.login-visual > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-visual-overlay { position: absolute; inset: 0; background: linear-gradient(145deg,rgba(5,13,24,.28),rgba(5,13,24,.82) 74%), linear-gradient(0deg,rgba(37,99,235,.28),transparent 42%); }
.login-brand { position: absolute; top: 30px; left: 34px; z-index: 2; display: block; width: 220px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.17); border-radius: 16px; background: rgba(255,255,255,.88); box-shadow: 0 16px 40px rgba(0,0,0,.18); backdrop-filter: blur(12px); }
.login-brand img { width: 100%; }
.login-visual-copy { position: absolute; z-index: 2; left: clamp(34px,6vw,96px); right: clamp(34px,8vw,120px); bottom: 130px; color: white; }
.login-visual-copy .live-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; background: rgba(20,165,90,.22); color: #adffc9; border: 1px solid rgba(173,255,201,.2); font-size: 10px; letter-spacing: .08em; }
.login-visual-copy .live-badge span { width: 7px; height: 7px; border-radius: 50%; background: #4bf08a; box-shadow: 0 0 0 4px rgba(75,240,138,.15); }
.login-visual-copy h1 { max-width: 760px; margin: 20px 0 13px; font-size: clamp(38px,4.7vw,70px); line-height: .98; letter-spacing: -.05em; }
.login-visual-copy p { max-width: 650px; margin: 0; color: rgba(255,255,255,.72); font-size: 14px; }
.login-system-stats { display: flex; align-items: center; gap: 34px; margin-top: 32px; }
.login-system-stats > span { display: flex; flex-direction: column; padding-right: 34px; border-right: 1px solid rgba(255,255,255,.18); }
.login-system-stats > span:last-child { border-right: 0; }
.login-system-stats strong { font-size: 20px; }
.login-system-stats small { color: rgba(255,255,255,.58); font-size: 10px; }
.login-camera-label { position: absolute; z-index: 2; left: 28px; right: 28px; bottom: 24px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: rgba(5,13,24,.45); color: rgba(255,255,255,.8); backdrop-filter: blur(12px); font-size: 11px; }
.login-camera-label time { margin-left: auto; font-variant-numeric: tabular-nums; }
.login-form-area { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px clamp(28px,5vw,82px) 26px; background: var(--surface); }
.login-card { width: min(440px,100%); }
.login-mobile-logo { display: none; }
.login-welcome h2 { margin: 6px 0 7px; font-size: 34px; letter-spacing: -.035em; }
.login-welcome > p:last-child { margin: 0 0 28px; color: var(--muted); }
.login-card form { display: flex; flex-direction: column; gap: 15px; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.login-options > button { padding: 0; border: 0; background: transparent; color: var(--brand); cursor: pointer; font-size: 11px; font-weight: 700; }
.login-submit { width: 100%; margin-top: 4px; }
.login-security { display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); color: var(--muted); font-size: 10px; }
.login-security .icon { width: 18px; color: var(--success); }
.login-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 16px; width: 100%; margin-top: 46px; color: var(--muted); font-size: 10px; }
.login-footer a:hover { color: var(--brand); }
.error-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.error-page main { width: min(560px,100%); padding: 42px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-md); text-align: center; }
.error-page main > img { width: 250px; margin: 0 auto 25px; }
.error-code { display: block; color: var(--brand); font-size: 70px; font-weight: 900; line-height: 1; letter-spacing: -.06em; }
.error-page h1 { margin: 12px 0 8px; font-size: 28px; }
.error-page p { margin: 0 auto 24px; color: var(--muted); }
.error-page main > div { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* --------------------------------------------------------------------------
   RESPONSIVE MULTI-PAGE
   -------------------------------------------------------------------------- */
@media (max-width: 1500px) {
  .inventory-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .archive-layout { grid-template-columns: minmax(0,1.55fr) 310px; }
}

@media (max-width: 1240px) {
  .archive-layout,
  .events-layout,
  .camera-detail-layout,
  .system-health-hero,
  .system-bottom-grid { grid-template-columns: 1fr; }
  .archive-side-panel { order: -1; }
  .filter-stack { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filter-stack .quick-range,
  .filter-stack .archive-info-box { grid-column: 1 / -1; }
  .events-sidebar { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-side-panel { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-side-panel .panel-header { grid-column: 1 / -1; }
  .storage-overview { grid-template-columns: 170px minmax(240px,1fr); }
  .storage-projection { grid-column: 1 / -1; }
  .login-shell { grid-template-columns: minmax(420px,1fr) minmax(390px,.86fr); }
}

@media (max-width: 1050px) {
  .profile-menu { display: none; }
  .inventory-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .settings-nav .page-tabs { flex-direction: row; overflow-x: auto; }
  .settings-nav .page-tab { width: auto; }
  .channel-grid { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 520px; }
  .login-form-area { min-height: auto; padding-top: 70px; padding-bottom: 46px; }
}

@media (max-width: 820px) {
  .form-grid,
  .settings-form-grid,
  .profile-settings,
  .theme-choice-grid,
  .choice-grid-wide,
  .events-sidebar,
  .detail-side-panel { grid-template-columns: 1fr; }
  .form-span-2 { grid-column: auto; }
  .profile-avatar-large { margin-bottom: 2px; }
  .filter-stack { grid-template-columns: 1fr; }
  .filter-stack .quick-range,
  .filter-stack .archive-info-box { grid-column: auto; }
  .event-card { grid-template-columns: 46px 112px minmax(0,1fr); }
  .event-time { font-size: 9px; }
  .detail-live-frame,
  .detail-live-frame > img { min-height: 380px; }
  .detail-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .detail-metrics > div:nth-child(2) { border-right: 0; }
  .detail-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .storage-overview { grid-template-columns: 1fr; }
  .storage-donut { margin: 0 auto; }
  .camera-grid.is-list .camera-card { grid-template-columns: 190px minmax(0,1fr); }
  .camera-grid.is-list .camera-actions { grid-column: 1 / -1; border-top: 1px solid var(--border); border-left: 0; }
}

@media (max-width: 680px) {
  .panel-header { min-height: 64px; padding: 14px; }
  .panel-body { padding: 14px; }
  .archive-player,
  .archive-player img { min-height: 280px; }
  .player-controls { flex-wrap: wrap; }
  .player-range { order: 5; flex-basis: 100%; }
  .event-card { grid-template-columns: 42px minmax(0,1fr); }
  .event-thumb { grid-column: 2; height: 150px; }
  .event-copy { grid-column: 2; }
  .event-line { bottom: -220px; }
  .inventory-grid { grid-template-columns: 1fr; }
  .inventory-media { height: 210px; }
  .inbox-item { grid-template-columns: 32px 42px minmax(0,1fr); gap: 9px; }
  .inbox-item > .status-chip { display: none; }
  .inbox-actions { grid-column: 3; justify-content: flex-end; }
  .resource-grid { grid-template-columns: 1fr; }
  .health-score-card { flex-direction: column; text-align: center; }
  .health-tags { justify-content: center; }
  .system-version-card dl { grid-template-columns: 1fr; gap: 3px; }
  .system-version-card dd { margin-bottom: 8px; }
  .connection-method,
  .choice-grid { grid-template-columns: 1fr; }
  .range-settings label { grid-template-columns: 1fr 44px; }
  .range-settings label span { grid-column: 1 / -1; }
  .detail-live-frame,
  .detail-live-frame > img { min-height: 300px; }
  .detail-live-controls { position: static; padding: 10px; background: #08111f; }
  .control-spacer { display: none; }
  .live-control { flex: 1; }
  .login-visual { display: none; }
  .login-form-area { min-height: 100vh; padding: 36px 22px 24px; }
  .login-mobile-logo { display: block; width: 230px; margin: 0 auto 42px; }
  .login-mobile-logo img { width: 100%; }
  .login-welcome h2 { font-size: 30px; }
  .error-page main { padding: 30px 20px; }
}

@media (max-width: 520px) {
  .toolbar > .search-field,
  .toolbar > .select-control,
  .camera-toolbar > .search-field,
  .camera-toolbar > .select-control { width: 100%; max-width: none; flex-basis: 100%; }
  .toolbar-filters,
  .filter-group { width: 100%; overflow-x: auto; padding-bottom: 3px; }
  .archive-player,
  .archive-player img { min-height: 230px; }
  .round-control { display: none; }
  .player-play-button { min-width: 80px; }
  .event-title-row { flex-direction: column; gap: 7px; }
  .event-actions .secondary-button { flex: 1; }
  .detail-definition { grid-template-columns: 1fr; gap: 2px; }
  .detail-definition dd { margin-bottom: 9px; }
  .camera-grid.is-list .camera-card { display: block; }
  .camera-grid.is-list .camera-media { height: 190px; }
  .camera-actions { gap: 3px; }
  .camera-action { font-size: 10px; }
  .big-live-bottom { flex-wrap: wrap; }
  .big-live-bottom .live-control { flex: 1; }
  .live-spacer { display: none; }
  .form-dialog-footer,
  .modal-footer { flex-wrap: wrap; }
  .form-dialog-footer > *,
  .modal-footer > .primary-button,
  .modal-footer > .secondary-button { flex: 1; }
  .login-options { align-items: flex-start; flex-direction: column; }
}
/* ========================================================================== 
   POLZIN KAMERY — FINAL MULTI-PAGE COMPONENT LAYER
   This layer targets the production-shaped page markup used in this package.
   ========================================================================== */

/* Shared controls, status components and surfaces */
.profile-wrap { position: relative; flex: 0 0 auto; }
.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  display: none;
  width: 246px;
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.profile-wrap.is-open .profile-dropdown { display: block; animation: profile-pop .16s ease-out; }
@keyframes profile-pop { from { opacity: 0; transform: translateY(-5px) scale(.98); } }
.profile-dropdown-header { display: flex; align-items: center; gap: 11px; padding: 9px 10px 12px; }
.profile-dropdown-header > div { min-width: 0; }
.profile-dropdown-header strong,
.profile-dropdown-header small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-dropdown-header strong { font-size: 13px; }
.profile-dropdown-header small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.profile-dropdown > a,
.profile-dropdown > button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}
.profile-dropdown > a:hover,
.profile-dropdown > button:hover { color: var(--text); background: var(--surface-soft); }
.profile-dropdown > a .icon,
.profile-dropdown > button .icon { width: 17px; color: var(--muted); }
.profile-dropdown-separator { height: 1px; margin: 6px 5px; background: var(--border); }
.profile-dropdown .danger-link { color: var(--danger); }
.profile-dropdown .danger-link .icon { color: var(--danger); }

.heading-chip,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(37, 99, 235, .13);
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.badge .icon { width: 13px; height: 13px; }
.badge.success,
.heading-chip.success { color: var(--success); border-color: rgba(25,165,90,.18); background: var(--success-soft); }
.badge.warning,
.heading-chip.warning { color: #b86d00; border-color: rgba(245,158,11,.2); background: var(--warning-soft); }
.badge.danger,
.heading-chip.danger { color: var(--danger); border-color: rgba(239,68,68,.2); background: var(--danger-soft); }
.badge.purple,
.heading-chip.purple { color: var(--accent); border-color: rgba(109,74,255,.18); background: var(--purple-soft); }
.badge.info,
.heading-chip.info { color: var(--brand-strong); border-color: rgba(37,99,235,.17); background: var(--brand-soft); }
.badge.outline { color: var(--muted-strong); border-color: var(--border); background: var(--surface); }
.badge.light { color: var(--muted-strong); border-color: transparent; background: var(--surface-strong); }
.dot,
.status-dot,
.status-line > .light,
.health-pill > .light {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}
.status-dot { color: var(--success); }

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.panel-title { min-width: 0; }
.panel-title h2,
.panel-title h3 { margin: 0; color: var(--text); font-size: 16px; letter-spacing: -.018em; }
.panel-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.section-stack {
  display: grid;
  gap: 18px;
  max-width: 1800px;
  margin: 18px auto 0;
}
.section-grid {
  display: grid;
  gap: 16px;
  max-width: 1800px;
  margin-left: auto;
  margin-right: auto;
}
.section-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.section-grid.main-aside { grid-template-columns: minmax(0, 1fr) 350px; align-items: start; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.button-sm { min-height: 36px !important; padding-inline: 11px !important; border-radius: 10px !important; font-size: 11px !important; }
.button-lg { min-height: 50px !important; padding-inline: 18px !important; font-size: 13px !important; }
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(239,68,68,.24);
  border-radius: 11px;
  background: var(--danger-soft);
  color: var(--danger);
  cursor: pointer;
  font-weight: 750;
}
.button-danger:hover { background: var(--danger); color: #fff; }

.field { display: flex; flex-direction: column; gap: 7px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
.input-control,
.native-select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  outline: 0;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.native-select { min-width: 168px; padding-right: 35px; }
.input-control:focus,
.native-select:focus { border-color: rgba(37,99,235,.48); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.input-control::placeholder { color: var(--muted); }
.input-with-icon .input-control { padding-left: 40px; }
.password-field .input-control { padding-right: 44px; }
.field-row { display: flex; align-items: center; gap: 9px; }
.date-field { min-width: 154px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text-soft); font-size: 11px; font-weight: 650; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--brand); }

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  max-width: 1800px;
  margin: 18px auto 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: var(--shadow-xs);
}
.filter-bar > .search-field { flex: 1 1 290px; max-width: 430px; }
.filter-bar > .select-control { min-width: 175px; }
.filter-bar-spacer { flex: 1 1 auto; }
.filter-summary { color: var(--muted); white-space: nowrap; font-size: 10px; }
.filter-summary strong { color: var(--text-soft); }

.metric-card {
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.metric-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.metric-icon.warning { color: var(--warning); background: var(--warning-soft); }
.metric-icon.success { color: var(--success); background: var(--success-soft); }
.metric-icon.purple { color: var(--accent); background: var(--purple-soft); }
.metric-icon .icon { width: 19px; }
.metric-note { color: var(--muted); font-size: 9px; font-weight: 700; }
.metric-copy { display: flex; flex-direction: column; margin-top: 13px; }
.metric-copy strong { font-size: 23px; letter-spacing: -.035em; }
.metric-copy span { margin-top: 2px; color: var(--muted); font-size: 10px; }

.tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 1800px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  white-space: nowrap;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}
.tab-button:hover { color: var(--text); background: var(--surface-soft); }
.tab-button.is-active { color: var(--brand-strong); background: var(--brand-soft); box-shadow: inset 0 0 0 1px rgba(37,99,235,.08); }
.tab-button .icon { width: 16px; }

.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 44px;
  height: 25px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-strong);
  transition: background var(--transition), border-color var(--transition);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(17,28,46,.2);
  transition: transform var(--transition);
}
.switch input:checked + .switch-track { border-color: var(--brand); background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(19px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(37,99,235,.16); }

.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.progress-meta strong { color: var(--text-soft); }
.progress { height: 8px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.progress.success > span { background: linear-gradient(90deg, #20b765, #55d889); }
.progress.warning > span { background: linear-gradient(90deg, #ffb42f, var(--warning)); }
.progress.danger > span { background: linear-gradient(90deg, #ff6b6b, var(--danger)); }

.data-table-wrap { width: 100%; overflow-x: auto; }
.table-check { width: 16px; height: 16px; accent-color: var(--brand); }
.row-title,
.row-subtitle { display: block; white-space: nowrap; }
.row-title { color: var(--text-soft); font-size: 11px; font-weight: 700; }
.row-subtitle { margin-top: 2px; color: var(--muted); font-size: 9px; }
.user-cell { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.user-cell > div { min-width: 0; }
.user-cell strong,
.user-cell span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-cell strong { color: var(--text); font-size: 12px; }
.user-cell span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.table-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 11px; background: linear-gradient(135deg, var(--brand-soft), var(--purple-soft)); color: var(--brand-strong); font-size: 10px; font-weight: 850; }
.empty-inline { display: grid; place-items: center; gap: 6px; min-height: 220px; padding: 30px; color: var(--muted); text-align: center; }
.empty-inline > .icon { width: 34px; height: 34px; color: var(--brand); }
.empty-inline strong { color: var(--text); font-size: 14px; }
.empty-inline p { margin: 0; font-size: 11px; }

.detail-list { display: grid; gap: 0; margin: 0; }
.detail-list > div { display: grid; grid-template-columns: minmax(105px,.75fr) minmax(0,1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted); font-size: 10px; }
.detail-list dd { margin: 0; color: var(--text-soft); text-align: right; overflow-wrap: anywhere; font-size: 10px; font-weight: 750; }

.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 78px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-copy { min-width: 0; }
.setting-copy strong { display: block; color: var(--text); font-size: 12px; }
.setting-copy p { max-width: 720px; margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.setting-control { flex: 0 1 340px; min-width: 190px; }
.setting-control .input-control,
.setting-control .native-select { width: 100%; }
.range-row { display: grid; grid-template-columns: minmax(130px,1fr) 60px; align-items: center; gap: 12px; }
.range-row input[type="range"] { width: 100%; accent-color: var(--brand); }
.range-value { color: var(--brand-strong); text-align: right; font-size: 11px; font-weight: 800; }

.app-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 21px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.app-dialog.wide { width: min(980px, calc(100vw - 28px)); }
.app-dialog.narrow { width: min(520px, calc(100vw - 28px)); }
.app-dialog::backdrop { background: rgba(7,14,25,.55); backdrop-filter: blur(6px); }
.app-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.app-dialog-title h2 { margin: 0; font-size: 19px; }
.app-dialog-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.app-dialog-body { max-height: calc(100vh - 190px); padding: 20px; overflow-y: auto; }
.app-dialog-footer { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-soft); }

/* Login */
body[data-page="login"] { min-height: 100vh; background: var(--surface); }
body[data-page="login"] .login-page { display: grid; grid-template-columns: minmax(440px, .78fr) minmax(620px, 1.22fr); min-height: 100vh; }
.login-panel { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; padding: 56px clamp(48px,5vw,92px) 34px; background: var(--surface); }
.login-logo { width: 252px; margin-bottom: 55px; }
.login-copy .eyebrow { margin-bottom: 12px; }
.login-copy h1 { margin: 0; font-size: clamp(38px,3.4vw,54px); line-height: 1; letter-spacing: -.05em; }
.login-copy > p:last-child { max-width: 480px; margin: 15px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.login-form { display: grid; gap: 16px; width: min(440px,100%); margin-top: 34px; }
.login-form .field > span { font-size: 11px; }
.login-form .input-control { min-height: 49px; border-radius: 13px; background: var(--surface-soft); }
.login-form .input-with-icon > .icon { left: 15px; }
.password-toggle { right: 8px !important; }
.login-options { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.login-link { color: var(--brand); font-size: 11px; font-weight: 750; }
.login-link:hover { text-decoration: underline; }
.login-demo { display: flex; align-items: flex-start; gap: 9px; width: min(440px,100%); margin-top: 21px; padding: 12px 13px; border: 1px solid rgba(37,99,235,.13); border-radius: 12px; background: var(--brand-soft); color: var(--muted-strong); font-size: 10px; }
.login-demo .icon { width: 17px; color: var(--brand); }
body[data-page="login"] .login-footer { justify-content: flex-start; width: min(440px,100%); margin: 44px 0 0; color: var(--muted); font-size: 9px; }
.login-side { position: relative; min-width: 0; overflow: hidden; padding: 54px; background: radial-gradient(circle at 83% 9%, rgba(126,164,255,.92), transparent 24rem), linear-gradient(145deg,#1f56e7 0%,#4f46e5 56%,#2b1c8e 100%); }
.login-side::before,
.login-side::after { content: ""; position: absolute; border-radius: 50%; filter: blur(2px); opacity: .38; }
.login-side::before { width: 520px; height: 520px; right: -210px; bottom: -260px; background: rgba(255,255,255,.2); }
.login-side::after { width: 320px; height: 320px; left: -150px; top: -130px; background: rgba(143,203,255,.42); }
.login-showcase { position: relative; z-index: 1; display: grid; place-items: center; width: 100%; height: 100%; }
.login-showcase-window { width: min(900px,92%); overflow: hidden; border: 1px solid rgba(255,255,255,.32); border-radius: 26px; background: rgba(255,255,255,.94); box-shadow: 0 42px 100px rgba(7,16,47,.34); transform: perspective(1500px) rotateY(-4deg) rotateX(1.2deg); }
.login-showcase-bar { display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-bottom: 1px solid rgba(17,28,46,.08); background: rgba(247,249,253,.92); }
.login-showcase-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff6b67; }
.login-showcase-bar i:nth-child(2) { background: #ffc85a; }
.login-showcase-bar i:nth-child(3) { background: #42cf78; }
.login-showcase-main { display: grid; grid-template-columns: 150px minmax(0,1fr); min-height: 570px; }
.login-mini-sidebar { padding: 22px 14px; background: #f7f9fc; border-right: 1px solid #e6ebf2; }
.login-mini-brand { display: flex; align-items: center; gap: 9px; color: #111c2e; font-size: 15px; font-weight: 850; }
.login-mini-brand img { width: 34px; height: 34px; }
.login-mini-nav { display: grid; gap: 11px; margin-top: 34px; }
.login-mini-nav span { height: 30px; border-radius: 9px; background: #e8edf5; }
.login-mini-nav span:first-child { background: linear-gradient(90deg,#dce7ff,#eff3ff); box-shadow: inset 3px 0 #3b6ff5; }
.login-mini-content { padding: 28px; background: linear-gradient(180deg,#f7f9fd,#f1f5fb); }
.login-mini-heading { width: 37%; height: 28px; border-radius: 8px; background: #15213a; }
.login-mini-sub { width: 53%; height: 10px; margin-top: 12px; border-radius: 999px; background: #cbd4e2; }
.login-mini-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 24px; }
.login-mini-stats span { height: 78px; border: 1px solid #e0e6ef; border-radius: 14px; background: #fff; box-shadow: 0 8px 24px rgba(17,28,46,.05); }
.login-mini-cameras { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; margin-top: 16px; }
.login-mini-camera { overflow: hidden; border: 1px solid #e0e6ef; border-radius: 15px; background: #fff; box-shadow: 0 8px 26px rgba(17,28,46,.06); }
.login-mini-camera img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.login-mini-camera div { height: 38px; background: linear-gradient(90deg,#f5f7fb 35%,#fff 35%); }

/* Recordings */
.timeline-strip { padding: 15px 17px 13px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-xs); }
.timeline-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.timeline-strip .timeline-track { position: relative; height: 38px; margin-top: 7px; overflow: hidden; border: 1px solid var(--border); border-radius: 9px; background: repeating-linear-gradient(90deg,var(--surface) 0,var(--surface) calc(8.333% - 1px),var(--border) calc(8.333% - 1px),var(--border) 8.333%); }
.timeline-segment { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; background: linear-gradient(90deg,#5f8ff8,#3170ec); }
.timeline-segment.motion { background: linear-gradient(90deg,#ffbf4c,#f59e0b); }
.timeline-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.timeline-now::before { content: ""; position: absolute; top: 0; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); transform: translate(-50%,-45%); }
.timeline-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 9px; color: var(--muted); font-size: 9px; }
.timeline-legend span { display: inline-flex; align-items: center; gap: 6px; }
.timeline-legend span:last-child { margin-left: auto; }
.timeline-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }
.timeline-legend i.motion { background: var(--warning); }
.recordings-layout { display: grid; grid-template-columns: minmax(0,1fr) 310px; gap: 16px; align-items: start; }
.recording-list { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-xs); }
.recordings-day { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface-soft); }
.recordings-day strong { font-size: 12px; }
.recordings-day span { color: var(--muted); font-size: 10px; }
.recording-row { display: grid; grid-template-columns: 20px 104px minmax(190px,1.25fr) 88px 106px 86px 114px; align-items: center; gap: 12px; min-height: 88px; padding: 11px 14px; border-bottom: 1px solid var(--border); transition: background var(--transition); }
.recording-row:last-child { border-bottom: 0; }
.recording-row:hover { background: var(--surface-soft); }
.recording-row:has(.recording-check:checked) { background: var(--brand-soft); }
.recording-thumb { width: 104px; height: 62px; }
.recording-thumb .play-overlay { opacity: 1; background: linear-gradient(180deg,transparent,rgba(4,10,18,.32)); }
.recording-thumb .play-overlay > span { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.9); color: #17213a; box-shadow: 0 7px 18px rgba(0,0,0,.2); }
.recording-main { min-width: 0; }
.recording-main > strong { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.recording-main > p { margin: 4px 0 7px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.recording-meta { color: var(--muted); font-size: 8px; }
.recording-meta strong { display: block; margin-bottom: 3px; color: var(--text-soft); white-space: nowrap; font-size: 10px; }
.recording-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.selection-toolbar { position: sticky; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(37,99,235,.18); border-radius: 14px; background: color-mix(in srgb,var(--surface) 92%,var(--brand-soft)); box-shadow: var(--shadow-md); }
.selection-copy strong { color: var(--brand-strong); font-size: 17px; }
.selection-copy span { margin-left: 4px; color: var(--muted); font-size: 10px; }
.storage-ring { position: relative; display: grid; place-items: center; width: 168px; height: 168px; margin: 2px auto 20px; border-radius: 50%; background: conic-gradient(var(--brand) 0 44%,var(--accent) 44% 56%,var(--warning) 56% 60%,var(--surface-strong) 60% 100%); }
.storage-ring::after { content: ""; width: 108px; height: 108px; border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.storage-ring-copy { position: absolute; z-index: 1; text-align: center; }
.storage-ring-copy strong { display: block; font-size: 25px; letter-spacing: -.03em; }
.storage-ring-copy span { color: var(--muted); font-size: 9px; }
.legend-list { display: grid; gap: 10px; }
.legend-item { display: grid; grid-template-columns: 10px minmax(0,1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: 9px; }
.legend-item i { width: 9px; height: 9px; border-radius: 3px; background: var(--brand); }
.legend-item i.purple { background: var(--accent); }
.legend-item i.warning { background: var(--warning); }
.legend-item i.muted { background: var(--surface-strong); border: 1px solid var(--border); }
.legend-item strong { color: var(--text-soft); font-size: 10px; }

/* Events */
.event-overview { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(300px,.7fr); gap: 16px; }
.segmented { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.segmented button { min-height: 31px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 9px; font-weight: 750; }
.segmented button.is-active { color: var(--brand-strong); background: var(--surface); box-shadow: var(--shadow-xs); }
.bar-chart { display: grid; grid-template-columns: repeat(12,minmax(20px,1fr)); align-items: end; gap: 8px; height: 178px; padding-top: 8px; }
.bar-column { display: grid; grid-template-rows: 1fr 20px; align-items: end; gap: 8px; height: 100%; }
.bar { min-height: 5px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg,#6f9af9,var(--brand)); box-shadow: 0 6px 14px rgba(37,99,235,.13); }
.bar-column:nth-child(4n) .bar { background: linear-gradient(180deg,#9a7fff,var(--accent)); }
.bar-column span { color: var(--muted); text-align: center; white-space: nowrap; font-size: 8px; }
.event-type-list { display: grid; gap: 1px; }
.event-type-row { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.event-type-row:last-child { border-bottom: 0; }
.event-type-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.event-type-icon.success { color: var(--success); background: var(--success-soft); }
.event-type-icon.warning { color: var(--warning); background: var(--warning-soft); }
.event-type-icon.danger { color: var(--danger); background: var(--danger-soft); }
.event-type-row strong,
.event-type-row span { display: block; }
.event-type-row strong { font-size: 11px; }
.event-type-row div > span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.event-type-row b { font-size: 17px; }
.status-line { display: flex; align-items: center; gap: 9px; }
.status-line > .light { color: var(--success); }
.status-line strong,
.status-line span { display: block; }
.status-line strong { font-size: 10px; }
.status-line div > span { color: var(--muted); font-size: 8px; }
.event-list { display: grid; }
.event-row { display: grid; grid-template-columns: 130px minmax(240px,1.35fr) minmax(110px,.52fr) minmax(150px,.62fr) 116px; align-items: center; gap: 14px; min-height: 100px; padding: 12px 0; border-bottom: 1px solid var(--border); transition: opacity var(--transition), background var(--transition); }
.event-row:last-child { border-bottom: 0; }
.event-row:hover { background: var(--surface-soft); }
.event-row.is-reviewed { opacity: .62; }
.event-thumb { width: 130px; height: 76px; object-fit: cover; border-radius: 12px; }
.event-main { min-width: 0; }
.event-main > strong { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text); font-size: 12px; }
.event-main > p { margin: 5px 0 7px; color: var(--muted); font-size: 9px; }
.event-detail { color: var(--muted); font-size: 9px; }
.event-detail strong { display: block; margin-bottom: 3px; color: var(--text-soft); font-size: 10px; }
.event-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.event-detail-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(240px,.8fr); gap: 18px; }
.event-detail-image { overflow: hidden; border-radius: 15px; background: #07111f; }
.event-detail-image img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* Camera inventory and add/edit form */
.discovery-banner { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border: 1px solid rgba(37,99,235,.16); border-radius: 16px; background: linear-gradient(135deg,var(--brand-soft),color-mix(in srgb,var(--purple-soft) 50%,var(--surface))); }
.discovery-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--brand); background: rgba(255,255,255,.72); box-shadow: var(--shadow-xs); }
.discovery-banner h2 { margin: 0; font-size: 13px; }
.discovery-banner p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.camera-admin-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.managed-camera-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-xs); transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.managed-camera-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.managed-camera-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #07111f; }
.managed-camera-media img { width: 100%; height: 100%; object-fit: cover; }
.managed-camera-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg,rgba(0,0,0,.22),transparent 48%,rgba(0,0,0,.18)); pointer-events: none; }
.managed-camera-status { position: absolute; z-index: 2; top: 11px; left: 11px; background: rgba(255,255,255,.9) !important; backdrop-filter: blur(8px); }
.managed-camera-menu { position: absolute; z-index: 3; top: 9px; right: 9px; }
.managed-camera-menu .icon-button { border-color: rgba(255,255,255,.24); background: rgba(9,17,31,.48); color: #fff; backdrop-filter: blur(8px); }
.managed-camera-copy { padding: 14px; }
.managed-camera-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.managed-camera-title h2 { margin: 0; font-size: 14px; }
.managed-camera-title p { margin: 3px 0 0; color: var(--muted); font-size: 9px; }
.camera-spec-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.camera-spec { min-width: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-soft); }
.camera-spec span,
.camera-spec strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-spec span { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.camera-spec strong { margin-top: 3px; color: var(--text-soft); font-size: 9px; }
.managed-camera-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 10px 13px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.camera-admin-grid.is-compact { grid-template-columns: 1fr; }
.camera-admin-grid.is-compact .managed-camera-card { grid-template-columns: 250px minmax(0,1fr) 180px; }
.camera-form-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 20px; }
.form-section { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.form-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.form-section-title { margin: 0 0 13px; font-size: 12px; }
.camera-form-layout .field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
.camera-preview-card { position: sticky; top: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface-soft); }
.camera-preview-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.camera-preview-card > div { padding: 13px; }
.connection-test { display: grid; gap: 10px; margin-top: 12px; padding: 12px; border: 1px solid rgba(25,165,90,.16); border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 10px; }

/* Camera details */
.player-chip { display: inline-flex; align-items: center; min-height: 29px; padding: 0 9px; border: 1px solid rgba(255,255,255,.2); border-radius: 9px; background: rgba(8,16,29,.52); color: #fff; backdrop-filter: blur(8px); font-size: 9px; font-weight: 750; }
.zone-preview { position: relative; overflow: hidden; border-radius: 14px; background: #07111f; }
.zone-preview img { width: 100%; aspect-ratio: 16/9; object-fit: cover; opacity: .88; }
.zone-box { position: absolute; border: 2px solid var(--brand); background: rgba(37,99,235,.12); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.zone-box.z1 { left: 8%; top: 24%; width: 49%; height: 54%; }
.zone-box.z2 { right: 8%; top: 13%; width: 28%; height: 38%; border-color: var(--warning); background: rgba(245,158,11,.12); }

/* Notifications */
.notifications-layout { display: grid; grid-template-columns: minmax(0,1fr) 350px; gap: 16px; align-items: start; }
.notification-page-list { display: grid; }
.notification-page-item { position: relative; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: flex-start; gap: 12px; min-height: 102px; padding: 16px 18px; border-bottom: 1px solid var(--border); transition: background var(--transition), opacity var(--transition); }
.notification-page-item:last-child { border-bottom: 0; }
.notification-page-item:hover { background: var(--surface-soft); }
.notification-page-item.is-unread { background: linear-gradient(90deg,var(--brand-soft),transparent 70%); }
.notification-page-item.is-unread::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 3px; border-radius: 0 4px 4px 0; background: var(--brand); }
.notification-page-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.notification-page-icon.warning { color: var(--warning); background: var(--warning-soft); }
.notification-page-icon.success { color: var(--success); background: var(--success-soft); }
.notification-page-icon.danger { color: var(--danger); background: var(--danger-soft); }
.notification-page-copy { min-width: 0; }
.notification-page-copy > strong { display: block; color: var(--text); font-size: 12px; }
.notification-page-copy > p { margin: 5px 0 10px; color: var(--muted); font-size: 10px; }
.notification-page-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: 9px; }
.notification-page-actions { display: flex; align-items: center; gap: 5px; }
.notification-rule-list { display: grid; }
.notification-rule { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 66px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.notification-rule:last-child { border-bottom: 0; }
.notification-rule > span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.notification-rule strong { display: block; font-size: 10px; }
.notification-rule p { margin: 2px 0 0; color: var(--muted); font-size: 8px; }

/* Users and audit */
.role-card-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.role-card { padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface-soft); }
.role-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.role-card-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--brand); background: var(--brand-soft); }
.role-card h3 { margin: 15px 0 5px; font-size: 14px; }
.role-card > p { margin: 0; color: var(--muted); font-size: 9px; }
.role-card ul { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--text-soft); font-size: 9px; }
.role-card li { display: flex; align-items: center; gap: 7px; }
.role-card li .icon { width: 14px; color: var(--success); }
.session-item { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.session-item:last-child { border-bottom: 0; }
.audit-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-top: 22px; }
.audit-stat { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 14px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-xs); }
.audit-stat > span { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.audit-stat strong,
.audit-stat small { display: block; }
.audit-stat strong { font-size: 18px; }
.audit-stat small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.audit-action { display: flex; align-items: center; gap: 9px; min-width: 185px; }
.audit-action > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--surface-strong); color: var(--muted-strong); }
.audit-action strong,
.audit-action small { display: block; }
.audit-action strong { color: var(--text-soft); font-size: 10px; }
.audit-action small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination button { min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted-strong); cursor: pointer; font-size: 9px; }
.pagination button:hover,
.pagination button.is-active { color: var(--brand-strong); border-color: rgba(37,99,235,.22); background: var(--brand-soft); }
.code-block { margin: 12px 0 0; padding: 12px; overflow-x: auto; border: 1px solid var(--border); border-radius: 11px; background: #0e1726; color: #dce8ff; font: 10px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace; }

/* System */
.health-hero { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(500px,.82fr); gap: 16px; }
.system-health-card { position: relative; min-height: 300px; overflow: hidden; padding: 30px; border: 1px solid rgba(37,99,235,.14); border-radius: 20px; background: radial-gradient(circle at 95% 10%,rgba(117,152,255,.28),transparent 18rem),linear-gradient(135deg,var(--surface),var(--brand-soft)); box-shadow: var(--shadow-xs); }
.system-health-card::after { content: ""; position: absolute; width: 240px; height: 240px; right: -90px; bottom: -120px; border: 32px solid rgba(37,99,235,.07); border-radius: 50%; }
.health-badge-large { display: inline-flex; align-items: center; gap: 8px; min-height: 29px; padding: 0 11px; border: 1px solid rgba(25,165,90,.18); border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 9px; font-weight: 850; letter-spacing: .07em; }
.health-badge-large i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(25,165,90,.12); }
.system-health-card h2 { max-width: 720px; margin: 24px 0 10px; font-size: clamp(25px,2.3vw,38px); line-height: 1.08; letter-spacing: -.04em; }
.system-health-card > p { max-width: 760px; margin: 0; color: var(--muted-strong); font-size: 11px; line-height: 1.65; }
.health-pills { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.health-pill { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb,var(--surface) 82%,transparent); color: var(--text-soft); font-size: 9px; font-weight: 700; }
.health-pill > .light { color: var(--success); }
.resource-card { padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-xs); }
.resource-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resource-head h3 { margin: 0; font-size: 14px; }
.resource-head span { color: var(--muted); font-size: 9px; }
.resource-gauges { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 25px; }
.gauge { min-width: 0; text-align: center; }
.gauge-ring { --value: 50%; position: relative; display: grid; place-items: center; width: min(104px,100%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: conic-gradient(var(--brand) var(--value),var(--surface-strong) 0); }
.gauge-ring::after { content: ""; width: 72%; height: 72%; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.gauge-ring > div { position: absolute; z-index: 1; }
.gauge-ring strong,
.gauge-ring span { display: block; }
.gauge-ring strong { font-size: 16px; }
.gauge-ring span { color: var(--muted); font-size: 7px; font-weight: 800; }
.gauge-note { display: block; margin-top: 9px; color: var(--muted); font-size: 8px; }
.service-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.service-grid .service-card { min-height: 78px; padding: 12px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.disk-list { display: grid; gap: 12px; }
.disk-item { padding: 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
.disk-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.disk-title { display: flex; align-items: center; gap: 11px; min-width: 0; }
.disk-title > span { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; color: var(--brand); background: var(--brand-soft); }
.disk-title strong,
.disk-title small,
.disk-amount strong,
.disk-amount span { display: block; }
.disk-title strong { font-size: 11px; }
.disk-title small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.disk-amount { text-align: right; }
.disk-amount strong { font-size: 11px; }
.disk-amount span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.network-map { position: relative; min-height: 430px; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: radial-gradient(circle at 50% 50%,var(--brand-soft),transparent 48%),var(--surface); box-shadow: var(--shadow-xs); }
.network-map::before,
.network-map::after { content: ""; position: absolute; inset: 50% auto auto 50%; border: 1px dashed rgba(37,99,235,.22); border-radius: 50%; transform: translate(-50%,-50%); }
.network-map::before { width: 280px; height: 280px; }
.network-map::after { width: 420px; height: 420px; }
.network-center { position: absolute; z-index: 3; left: 50%; top: 50%; display: grid; place-items: center; width: 82px; height: 82px; border: 8px solid var(--surface); border-radius: 24px; background: linear-gradient(135deg,var(--brand),var(--accent)); color: #fff; box-shadow: var(--shadow-md); transform: translate(-50%,-50%); }
.network-center .icon { width: 32px; height: 32px; }
.network-node { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; min-width: 180px; padding: 11px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.network-node > span { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; color: var(--brand); background: var(--brand-soft); }
.network-node strong,
.network-node small { display: block; }
.network-node strong { font-size: 10px; }
.network-node small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.network-node.n1 { left: 5%; top: 11%; }
.network-node.n2 { right: 5%; top: 11%; }
.network-node.n3 { left: 5%; bottom: 11%; }
.network-node.n4 { right: 5%; bottom: 11%; }

/* Settings */
.settings-nav { padding: 7px; }
.settings-nav > button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; color: var(--muted-strong); text-align: left; cursor: pointer; font-size: 11px; font-weight: 700; }
.settings-nav > button:hover { color: var(--text); background: var(--surface-soft); }
.settings-nav > button.is-active { color: var(--brand-strong); background: var(--brand-soft); }
.settings-nav > button > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-strong); color: var(--muted-strong); }
.settings-nav > button.is-active > span { color: var(--brand); background: color-mix(in srgb,var(--brand-soft) 68%,var(--surface)); }
.settings-nav > button .icon { width: 16px; }
.settings-content { display: grid; gap: 16px; }
.settings-content > div > .panel + .panel { margin-top: 16px; }
.schedule-grid { display: grid; gap: 0; }
.schedule-row { display: grid; grid-template-columns: 105px 105px 105px minmax(120px,1fr) auto; align-items: center; gap: 10px; min-height: 62px; border-bottom: 1px solid var(--border); }
.schedule-row:last-child { border-bottom: 0; }
.schedule-day { color: var(--text-soft); font-size: 10px; font-weight: 750; }
.schedule-row .input-control { min-height: 38px; }
.schedule-line { height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.schedule-line > span { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),var(--accent)); }

/* Responsive refinements for the actual page markup */
@media (max-width: 1520px) {
  .camera-admin-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .recording-row { grid-template-columns: 18px 92px minmax(180px,1fr) 82px 95px 78px 106px; gap: 9px; }
  .recording-thumb { width: 92px; height: 56px; }
  .event-row { grid-template-columns: 116px minmax(210px,1.2fr) 110px 145px 108px; gap: 11px; }
  .event-thumb { width: 116px; height: 68px; }
  .resource-gauges { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .gauge-ring { width: 92px; }
}

@media (max-width: 1260px) {
  body[data-page="login"] .login-page { grid-template-columns: minmax(410px,.8fr) minmax(480px,1.2fr); }
  .login-showcase-main { min-height: 480px; }
  .recordings-layout,
  .notifications-layout,
  .section-grid.main-aside,
  .health-hero { grid-template-columns: 1fr; }
  .recordings-layout > aside,
  .notifications-layout > aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
  .recordings-layout > aside .panel-header,
  .recordings-layout > aside .panel-footer { grid-column: 1 / -1; }
  .event-overview { grid-template-columns: 1fr; }
  .event-overview > article:last-child .event-type-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 18px; }
  .camera-admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .service-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .role-card-grid { grid-template-columns: 1fr; }
  .recording-row { grid-template-columns: 18px 90px minmax(180px,1fr) 82px 84px 100px; }
  .recording-size { display: none; }
  .event-row { grid-template-columns: 110px minmax(210px,1fr) 125px 100px; }
  .event-zone { display: none; }
}

@media (max-width: 1040px) {
  body[data-page="login"] .login-page { grid-template-columns: 1fr; }
  .login-panel { min-height: 100vh; align-items: center; text-align: left; }
  .login-side { display: none; }
  .login-logo { align-self: flex-start; }
  .login-copy,
  .login-form,
  .login-demo,
  body[data-page="login"] .login-footer { width: min(500px,100%); }
  .audit-stats,
  .section-grid.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; }
  .settings-nav > button { flex: 0 0 auto; width: auto; min-width: 145px; }
  .camera-form-layout { grid-template-columns: 1fr; }
  .camera-preview-card { position: static; }
  .camera-preview-card img { max-height: 330px; }
  .event-detail-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .filter-bar { align-items: stretch; }
  .filter-bar > .search-field,
  .filter-bar > .select-control,
  .date-field { flex: 1 1 calc(50% - 8px); max-width: none; min-width: 0; }
  .filter-bar-spacer { display: none; }
  .filter-summary { width: 100%; padding: 2px 4px 0; }
  .section-grid.two,
  .section-grid.three,
  .section-grid.four,
  .audit-stats { grid-template-columns: 1fr; }
  .camera-admin-grid { grid-template-columns: 1fr; }
  .camera-admin-grid.is-compact .managed-camera-card { display: block; }
  .recording-row { grid-template-columns: 18px 86px minmax(0,1fr) 92px; }
  .recording-thumb { width: 86px; height: 54px; }
  .recording-time,
  .recording-type,
  .recording-size { display: none; }
  .event-row { grid-template-columns: 96px minmax(0,1fr) 98px; }
  .event-thumb { width: 96px; height: 60px; }
  .event-camera,
  .event-zone { display: none; }
  .event-overview > article:last-child .event-type-list { grid-template-columns: 1fr; }
  .notification-page-item { grid-template-columns: 40px minmax(0,1fr); }
  .notification-page-actions { grid-column: 2; justify-content: flex-end; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .setting-control { width: 100%; min-width: 0; flex-basis: auto; }
  .schedule-row { grid-template-columns: 90px 1fr 1fr auto; padding: 8px 0; }
  .schedule-line { grid-column: 2 / 4; }
  .service-grid { grid-template-columns: 1fr; }
  .health-hero { display: grid; }
  .resource-gauges { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .profile-dropdown { right: -2px; }
  .login-panel { justify-content: flex-start; padding: 34px 22px 24px; }
  .login-logo { width: 218px; margin-bottom: 48px; }
  .login-copy h1 { font-size: 38px; }
  .login-options { align-items: flex-start; flex-direction: column; }
  .filter-bar > .search-field,
  .filter-bar > .select-control,
  .date-field { flex-basis: 100%; width: 100%; }
  .recording-row { grid-template-columns: 72px minmax(0,1fr) 76px; padding-inline: 10px; }
  .recording-check { display: none; }
  .recording-thumb { width: 72px; height: 46px; }
  .recording-actions .icon-button:nth-child(n+2) { display: none; }
  .timeline-labels span:nth-child(even) { display: none; }
  .timeline-legend span:last-child { width: 100%; margin-left: 0; }
  .event-row { grid-template-columns: 82px minmax(0,1fr); align-items: start; }
  .event-thumb { width: 82px; height: 54px; }
  .event-actions { grid-column: 2; justify-content: flex-start; }
  .discovery-banner { grid-template-columns: 42px minmax(0,1fr); }
  .discovery-banner .primary-button { grid-column: 1 / -1; }
  .camera-spec-grid { grid-template-columns: 1fr; }
  .managed-camera-footer { flex-wrap: wrap; }
  .managed-camera-footer .button-row { flex: 1; justify-content: flex-end; }
  .camera-form-layout .field-row { grid-template-columns: 1fr; }
  .notifications-layout > aside,
  .recordings-layout > aside { display: grid; grid-template-columns: 1fr; }
  .role-card-grid { grid-template-columns: 1fr; }
  .audit-stats { grid-template-columns: 1fr; }
  .system-health-card { padding: 22px; }
  .system-health-card h2 { font-size: 27px; }
  .resource-gauges { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .network-node { min-width: 130px; padding: 8px; }
  .network-node.n1,
  .network-node.n3 { left: 2%; }
  .network-node.n2,
  .network-node.n4 { right: 2%; }
  .schedule-row { grid-template-columns: 1fr 1fr auto; }
  .schedule-day { grid-column: 1 / -1; }
  .schedule-line { grid-column: 1 / 3; }
  .app-dialog-body { padding: 15px; }
  .app-dialog-header,
  .app-dialog-footer { padding-inline: 15px; }
}

/* Real app integration */
body {
  background: var(--bg);
}

.ambient,
.ambient-one,
.ambient-two {
  display: none !important;
}

button.brand,
button.nav-item,
button.user-card,
button.login-link {
  appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

button.brand {
  border: 0;
  background: transparent;
  padding: 0;
}

.app-view {
  display: none;
}

.app-view.is-active {
  display: block;
}

.form-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-link {
  border: 0;
  background: transparent;
  padding: 0;
}

.camera-media iframe,
.stream-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050b14;
}

.dialog-video .stream-frame {
  position: absolute;
}

.live-player-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050b14;
  touch-action: none;
}

.live-player-stage.is-zoomed {
  cursor: grab;
}

.live-player-stage.is-zoomed:active {
  cursor: grabbing;
}

.stream-frame.live-transform {
  transform-origin: center;
  transition: transform .12s ease;
  will-change: transform;
}

.live-zoom-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 14px;
  display: grid;
  grid-template-columns: 42px minmax(120px, 240px) repeat(3, 42px);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(8,16,27,.68);
  box-shadow: 0 16px 40px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
  transform: translateX(-50%);
}

.live-zoom-controls .round-control {
  width: 42px;
  height: 42px;
  color: #dce8ff;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
}

.live-zoom-controls .round-control:hover {
  background: rgba(255,255,255,.14);
}

.camera-card .camera-media > img {
  background: #07101d;
}

.camera-menu-popover a,
.camera-menu-popover button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  font-size: 12px;
}

.camera-menu-popover a:hover,
.camera-menu-popover button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.topbar-profile {
  border: 1px solid var(--border);
}

.recording-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.recording-timeline-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow-xs);
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.timeline-head strong {
  display: block;
  font-size: 15px;
}

.timeline-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timeline-motion-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--warning) 32%, var(--border));
  border-radius: 999px;
  background: var(--warning-soft);
  color: color-mix(in srgb, var(--warning) 58%, var(--text));
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.timeline-motion-chip .icon {
  width: 15px;
  height: 15px;
}

.timeline-camera {
  min-width: 170px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
}

.timeline-zoom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
}

.timeline-window-tabs,
.timeline-pan-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.timeline-window-tabs button,
.timeline-pan-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.timeline-window-tabs button.is-active {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--border));
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.timeline-pan-controls button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.timeline-pan-controls .icon {
  width: 15px;
  height: 15px;
}

.timeline-player {
  overflow: hidden;
  border-radius: 10px;
  background: #050b14;
}

.recording-player.inline {
  height: min(48vh, 430px);
  min-height: 240px;
}

.timeline-controls {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 148px 126px;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.timeline-controls > span {
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 900;
}

.timeline-range {
  width: 100%;
  accent-color: var(--brand);
}

.timeline-open {
  height: 38px;
  min-height: 0;
}

.timeline-map {
  position: relative;
  margin-top: 12px;
  padding-top: 16px;
}

.timeline-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.timeline-dot {
  flex: 1 0 12px;
  max-width: 30px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 22%, var(--border));
  cursor: pointer;
}

.timeline-dot.is-loaded {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--text) 34%, transparent);
}

.timeline-dot.is-active {
  background: var(--brand);
}

.timeline-event-layer {
  position: absolute;
  inset: 0 0 auto;
  height: 16px;
  pointer-events: none;
}

.timeline-event-marker {
  position: absolute;
  top: 1px;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 5px 14px rgba(245, 158, 11, .28);
  cursor: pointer;
  pointer-events: auto;
  transform: translateX(-50%);
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

.timeline-event-marker:hover {
  transform: translateX(-50%) scale(1.35);
  box-shadow: 0 8px 20px rgba(245, 158, 11, .36);
}

.timeline-event-marker.is-pending {
  background: var(--muted);
  box-shadow: none;
  opacity: .72;
}

.timeline-legend-pro {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.timeline-legend-pro span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.timeline-legend-pro i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

.timeline-legend-pro i.motion {
  background: var(--warning);
}

.timeline-legend-pro i.pending {
  background: var(--muted);
}

.system-status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .42fr);
  gap: 14px;
  margin-bottom: 16px;
}

.system-status-card,
.system-mail-card,
.system-health-row {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.system-status-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 124px;
  padding: 22px;
  border-radius: 18px;
}

.system-status-card.is-ok { border-color: rgba(25,165,90,.2); background: linear-gradient(135deg,var(--surface),var(--success-soft)); }
.system-status-card.is-warning { border-color: rgba(245,158,11,.32); background: linear-gradient(135deg,var(--surface),var(--warning-soft)); }
.system-status-card strong { display: block; margin: 7px 0 4px; font-size: 24px; letter-spacing: 0; }
.system-status-card span { color: var(--muted-strong); font-size: 12px; font-weight: 700; }
.status-kicker { color: var(--brand-strong) !important; text-transform: uppercase; font-size: 9px !important; letter-spacing: .12em; }

.disk-meter {
  display: grid;
  place-items: center;
  width: 112px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.disk-meter b { font-size: 25px; }
.disk-meter span { font-size: 9px; }
.system-health-list { display: grid; gap: 8px; }
.system-health-row { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 12px; border-radius: 14px; }
.system-health-row > span { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; color: var(--success); background: var(--success-soft); }
.system-health-row.is-warning > span { color: var(--warning); background: var(--warning-soft); }
.system-health-row strong,
.system-health-row small { display: block; }
.system-health-row strong { font-size: 12px; }
.system-health-row small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 650; }
.system-mail-card { min-height: 118px; padding: 18px; border-radius: 16px; }
.system-mail-card strong,
.system-mail-card span { display: block; }
.system-mail-card strong { font-size: 14px; }
.system-mail-card span { margin-top: 8px; color: var(--muted-strong); font-size: 11px; line-height: 1.5; }
.system-mail-card.is-ok { border-color: rgba(25,165,90,.2); }
.system-mail-card.is-muted { border-style: dashed; }

.system-settings-panel {
  margin-bottom: 16px;
}

.production-settings-form {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 12px;
  align-items: start;
}

.settings-panel-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.settings-wide {
  grid-row: span 2;
}

.settings-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-card-head.compact {
  align-items: flex-start;
}

.settings-card-head strong,
.settings-card-head span {
  display: block;
}

.settings-card-head strong {
  font-size: 15px;
}

.settings-card-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.settings-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-fields-grid.compact {
  grid-template-columns: 1fr;
}

.settings-fields-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 850;
}

.settings-fields-grid input {
  width: 100%;
  min-height: 39px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
}

.settings-fields-grid input[type="range"] {
  padding: 0;
  accent-color: var(--brand);
}

.settings-fields-grid small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 850;
}

.toggle-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.production-settings-form.is-readonly input {
  opacity: .72;
}

.events-feed {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.events-control-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.events-control-bar strong,
.events-control-bar span {
  display: block;
}

.events-control-bar strong {
  font-size: 15px;
}

.events-control-bar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.events-camera-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text-soft);
}

.events-camera-filter .icon {
  width: 16px;
  height: 16px;
}

.events-camera-filter select {
  min-width: 170px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 850;
  outline: 0;
}

.event-motion-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.event-motion-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.event-motion-card img,
.event-clip-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #050b14;
}

.event-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 12px;
}

.event-mini-button,
.event-segment-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--border));
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.event-segment-button {
  background: var(--surface-soft);
  color: var(--text-soft);
}

.event-mini-button .icon,
.event-segment-button .icon {
  width: 15px;
  height: 15px;
}

.event-motion-card > div {
  padding: 12px;
}

.event-motion-card strong,
.event-motion-card p {
  display: block;
}

.event-motion-card strong {
  margin-top: 8px;
  font-size: 13px;
}

.event-motion-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.event-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-strong);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.event-type .icon {
  width: 14px;
}

.event-score {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 12px 12px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 10px;
  font-weight: 900;
}

.event-score .icon {
  width: 13px;
  height: 13px;
}

.event-motion-card.is-pending {
  border-style: dashed;
}

.event-motion-card.is-pending img {
  filter: saturate(.72);
}

.events-more-button {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 4px;
}

.timeline-dot.is-active {
  flex-basis: 34px;
  max-width: 44px;
  background: var(--brand);
}

.recording-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 120px 140px 120px 94px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.recording-main {
  min-width: 0;
}

.recording-main strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.recording-main p {
  margin: 3px 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.recording-meta {
  color: var(--muted);
  font-size: 10px;
}

.recording-meta strong {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
}

.recording-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}

.recording-actions .icon-button {
  width: 38px;
  height: 38px;
}

.player-screen {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  background: #050b14;
}

.pro-player-stage {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background: #050b14;
  touch-action: none;
}

.recording-player {
  display: block;
  width: 100%;
  height: min(68vh, 620px);
  min-height: 360px;
  background: #050b14;
}

.recording-player.pro {
  transform-origin: center;
  transition: transform .12s ease, object-fit .12s ease;
  will-change: transform;
}

.pro-player-stage.is-zoomed {
  cursor: grab;
}

.pro-player-stage.is-zoomed:active {
  cursor: grabbing;
}

.player-zoom-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(8,16,27,.62);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.pro-player-controls {
  display: grid;
  grid-template-columns: repeat(2, 42px) 42px minmax(140px, 1fr) repeat(4, 42px);
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: #08111f;
}

.pro-player-controls .round-control {
  width: 42px;
  height: 42px;
  color: #dce8ff;
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
}

.pro-player-controls .round-control:hover {
  background: rgba(255,255,255,.14);
}

.player-zoom-range {
  width: 100%;
  accent-color: #74a7ff;
}

.event-position-card {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, #08111f, #0d1b30);
}

.event-position-head,
.event-position-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.event-position-head > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.event-position-head .icon {
  width: 16px;
  height: 16px;
  color: #ffbf4c;
}

.event-jump-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255,191,76,.32);
  border-radius: 8px;
  background: rgba(255,191,76,.13);
  color: #ffd994;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.event-jump-button .icon {
  width: 15px;
  height: 15px;
}

.event-position-track {
  position: relative;
  height: 12px;
  margin: 13px 0 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(116,167,255,.34), rgba(116,167,255,.13));
}

.event-position-marker {
  position: absolute;
  top: 50%;
  left: var(--event-left, 50%);
  width: 18px;
  height: 18px;
  border: 3px solid #08111f;
  border-radius: 999px;
  background: #ffbf4c;
  box-shadow: 0 0 0 4px rgba(255,191,76,.18);
  transform: translate(-50%, -50%);
}

.event-position-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 2px;
  height: 16px;
  background: #ffbf4c;
  transform: translateX(-50%);
}

.event-position-caption {
  color: rgba(220,232,255,.58);
  font-size: 10px;
  font-weight: 800;
}

.event-position-caption strong {
  color: #ffd994;
}

.player-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.player-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  background: rgba(8, 16, 27, .58);
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  backdrop-filter: blur(8px);
}

.loader.muted {
  border-color: color-mix(in srgb, var(--muted) 24%, transparent);
  border-top-color: var(--brand);
}

@media (max-width: 980px) {
  .recording-row {
    grid-template-columns: 92px minmax(0, 1fr) 92px;
  }

  .recording-type,
  .recording-time,
  .recording-size {
    display: none;
  }
}

@media (max-width: 620px) {
  .recording-row {
    grid-template-columns: 72px minmax(0, 1fr) 76px;
  }

  .player-screen,
  .recording-player {
    min-height: 260px;
  }
}
