:root {
  color-scheme: light;
  --bg: #f3f6fa;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f7f9fc;
  --border: #dce4ed;
  --border-strong: #bdc9d7;
  --text: #17283b;
  --muted: #536579;
  --accent: #087f70;
  --accent-strong: #06695d;
  --accent-dim: #e2f4f0;
  --danger: #b42335;
  --danger-strong: #921b2b;
  --danger-dim: #fff0f1;
  --ok: #087f70;
  --ok-dim: #e2f4f0;
  --warn: #9a5c00;
  --warn-dim: #fff4dc;
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(18, 38, 58, 0.06);
  --shadow-md: 0 12px 30px rgba(18, 38, 58, 0.12);
  --shadow-lg: 0 24px 64px rgba(8, 24, 40, 0.25);
  --transition: 200ms ease;
}

html { min-width: 320px; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #2bb4a0;
  outline-offset: 3px;
}

.topbar {
  min-height: 76px;
  padding: 12px clamp(18px, 2.5vw, 40px);
  gap: 20px;
  color: #f5f8fc;
  background: #13283d;
  border: 0;
  box-shadow: 0 4px 18px rgba(13, 30, 47, 0.16);
}
.topbar h1 {
  color: #fff;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  white-space: nowrap;
}
.topbar-logo { width: 30px; height: 30px; }
.topbar-nav { gap: 4px; }
.topbar-nav a, .topbar-nav a:visited {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #c5d2df;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 9px;
}
.topbar-nav a:hover, .topbar-nav a[aria-current="page"] {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}
.nav-divider { height: 22px; background: rgba(255, 255, 255, 0.2); }
.nav-identity { gap: 10px; }
.who-am-i { color: #d5e0ea; font-size: 0.86rem; }
.topbar .btn-dismiss {
  min-height: 44px;
  color: #f5f8fc;
  background: rgba(255, 255, 255, 0.1);
}
.topbar .btn-dismiss:hover { background: rgba(255, 255, 255, 0.18); }

.layout, .users-layout, .evidence-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 2.5vw, 40px);
  gap: clamp(16px, 1.6vw, 26px);
}
.layout {
  grid-template-columns: minmax(0, 1.8fr) minmax(330px, 0.85fr);
  align-items: start;
}
.layout > .page-intro { grid-column: 1 / -1; }
.page-intro {
  min-height: 148px;
  padding: clamp(22px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background:
    radial-gradient(700px circle at 90% 15%, rgba(26, 160, 139, 0.26), transparent 58%),
    linear-gradient(112deg, #16314a, #1d4058);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}
.page-intro .eyebrow { color: #91d6c9; }
.page-intro h2 {
  margin: 2px 0 4px;
  color: #fff;
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.18;
  letter-spacing: -0.035em;
}
.page-intro p:not(.eyebrow) { margin: 0; color: #d0dce7; }
.page-intro-status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.system-status {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  color: #eaf1f7;
  background: rgba(5, 18, 30, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  font-size: 0.83rem;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #d19a3b;
  box-shadow: 0 0 0 3px rgba(209, 154, 59, 0.14);
}
.system-status.is-online .status-dot, .service-state.is-running .status-dot {
  background: #35bd96;
  box-shadow: 0 0 0 3px rgba(53, 189, 150, 0.16);
}
.system-status.is-offline .status-dot, .service-state.is-stopped .status-dot {
  background: #ef6c75;
  box-shadow: 0 0 0 3px rgba(239, 108, 117, 0.17);
}
.conn-status {
  padding: 0;
  color: #d4e0ea;
  background: transparent;
  font-size: inherit;
}
.conn-status::before { display: none; }
.conn-status.online { color: #8de0c2; }
.conn-status.offline { color: #ffabb0; }
.conn-status.starting { color: #f7d084; }

.sidebar { gap: clamp(16px, 1.6vw, 26px); }
.panel {
  min-width: 0;
  padding: clamp(18px, 1.8vw, 26px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}
.panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  text-transform: none;
}
.panel-header { margin-bottom: 18px; }
.panel-header > div { min-width: 0; }
.panel-header .eyebrow { margin-bottom: 3px; }
.eyebrow {
  margin: 0;
  color: #5e7388;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  line-height: 1.4;
}
.panel-count {
  min-width: 36px;
  height: 36px;
  color: #30465b;
  background: #edf2f7;
  font-size: 0.9rem;
}
.panel-count.has-pending { background: var(--danger); }
.alert-list { gap: 12px; }
.alert-list:empty::after {
  padding: 24px 14px;
  color: #65778a;
  background: #f8fafc;
  border: 1px dashed #cbd6e1;
  border-radius: 11px;
  text-align: center;
}
.alert-card {
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  padding: 13px;
  border-color: #e3e9ef;
  border-radius: 12px;
  box-shadow: none;
}
.alert-card:hover { border-color: #9bb9c7; box-shadow: var(--shadow-sm); }
.alert-card img {
  width: 132px;
  height: 104px;
  border-radius: 8px;
  background: #dce4ec;
}
.alert-card .meta { gap: 4px; }
.alert-card .device { color: #20374d; font-size: 0.97rem; }
.alert-card .room, .alert-card .time { color: #526579; }
.alert-card .count { color: #805100; }
.status-pill { padding: 4px 9px; font-size: 0.68rem; }
.alert-card .actions { gap: 8px; }

button, .btn-link {
  min-height: 44px;
  border-radius: 9px;
  font-weight: 650;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
button:hover { filter: none; box-shadow: 0 3px 10px rgba(18, 38, 58, 0.12); }
.btn-dismiss, .btn-link {
  color: #23384d;
  background: #edf2f7;
  border: 1px solid #dfe6ee;
}
.btn-dismiss:hover, .btn-link:hover { color: #152b40; background: #e3eaf1; }
.btn-confirm, .btn-danger { background: var(--danger); }
.btn-confirm:hover, .btn-danger:hover { background: var(--danger-strong); }
.btn-message { background: var(--accent); }
.btn-message:hover { background: var(--accent-strong); }

.live-camera-list { gap: 9px; }
.live-camera-row {
  min-height: 62px;
  padding: 9px 11px;
  border: 1px solid #e3e9ef;
  border-radius: 10px;
  background: #f8fafc;
}
.live-camera-row .room { color: #21384e; }
.live-camera-row .device { font-size: 0.82rem; }
.history .alert-card { grid-template-columns: 72px minmax(0, 1fr); padding: 10px; }
.history .alert-card img { width: 72px; height: 68px; }
.history .alert-card .actions { grid-column: 1 / -1; }
.history .alert-list { max-height: 56vh; }

.settings-layout {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 2.5vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 1.6vw, 26px);
}
.settings-intro, .validator-panel, .settings-layout > #settingsSaved { grid-column: 1 / -1; }
.settings-intro {
  padding: 16px 20px;
  color: #40556a;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  font-size: 0.92rem;
}
.validator-panel {
  padding: clamp(20px, 2vw, 30px);
  color: #f1f6fa;
  background:
    radial-gradient(700px circle at 95% 0%, rgba(21, 137, 119, 0.18), transparent 48%),
    #172e43;
  border: 1px solid #203e57;
  box-shadow: 0 10px 24px rgba(16, 38, 57, 0.16);
}
.validator-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.validator-panel .eyebrow { color: #81cfc0; }
.validator-panel h2 { margin: 4px 0 7px; color: #fff; font-size: 1.35rem; }
.validator-description { max-width: 760px; margin: 0; color: #c4d2de; }
.service-state {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 8px 12px;
  color: #e4ecf3;
  background: rgba(4, 17, 29, 0.32);
  border: 1px solid rgba(225, 238, 248, 0.16);
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
}
.service-state.is-running { color: #a4e5cf; }
.service-state.is-stopped { color: #ffb1b8; }
.service-state.is-starting { color: #f7d48e; }
.validator-facts {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.validator-facts > div {
  min-width: 0;
  padding: 12px 14px;
  background: rgba(4, 17, 29, 0.3);
  border: 1px solid rgba(225, 238, 248, 0.12);
  border-radius: 10px;
}
.validator-facts span {
  display: block;
  margin-bottom: 3px;
  color: #b5c5d2;
  font-size: 0.77rem;
}
.validator-facts strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 650;
}
.validator-config { max-width: 820px; }
.validator-config > label {
  display: block;
  margin-bottom: 7px;
  color: #f0f5f9;
  font-size: 0.88rem;
  font-weight: 650;
}
.validator-config-row { display: flex; gap: 9px; }
.validator-config input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  color: #14283b;
  background: #fff;
  border: 1px solid #bdcbd7;
  border-radius: 9px;
}
.validator-config button { flex: none; }
.field-help {
  margin: 8px 0 0;
  color: #bac9d6;
  font-size: 0.84rem;
}
.field-help code {
  padding: 2px 5px;
  color: #ecf4f9;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 5px;
}
.validator-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.validator-actions #validatorStartBtn { color: #fff; background: #087f70; border: 1px solid #159887; }
.validator-actions #validatorStartBtn:hover { background: #06695d; }
.validator-actions #validatorStopBtn { color: #fff; background: #9b2938; border: 1px solid #bd3b4b; }
.validator-actions #validatorStopBtn:hover { background: #7d1d2b; }
.validator-actions #validatorRefreshBtn { color: #edf4f8; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); }
.validator-panel .auth-error { margin: 10px 0 0; color: #ffb1b8; text-align: left; }
.validator-log-details { margin-top: 15px; color: #d6e1e9; }
.validator-log-details summary { width: fit-content; cursor: pointer; font-size: 0.84rem; }
.validator-log-details pre {
  max-height: 220px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  color: #d6e1e9;
  background: rgba(3, 14, 24, 0.65);
  border-radius: 9px;
  font: 0.78rem/1.5 Consolas, "SFMono-Regular", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.channel-panel { align-items: flex-start; }
.channel-panel h2 { color: var(--text); font-size: 1.02rem; }
.channel-panel p { margin: 0; text-align: left; font-size: 0.88rem; }
.settings-layout .panel > .auth-hint { text-align: left; font-size: 0.88rem; }
.settings-layout > .panel > h2 { margin-bottom: 14px; }
.settings-layout .user-form label, .settings-layout .template-field { color: #3e5267; font-size: 0.9rem; font-weight: 600; }
.settings-layout input:not([type="checkbox"]):not([type="file"]), .settings-layout select, .settings-layout textarea {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd6e1;
  border-radius: 9px;
}
.settings-layout textarea { min-height: 96px; }
.settings-layout input:focus, .settings-layout select:focus, .settings-layout textarea:focus {
  border-color: #158b7b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 127, 112, 0.15);
}
.settings-layout .numbers-list li { padding: 11px 13px; background: #f5f8fb; border: 1px solid #e5ebf1; }
.settings-layout .numbers-list button { min-height: 44px; }
.settings-layout #templatePreview { margin: 12px 0 0; text-align: left; }
.settings-layout #numbersError, .settings-layout #alarmError { text-align: left; }
.alarm-preview { max-width: 100%; }
.alarm-file-input { min-width: 0; }

.users-layout { grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.8fr); }
.evidence-layout { grid-template-columns: minmax(260px, 0.55fr) minmax(0, 2fr); }
.users-layout .panel, .evidence-layout .panel { min-width: 0; }
.users-table { font-size: 0.9rem; border-radius: 10px; }
.users-table th { padding: 12px; font-size: 0.74rem; background: #f2f6f9; }
.users-table td { padding: 12px; }
.user-form { gap: 14px; }
.user-form label { color: #3e5267; font-size: 0.9rem; font-weight: 600; }
.user-form input, .user-form select, .users-table input, .users-table select {
  min-height: 42px;
  padding: 9px 11px;
  border-color: #cbd6e1;
  border-radius: 9px;
}
.evidence-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.evidence-tile { box-shadow: none; }
.evidence-tile:hover { transform: translateY(-2px); }
.bulk-action-bar { padding: 12px; border: 1px solid #e1e8ef; border-radius: 10px; }
.auth-hint { color: #526579; font-size: 0.86rem; line-height: 1.55; }

.auth-card .auth-hint { margin: 0; }

.modal-overlay { background: rgba(9, 22, 35, 0.72); }
.confirm-modal-panel { border-radius: 16px; }
.toast-container { top: 18px; right: 18px; }
.toast-card { border-radius: 14px; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr); }
  .topbar { align-items: flex-start; }
  .topbar-nav { justify-content: flex-end; }
  .nav-identity { padding-left: 0; }
}

@media (max-width: 760px) {
  .topbar { position: relative; flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar-nav { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding: 2px 0 6px; }
  .topbar-nav a { flex: none; }
  .nav-identity { flex: none; margin-left: 6px; }
  .layout, .users-layout, .evidence-layout, .settings-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .layout > .page-intro, .settings-intro, .validator-panel, .settings-layout > #settingsSaved { grid-column: auto; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-intro-status { justify-content: flex-start; }
  .validator-heading { flex-direction: column; }
  .validator-facts { grid-template-columns: 1fr; }
  .validator-config-row { align-items: stretch; flex-direction: column; }
  .validator-config button { width: 100%; }
  .evidence-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .topbar { padding: 12px 15px; }
  .topbar h1 { white-space: normal; }
  .nav-identity { margin-left: 0; }
  .who-am-i { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-intro-status { align-items: stretch; flex-direction: column; width: 100%; }
  .system-status { justify-content: space-between; }
  .alert-card { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 10px; }
  .alert-card img { width: 84px; height: 78px; }
  .history .alert-card { grid-template-columns: 62px minmax(0, 1fr); }
  .history .alert-card img { width: 62px; height: 62px; }
  .alert-card .actions button { flex: 1 1 45%; }
  .settings-layout .add-number-form { flex-direction: column; align-items: stretch; }
  .settings-layout .add-number-form label, .settings-layout .add-number-form button { width: 100%; }
  .users-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Stable desktop shell: the navigation is rendered once from shared.js on
   every authenticated page, so page changes never move or reorder menus. */
#appSidebar.topbar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
  width: 258px;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 0;
  padding: 18px 13px 12px;
  color: #23384d;
  background: #f7f8fa;
  border: 0;
  border-right: 1px solid #d5dde5;
  border-radius: 0;
  box-shadow: 2px 0 10px rgba(17, 35, 53, 0.045);
  backdrop-filter: none;
}
.brand-row {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 17px;
  border-bottom: 1px solid #dfe5eb;
}
.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #17314a;
  text-decoration: none;
}
.brand-lockup:visited { color: #17314a; }
.brand-lockup .topbar-logo { width: 36px; height: 36px; }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup strong { font-size: 1.03rem; font-weight: 800; letter-spacing: 0.07em; line-height: 1.2; }
.brand-lockup small { margin-top: 3px; color: #65788a; font-size: 0.62rem; font-weight: 750; letter-spacing: 0.12em; }
.nav-toggle { display: none; }
.topbar-nav#appNavigation {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex-wrap: nowrap;
  gap: 26px;
  overflow: auto;
  padding: 25px 1px 8px;
}
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-group-title {
  margin: 0 10px 7px;
  color: #66788a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.topbar-nav#appNavigation a,
.topbar-nav#appNavigation a:visited {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 9px 10px 9px 13px;
  color: #354b5f;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}
.topbar-nav#appNavigation a svg {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.topbar-nav#appNavigation a:hover {
  color: #173d5c;
  background: #edf1f5;
  border-color: #e2e8ee;
}
.topbar-nav#appNavigation a[aria-current="page"] {
  color: #125f58;
  background: #e3f2ef;
  border-color: #d3e8e3;
  box-shadow: inset 3px 0 #087f70;
  font-weight: 750;
}
.topbar-nav#appNavigation a.restricted { color: #788695; }
.topbar-nav#appNavigation a.restricted:hover { color: #6a7886; background: #f0f2f4; }
.topbar-nav#appNavigation a.restricted::after {
  content: "Admin";
  margin-left: auto;
  padding: 3px 6px;
  color: #657588;
  background: #e9edf1;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.topbar-nav#appNavigation .nav-badge {
  position: static;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 5px;
  border: 0;
  font-size: 0.7rem;
}
.topbar-nav#appNavigation .nav-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 9px;
  margin: auto 0 0;
  padding: 15px 3px 2px;
  border-top: 1px solid #dfe5eb;
}
.topbar-nav#appNavigation .who-am-i {
  overflow: hidden;
  color: #31475b;
  font-size: 0.83rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-nav#appNavigation .btn-dismiss {
  width: 100%;
  min-height: 44px;
  color: #344a5f;
  background: #fff;
  border: 1px solid #d5dde5;
  border-radius: 7px;
  text-align: left;
}
.topbar-nav#appNavigation .btn-dismiss:hover { color: #142a3e; background: #edf1f5; }

.layout, .users-layout, .evidence-layout, .settings-layout {
  width: calc(100% - 258px);
  max-width: none;
  margin: 0 0 0 258px;
  padding: 27px clamp(22px, 2.7vw, 42px) 42px;
}
.page-heading {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px 20px;
  border-bottom: 1px solid #d7e0e8;
}
.page-heading .eyebrow { margin-bottom: 5px; }
.page-heading h1, .page-intro h1 {
  margin: 0;
  color: #172e43;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.25;
}
.page-heading > div > p:last-child {
  margin: 5px 0 0;
  color: #576b7e;
  font-size: 0.92rem;
}
.page-intro {
  min-height: 0;
  padding: 0 2px 20px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d7e0e8;
  border-radius: 0;
  box-shadow: none;
}
.page-intro .eyebrow { color: #66788a; }
.page-intro h1 { font-size: clamp(1.45rem, 2.2vw, 1.85rem); }
.page-intro p:not(.eyebrow) { color: #576b7e; font-size: 0.92rem; }
.page-intro-status { gap: 8px; }
.system-status {
  min-height: 38px;
  color: #354c60;
  background: #fff;
  border-color: #d8e1e9;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(17, 35, 53, 0.04);
}
.system-status.is-online { border-color: #cde5dd; }
.system-status.is-offline { border-color: #efd2d5; }
.conn-status { color: #526779; }

@media (max-width: 760px) {
  #appSidebar.topbar {
    inset: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 66px;
    padding: 9px 14px;
    flex-direction: column;
    border-right: 0;
    border-bottom: 1px solid #d5dde5;
    box-shadow: 0 3px 12px rgba(17, 35, 53, 0.09);
  }
  .brand-row { min-height: 46px; padding: 0 2px; border-bottom: 0; }
  .brand-lockup .topbar-logo { width: 32px; height: 32px; }
  .brand-lockup { gap: 8px; }
  .brand-lockup strong { font-size: 0.95rem; }
  .brand-lockup small { font-size: 0.57rem; }
  .nav-toggle {
    width: 44px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    background: #fff;
    border: 1px solid #d6dfe7;
    border-radius: 7px;
  }
  .nav-toggle span { width: 18px; height: 2px; background: #344b60; border-radius: 2px; }
  .topbar-nav#appNavigation { display: none; }
  .nav-open #appSidebar.topbar { height: min(100dvh, 100vh); }
  .nav-open .topbar-nav#appNavigation { display: flex; gap: 18px; }
  .nav-open::before {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 30, 45, 0.42);
    content: "";
  }
  .layout, .users-layout, .evidence-layout, .settings-layout {
    width: 100%;
    margin: 0;
    padding: 82px 16px 28px;
  }
}

@media (max-width: 480px) {
  .layout, .users-layout, .evidence-layout, .settings-layout { padding: 80px 13px 22px; }
  .page-heading, .page-intro { align-items: flex-start; flex-direction: column; }
  .page-intro-status { width: 100%; }
}
