:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #eef3f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #101828;
  --muted: #667085;
  --line: #dde7f0;
  --line-strong: #c3d2df;
  --navy: #12334f;
  --navy-deep: #0b243b;
  --blue: #2d73c4;
  --teal: #0d8b88;
  --amber: #a86612;
  --red: #bd3a2f;
  --green: #147a4b;
  --soft-blue: #eaf4ff;
  --soft-green: #e8f7ef;
  --soft-amber: #fff5dd;
  --soft-red: #fdecea;
  --shadow: 0 26px 70px rgba(16, 24, 40, 0.12);
  --shadow-soft: 0 12px 34px rgba(16, 24, 40, 0.075);
  --shadow-lift: 0 18px 48px rgba(18, 52, 77, 0.14);
  --ring: 0 0 0 3px rgba(33, 103, 174, 0.14);
}

.hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 24% -18%, rgba(45, 115, 196, 0.18), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(13, 139, 136, 0.13), transparent 34%),
    linear-gradient(180deg, #f5f8fb 0, var(--bg) 320px, #edf2f6 100%);
  color: var(--ink);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(18, 52, 77, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 52, 77, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0.55) 420px, transparent 760px);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 42px;
  padding: 0 16px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 24px rgba(45, 115, 196, 0.16);
  transform: translateY(-1px);
}

button:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

button:active {
  transform: translateY(0);
}

button.active,
form button[type="submit"] {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  border-color: var(--navy);
  color: #fff;
}

form button[type="submit"]:hover,
button.active:hover {
  background: #0f2d42;
}

.danger {
  color: var(--red);
}

.admin-only {
  display: none;
}

body.admin-user .admin-only {
  display: inline-flex;
}

.app-shell {
  width: min(1420px, 100%);
  margin: 0 auto;
  padding: 28px 30px 46px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(285px, 0.42fr) minmax(660px, 1fr);
  align-items: stretch;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.brand-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 150px;
  padding: 8px 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: hidden;
}

.brand-mark {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.brand-hero::before {
  display: none;
}

.brand-hero::after {
  display: none;
}

.brand-logo {
  position: relative;
  z-index: 1;
  width: 114px;
  height: 114px;
  object-fit: contain;
  filter: drop-shadow(0 16px 22px rgba(18, 52, 77, 0.18));
  transform-origin: center;
  animation: logoHeartbeat 2.8s ease-in-out infinite;
}

.eyebrow,
h2,
h3,
p {
  margin: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #047f7d;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: center;
}

.brand-subtitle {
  display: none;
}

.eyebrow::before {
  display: none;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 15px;
}

@keyframes logoHeartbeat {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 16px 22px rgba(18, 52, 77, 0.18));
  }
  14% {
    transform: scale(1.045);
    filter: drop-shadow(0 18px 26px rgba(18, 52, 77, 0.22)) drop-shadow(0 0 18px rgba(15, 143, 146, 0.18));
  }
  24% {
    transform: scale(1);
    filter: drop-shadow(0 16px 22px rgba(18, 52, 77, 0.18));
  }
  36% {
    transform: scale(1.03);
    filter: drop-shadow(0 18px 25px rgba(18, 52, 77, 0.22)) drop-shadow(0 0 14px rgba(15, 143, 146, 0.14));
  }
  52% {
    transform: scale(1);
    filter: drop-shadow(0 16px 22px rgba(18, 52, 77, 0.18));
  }
}

.top-actions,
.tabs,
.quick-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.top-actions {
  position: relative;
  z-index: 40;
  min-height: 150px;
  padding: 18px 20px;
  border: 1px solid rgba(205, 219, 232, 0.98);
  border-radius: 26px;
  background:
    radial-gradient(circle at 96% 6%, rgba(34, 150, 160, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 254, 0.92));
  box-shadow: 0 24px 56px rgba(18, 52, 77, 0.13);
  backdrop-filter: blur(16px);
  align-items: flex-end;
}

.top-actions label {
  min-width: 0;
}

.report-panel-title {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 2px 2px 13px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.82);
}

.report-panel-title::before {
  content: "";
  grid-row: 1 / 3;
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(20, 61, 89, 0.95), rgba(18, 129, 134, 0.95)),
    url("assets/oz-security-logo.png") center / 72% no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 10px 22px rgba(18, 52, 77, 0.18);
}

.report-panel-title strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1.15;
}

.report-panel-title span {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

.connection-panel {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.auth-card-brand {
  display: none;
}

body:not(.auth-locked) .connection-panel {
  padding: 12px 14px;
}

body.auth-locked .connection-panel {
  margin: 46px auto 14px;
  max-width: 1120px;
  padding: 18px;
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
  grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1fr);
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.92));
}

body.auth-locked .top-actions,
body.auth-locked .tabs,
body.auth-locked .status-grid,
body.auth-locked .workspace {
  display: none !important;
}

body.visitor-mode .top-actions,
body.visitor-mode .status-grid,
body.visitor-mode .connection-panel,
body.visitor-mode .tabs,
body.visitor-mode #overview,
body.visitor-mode #incidents,
body.visitor-mode #occurrences,
body.visitor-mode #maintenance,
body.visitor-mode #patrols,
body.visitor-mode #parcels,
body.visitor-mode #roster,
body.visitor-mode #ai,
body.visitor-mode #settings,
body.visitor-mode #audit,
body.visitor-mode #admin,
body.visitor-mode .visitor-log-panel,
body.visitor-mode .qr-panel,
body.visitor-mode #visitorList {
  display: none !important;
}

body.visitor-mode .workspace,
body.visitor-mode #visitors,
body.visitor-mode .visitor-layout,
body.visitor-mode .visitor-left-column,
body.visitor-mode #visitors .panel:first-child {
  display: block;
}

body.visitor-mode .visitor-layout {
  max-width: 760px;
  margin: 0 auto;
}

body.auth-locked .topbar {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 18px;
  grid-template-columns: 1fr;
}

body.auth-locked .brand-hero {
  justify-content: center;
  text-align: center;
}

body.auth-locked .brand-logo {
  width: 144px;
  height: 144px;
}

body.auth-locked .eyebrow {
  font-size: 17px;
}

.connection-copy {
  display: grid;
  gap: 3px;
}

.connection-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.connection-copy strong {
  font-size: 15px;
}

.connection-copy span,
.checklist {
  color: var(--muted);
  font-size: 13px;
}

.online-team-strip {
  grid-column: 1 / -1;
  display: none;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(202, 216, 230, 0.86);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.94), rgba(255, 255, 255, 0.86));
}

body.auth-locked .online-team-strip,
body.visitor-mode .online-team-strip {
  display: none !important;
}

.online-team-strip > strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 13px;
}

.team-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.team-reset-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(200, 61, 50, 0.25);
  background: #fff2f0;
  color: #a83228;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(200, 61, 50, 0.12);
}

.team-reset-btn:hover {
  background: #ffe7e3;
  transform: translateY(-1px);
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.team-chip b {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 10px;
}

.team-chip small {
  color: inherit;
  font-size: 11px;
  font-weight: 900;
}

.team-chip-signout {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(200, 61, 50, 0.22);
  background: #fff;
  color: #a83228;
  font-size: 11px;
  font-weight: 900;
}

.team-chip-signout:hover {
  background: #fff2f0;
}

.team-chip.on-duty {
  border-color: rgba(25, 122, 114, 0.26);
  background: var(--soft-green);
  color: var(--green);
}

.team-chip.on-duty b {
  background: var(--green);
  color: #fff;
}

.team-chip.off-site {
  color: #7a4b12;
  background: var(--soft-amber);
  border-color: rgba(168, 102, 18, 0.24);
}

.team-chip.off-site b {
  background: #fff8e7;
  color: var(--amber);
}

.team-dropdown,
.team-overview-dropdown {
  min-width: 0;
}

.team-dropdown summary,
.team-overview-dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 5px 10px;
  border: 1px solid rgba(168, 102, 18, 0.24);
  border-radius: 999px;
  background: var(--soft-amber);
  color: #7a4b12;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  list-style: none;
}

.team-dropdown summary::-webkit-details-marker,
.team-overview-dropdown summary::-webkit-details-marker {
  display: none;
}

.team-dropdown summary::after,
.team-overview-dropdown summary::after {
  content: "Show";
  color: inherit;
  font-size: 11px;
}

.team-dropdown[open] summary::after,
.team-overview-dropdown[open] summary::after {
  content: "Hide";
}

.team-dropdown summary span,
.team-overview-dropdown summary span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--amber);
}

.team-dropdown-list,
.team-overview-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.team-dropdown-list {
  position: absolute;
  z-index: 45;
  min-width: 250px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(18, 52, 77, 0.16);
}

.team-overview-dropdown {
  display: grid;
  margin-top: 4px;
}

.muted-team-item {
  opacity: 0.92;
}

.team-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.auth-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

body:not(.auth-locked) .auth-form {
  margin-left: auto;
}

body:not(.auth-locked) .connection-main {
  flex-wrap: wrap;
}

body:not(.auth-locked) .connection-copy {
  min-width: 210px;
}

body:not(.auth-locked) .auth-form {
  flex: 1 1 520px;
}

.login-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.auth-form input {
  width: 190px;
}

.signed-in-badge {
  display: none;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.signed-in-badge span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.signed-in-badge strong,
.signed-in-badge small {
  display: block;
}

.signed-in-badge small {
  color: var(--muted);
  font-size: 12px;
}

.duty-status-pill {
  display: none;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.duty-status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 8px;
  background: currentColor;
}

.duty-status-pill.on-duty {
  background: var(--soft-green);
  color: var(--green);
}

#dutyToggleBtn {
  position: relative;
  overflow: hidden;
  border-color: rgba(180, 83, 9, 0.46);
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 14px 30px rgba(234, 88, 12, 0.3);
}

#dutyToggleBtn::before {
  content: "";
  width: 9px;
  height: 9px;
  margin-right: 8px;
  display: inline-block;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.72);
  animation: dutyPulse 1.35s ease-out infinite;
}

#dutyToggleBtn:hover {
  border-color: rgba(234, 88, 12, 0.78);
  background: linear-gradient(135deg, #fb923c, #c2410c);
}

#dutyToggleBtn.on-duty {
  border-color: rgba(20, 122, 75, 0.3);
  background: linear-gradient(135deg, #16a34a, #147a4b);
  box-shadow: 0 12px 28px rgba(20, 122, 75, 0.24);
}

#dutyToggleBtn.on-duty::before {
  animation: none;
}

@keyframes dutyPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.72);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

body:not(.auth-locked) .connection-copy {
  gap: 2px;
}

body.auth-locked .auth-form {
  justify-content: flex-start;
  max-width: 100%;
}

body.auth-locked .auth-form input {
  width: min(250px, 100%);
}

body.auth-locked .connection-main {
  min-height: 244px;
  padding: 20px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #112f46, #164e69);
  color: #fff;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

body.auth-locked .connection-main::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -78px;
  width: 210px;
  height: 210px;
  border: 22px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

body.auth-locked .connection-copy,
body.auth-locked .auth-form {
  position: relative;
  z-index: 1;
}

body.auth-locked .connection-copy strong {
  color: #fff;
  font-size: 20px;
}

body.auth-locked .connection-copy span {
  max-width: 330px;
  color: rgba(255, 255, 255, 0.76);
}

body.auth-locked .login-fields {
  justify-content: flex-start;
}

body.auth-locked .login-fields input {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.96);
}

body.auth-locked #loginBtn {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--navy);
}

body.auth-locked #resetPasswordBtn {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.new-user-toggle {
  display: none;
}

body.auth-locked .new-user-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1 / -1;
  justify-self: end;
  min-width: 170px;
  background: linear-gradient(135deg, #0d8b88, #12334f);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 26px rgba(18, 52, 77, 0.18);
}

.request-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, var(--surface-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.auth-locked .request-form {
  padding: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

body.auth-locked:not(.request-open) #accessRequestForm {
  display: none;
}

.request-form h2 {
  grid-column: 1 / -1;
}

.form-message {
  min-height: 22px;
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.success-toast {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border: 1px solid rgba(4, 122, 66, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 48px rgba(15, 38, 58, 0.18);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.success-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.success-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0d8b88, #047a42);
  color: #fff;
  font-weight: 950;
}

.success-toast strong,
.success-toast small {
  display: block;
}

.success-toast strong {
  font-size: 15px;
}

.success-toast small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1600;
  min-width: 58px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(18, 51, 79, 0.12);
  background: linear-gradient(135deg, #0d8b88, #12334f);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 18px 38px rgba(18, 51, 79, 0.22);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.visitor-home-btn {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 1700;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(18, 51, 79, 0.12);
  background: linear-gradient(135deg, var(--navy-deep), var(--teal));
  color: #fff;
  font-weight: 950;
  box-shadow: 0 18px 38px rgba(18, 51, 79, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.visitor-home-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.handover-saved-box {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow: var(--shadow-soft);
}

.handover-saved-box[hidden] {
  display: none;
}

.handover-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.handover-card-head h3 {
  margin: 0 0 4px;
}

.handover-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.handover-saved-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dff8eb;
  color: #047a42;
  font-weight: 900;
  white-space: nowrap;
}

.handover-item-list {
  display: grid;
  gap: 10px;
}

.handover-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.handover-item strong {
  display: block;
  margin-bottom: 4px;
}

.handover-item p {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
}

.handover-item button {
  min-width: 96px;
  background: #e8f8f0;
  border-color: #b9e8cf;
  color: #047a42;
}

.handover-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--green);
  font-weight: 850;
  background: #f7fcfa;
}

.handover-completed {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.handover-completed h4 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.handover-completed-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border: 1px solid #dce8de;
  border-radius: 14px;
  background: #f8fcf9;
}

.handover-completed-item p {
  margin: 3px 0 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.handover-completed-item span {
  color: #047a42;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.invite-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.invite-link-box input {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.admin-tools-panel {
  margin-top: 18px;
}

.admin-tool-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-tool-actions button {
  min-width: 170px;
}

.admin-tool-actions .warning {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.24);
}

body:not(.auth-locked) .request-form {
  display: none;
}

body.invite-mode .auth-form,
body.invite-mode #accessRequestForm,
body.invite-mode .new-user-toggle {
  display: none;
}

body.checkpoint-public-mode .auth-form,
body.checkpoint-public-mode .connection-main,
body.checkpoint-public-mode #accessRequestForm,
body.checkpoint-public-mode #inviteSetupForm,
body.checkpoint-public-mode .new-user-toggle,
body.checkpoint-public-mode .online-team-strip {
  display: none !important;
}

body.checkpoint-public-mode .connection-panel {
  grid-template-columns: minmax(260px, 0.6fr) minmax(320px, 1fr);
}

body:not(.invite-mode) .invite-form {
  display: none;
}

.checkpoint-restricted-panel {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
  min-height: 250px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(185, 28, 28, 0.2);
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 18%, rgba(239, 68, 68, 0.13), transparent 30%),
    linear-gradient(135deg, #fff, #fff7f7);
  box-shadow: var(--shadow-soft);
}

.checkpoint-restricted-panel h2,
.checkpoint-restricted-panel p {
  margin: 0;
}

.checkpoint-restricted-panel h2 {
  font-size: clamp(24px, 4vw, 36px);
}

.checkpoint-restricted-panel p {
  max-width: 580px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.checkpoint-restricted-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  font-size: 24px;
  font-weight: 950;
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.22);
}

.date-filter {
  min-width: 145px;
}

.date-filter span,
.check-filter span {
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 800;
  color: #5d6b7c;
}

.date-filter input {
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 8px 20px rgba(16, 24, 40, 0.04);
}

.top-actions > button,
.report-multi > button {
  min-height: 46px;
  border-radius: 16px;
}

input[type="date"] {
  color: var(--ink);
  font-weight: 750;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  width: 18px;
  height: 18px;
  padding: 5px;
  border-radius: 999px;
  cursor: pointer;
  background-color: var(--soft-blue);
  filter: saturate(0.7);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  background-color: #dbeafe;
}

.check-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.check-filter input {
  width: auto;
  min-height: auto;
}

.check-filter span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.report-multi {
  position: relative;
}

.case-search {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: end;
  flex: 1 1 360px;
  min-width: 300px;
}

.case-search[hidden],
body:not(.case-search-allowed) .case-search {
  display: none !important;
}

.case-search label {
  display: grid;
  gap: 3px;
}

.case-search span {
  color: #5d6b7c;
  font-size: 13px;
  font-weight: 800;
}

.case-search input {
  min-height: 46px;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.case-search button {
  min-height: 46px;
  border-radius: 16px;
}

.case-search-message {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.case-search-message.success {
  color: var(--green);
}

.case-search-message.error {
  color: var(--red);
}

.case-search-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.case-search-results[hidden] {
  display: none;
}

.case-search-results button {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: auto;
  padding: 10px 12px;
  border-radius: 13px;
  text-align: left;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.case-search-results strong {
  color: var(--navy);
  font-size: 13px;
}

.case-search-results span,
.case-search-results small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.case-search-snippet {
  display: block;
  margin-top: 3px;
  color: var(--ink) !important;
}

.case-search-hit {
  border-radius: 6px;
  padding: 0 3px;
  background: rgba(255, 184, 28, 0.34);
  color: #7a4b12;
  font-weight: 950;
}

body.case-search-allowed:not(.reports-allowed) .top-actions.report-panel {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  max-width: 820px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body:not(.reports-allowed) .top-actions.report-panel .report-panel-title,
body:not(.reports-allowed) .top-actions.report-panel .date-filter,
body:not(.reports-allowed) .top-actions.report-panel .report-multi,
body:not(.reports-allowed) .top-actions.report-panel .check-filter,
body:not(.reports-allowed) .top-actions.report-panel > button {
  display: none !important;
}

body.case-search-allowed:not(.reports-allowed) .top-actions.report-panel .case-search {
  grid-column: 1 / -1 !important;
  min-width: 0 !important;
}

.report-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100;
  display: none;
  width: 260px;
  max-height: min(420px, calc(100vh - 150px));
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.report-menu.open {
  display: grid;
  gap: 9px;
}

.report-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
}

.report-menu input {
  width: auto;
  min-height: auto;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.status-grid article,
.workspace,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.status-grid article {
  padding: 20px 22px 18px;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 253, 0.94));
}

.status-grid article::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(8, 127, 123, 0.18), rgba(33, 103, 174, 0.11));
}

.status-grid article > * {
  position: relative;
  z-index: 1;
}

.status-grid article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--teal), #52c7c4);
}

.status-grid article:nth-child(2)::before {
  background: var(--red);
}

.status-grid article:nth-child(3)::before {
  background: var(--amber);
}

.status-grid article:nth-child(4)::before {
  background: var(--blue);
}

.status-grid article:nth-child(5)::before {
  background: #0e7490;
}

.status-grid span,
.panel-head p,
label span {
  color: var(--muted);
  font-size: 13px;
}

.status-grid span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
}

.status-grid span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(8, 127, 123, 0.1);
}

.status-grid article:nth-child(2) span::before {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(189, 58, 47, 0.1);
}

.status-grid article:nth-child(3) span::before {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(168, 102, 18, 0.12);
}

.status-grid article:nth-child(4) span::before {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(33, 103, 174, 0.1);
}

.status-grid article:nth-child(5) span::before {
  background: #0e7490;
  box-shadow: 0 0 0 4px rgba(14, 116, 144, 0.1);
}

.status-grid strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1;
  letter-spacing: 0;
}

.workspace {
  padding: 18px;
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.92));
  backdrop-filter: blur(12px);
}

.tabs {
  border: 1px solid rgba(195, 210, 223, 0.9);
  border-radius: 24px;
  padding: 11px;
  margin-bottom: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 250, 252, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 14px 32px rgba(15, 36, 54, 0.08);
}

.tabs button {
  min-height: 50px;
  background: linear-gradient(180deg, #ffffff, #f7fafc);
  color: #26364a;
  border: 1px solid rgba(176, 194, 210, 0.86);
  border-radius: 18px;
  padding: 0 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 6px 14px rgba(15, 36, 54, 0.06);
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.tabs button.active {
  background: linear-gradient(135deg, var(--navy), #174765);
  color: #fff;
  border-color: transparent;
  box-shadow:
    0 14px 28px rgba(18, 52, 77, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.tabs button:hover {
  border-color: rgba(45, 115, 196, 0.38);
  box-shadow: 0 12px 24px rgba(45, 115, 196, 0.14);
  transform: translateY(-1px);
}

.tabs button.tab-alert:not(.active) {
  border-color: #f0b35b;
  background: linear-gradient(135deg, #fff8e8, #fffdf7);
  color: #8a4f05;
  box-shadow:
    0 14px 26px rgba(180, 106, 12, 0.14),
    0 0 0 4px rgba(249, 178, 55, 0.12);
}

.tabs button.tab-alert:not(.active)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 7px;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.14);
  vertical-align: middle;
}

.tabs .handover-jump {
  position: relative;
  border-color: rgba(14, 116, 144, 0.26);
  background: linear-gradient(180deg, #ffffff, #f1fbfc);
}

.tabs .handover-jump.active-handover {
  border-color: #f0b35b;
  background: linear-gradient(135deg, #ffb020, #f97316);
  color: #fff;
  box-shadow:
    0 16px 30px rgba(249, 115, 22, 0.35),
    0 0 0 4px rgba(249, 115, 22, 0.12);
}

.tabs button.admin-alert {
  border-color: #f0b35b;
  background: linear-gradient(135deg, #ffb020, #f97316);
  color: #fff;
  box-shadow:
    0 16px 30px rgba(249, 115, 22, 0.35),
    0 0 0 4px rgba(249, 115, 22, 0.12);
}

.tabs button.admin-alert::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
  vertical-align: middle;
}

.tabs .handover-jump.active-handover::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.22);
  vertical-align: middle;
}

.tabs .handover-jump.normal {
  color: #344054;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.visitor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.visitor-left-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.ai-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
  gap: 18px;
  align-items: stretch;
}

.ai-command-panel {
  background:
    radial-gradient(circle at 96% 0%, rgba(15, 118, 110, 0.1), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbfd);
}

.ai-form {
  gap: 14px;
}

.ai-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ai-action-row button {
  min-height: 44px;
}

#aiRunBtn {
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.18);
}

#aiRunBtn:disabled {
  opacity: 0.72;
  cursor: wait;
  box-shadow: none;
}

.ai-output {
  min-height: 420px;
  resize: vertical;
  line-height: 1.55;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.98));
}

.ai-note {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 115, 196, 0.18);
  border-radius: 14px;
  background: rgba(232, 244, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.dashboard-main {
  grid-row: span 3;
}

.dashboard-handover,
.dashboard-chart,
.dashboard-actions {
  grid-column: 1 / -1;
}

.dashboard-handover {
  border-color: rgba(15, 118, 110, 0.26);
  background:
    radial-gradient(circle at 94% 0%, rgba(15, 118, 110, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbfd);
}

.dashboard-actions {
  border-color: rgba(15, 118, 110, 0.22);
  background:
    radial-gradient(circle at 94% 0%, rgba(45, 115, 196, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbfd);
}

.handover-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.handover-head-actions button {
  min-height: 38px;
  border-radius: 999px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
}

.dashboard-handover:not(.handover-open) .handover-entry-form {
  display: none;
}

.dashboard-actions:not(.actions-open) .quick-actions {
  display: none;
}

.handover-entry-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.handover-entry-form input,
.handover-entry-form textarea,
.handover-entry-form button,
.handover-entry-form .form-message {
  grid-column: 1 / -1;
}

.handover-entry-form textarea {
  min-height: 74px;
}

.dashboard-section-title {
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.dashboard-list {
  display: grid;
  gap: 10px;
}

.dashboard-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f8fbfd);
}

.dashboard-item.clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dashboard-item.clickable:hover,
.dashboard-item.clickable:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 12px 28px rgba(18, 51, 79, 0.10);
  outline: none;
  transform: translateY(-1px);
}

.dashboard-item .meta {
  margin-top: 3px;
}

.compact-timeline .timeline-item {
  padding: 12px;
}

.panel {
  min-width: 0;
  padding: 22px;
  box-shadow: var(--shadow-soft);
  background:
    linear-gradient(180deg, #ffffff, #fbfdff);
}

.panel:hover {
  border-color: var(--line-strong);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.72);
}

.panel-head.compact {
  margin-top: 18px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.record-pills {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.green {
  background: var(--soft-green);
  color: var(--green);
}

.amber {
  background: var(--soft-amber);
  color: var(--amber);
}

.red {
  background: var(--soft-red);
  color: var(--red);
}

.blue {
  background: var(--soft-blue);
  color: var(--blue);
}

.staff-profile-panel {
  margin-top: 16px;
}

.staff-profile-form {
  margin-bottom: 18px;
}

.staff-current-toggle {
  align-self: end;
  justify-content: flex-start;
}

.staff-profile-list {
  display: grid;
  gap: 12px;
}

.staff-card {
  border-left: 5px solid var(--blue);
}

.staff-card.compliance-green {
  border-left-color: var(--green);
}

.staff-card.compliance-amber {
  border-left-color: var(--amber);
}

.staff-card.compliance-red {
  border-left-color: var(--red);
}

.compliance-inline {
  margin-top: 5px;
  font-weight: 850;
}

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

.compliance-grid div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(207, 221, 234, 0.78);
  border-radius: 16px;
  background: rgba(248, 252, 254, 0.92);
}

.compliance-grid span,
.compliance-grid small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.compliance-grid strong {
  display: block;
  margin: 4px 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.document-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

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

#visitorForm {
  align-content: start;
}

.stacked-form,
label {
  display: grid;
  gap: 8px;
}

.stacked-form {
  margin-top: 16px;
}

.full {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f7fbff);
}

.form-section-head {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.form-section-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ink);
}

.form-section-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.emergency-service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.wide-field {
  grid-column: span 3;
}

.people-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.people-entry-grid button,
.people-chip button {
  min-height: 44px;
}

.person-unit-field[hidden] {
  display: none !important;
}

.people-list,
.people-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.people-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.people-chip.editable {
  border-style: dashed;
}

.people-chip button {
  padding: 6px 10px;
  border-radius: 999px;
}

.case-people-details,
.parking-details {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fbff, #ffffff);
}

.parking-details {
  border-color: rgba(184, 120, 26, 0.24);
  background: #fff9ed;
}

.parking-details p {
  margin: 0;
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .people-entry-grid {
    grid-template-columns: 1fr;
  }

  .wide-field {
    grid-column: 1 / -1;
  }
}

.incident-escalation-section {
  border-color: rgba(234, 88, 12, 0.26);
  background:
    radial-gradient(circle at 96% 0%, rgba(255, 159, 28, 0.14), transparent 34%),
    linear-gradient(135deg, #ffffff, #fff9f0);
}

.urgent-escalation-btn {
  min-height: 48px;
  border-color: transparent;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 14px 30px rgba(234, 88, 12, 0.22);
}

.urgent-escalation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(234, 88, 12, 0.28);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  color: var(--ink);
  min-height: 42px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33, 103, 174, 0.13);
  background: #fff;
}

textarea {
  resize: vertical;
}

#visitorReason {
  min-height: 86px;
}

input[type="file"] {
  min-height: auto;
}

body.touch-view button,
body.touch-view input,
body.touch-view select,
body.touch-view textarea {
  min-height: 46px;
}

body.touch-view .tabs button,
body.touch-view .record-actions button {
  min-height: 44px;
}

body.mobile-view .handover-card-head,
body.mobile-view .handover-item {
  grid-template-columns: 1fr;
}

body.mobile-view .handover-card-head {
  display: grid;
}

body.mobile-view .handover-head-actions {
  justify-content: stretch;
}

body.mobile-view .handover-head-actions .pill,
body.mobile-view .handover-head-actions button {
  width: 100%;
}

body.mobile-view .handover-item button {
  width: 100%;
}

body.mobile-view .handover-completed-item {
  grid-template-columns: 1fr;
}

body.mobile-view .handover-completed-item span {
  white-space: normal;
}

.card-list,
.timeline,
.checkpoint-list {
  display: grid;
  gap: 11px;
}

.record-card,
.checkpoint,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background:
    linear-gradient(180deg, #ffffff, var(--surface-soft));
}

.record-card {
  display: grid;
  gap: 10px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.record-card::before {
  content: "";
  width: 34px;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), rgba(45, 115, 196, 0.16));
  opacity: 0.7;
}

.record-card:hover,
.timeline-item:hover,
.checkpoint:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.timeline-item.clickable {
  cursor: pointer;
}

.timeline-item.clickable:hover {
  border-color: var(--blue);
  background: #fff;
}

.record-highlight {
  border-color: var(--blue) !important;
  box-shadow: 0 0 0 4px rgba(33, 103, 174, 0.14), var(--shadow-soft) !important;
}

.tab-panel.case-focus .split > .panel:last-child {
  order: -1;
}

.record-top,
.record-actions,
.checkpoint {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.record-actions {
  flex-wrap: wrap;
}

.add-photo-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: rgba(232, 241, 251, 0.56);
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
}

.add-photo-control.uploading {
  border-style: solid;
  background: linear-gradient(135deg, rgba(13, 139, 136, 0.12), rgba(18, 51, 79, 0.08));
  color: var(--teal);
  pointer-events: none;
}

.add-photo-control span {
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.add-photo-control.uploading span {
  color: var(--teal);
}

.add-photo-control input {
  min-height: auto;
  max-width: 230px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
}

.add-photo-control input:disabled {
  opacity: 0.55;
}

.case-edit-note {
  width: fit-content;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(180, 83, 9, 0.18);
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.78);
  color: #8a4b0f;
  font-size: 12px;
  font-weight: 850;
}

.record-detail-strip {
  display: grid;
  gap: 4px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfe;
  color: var(--muted);
  font-size: 13px;
}

.record-detail-strip strong {
  color: var(--ink);
}

.urgent-detail-strip {
  border-color: rgba(234, 88, 12, 0.24);
  background: rgba(255, 247, 237, 0.82);
}

.record-actions select {
  width: auto;
  min-width: 150px;
}

.record-actions select:disabled {
  border-color: rgba(102, 112, 133, 0.18);
  background: #f4f7fa;
  color: var(--muted);
  cursor: not-allowed;
}

.record-actions .case-report-btn {
  border-color: rgba(14, 116, 144, 0.25);
  background: linear-gradient(135deg, #0e7490, #12334f);
  color: #fff;
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.18);
}

.record-actions .case-report-btn:hover {
  border-color: rgba(14, 116, 144, 0.42);
  background: linear-gradient(135deg, #0f8ca8, #17476d);
  box-shadow: 0 14px 28px rgba(14, 116, 144, 0.24);
}

.record-actions .incident-alert-btn {
  border-color: rgba(234, 88, 12, 0.22);
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  box-shadow: 0 10px 22px rgba(234, 88, 12, 0.2);
}

.record-actions .incident-alert-btn:hover {
  border-color: rgba(234, 88, 12, 0.42);
  background: linear-gradient(135deg, #fb923c, #dc2626);
  box-shadow: 0 14px 28px rgba(234, 88, 12, 0.26);
}

.record-title {
  font-weight: 850;
  color: #101828;
}

.visitor-group {
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
}

.visitor-group + .visitor-group {
  margin-top: 12px;
}

.visitor-group summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(135deg, rgba(234, 244, 255, 0.72), rgba(255, 255, 255, 0.92));
}

.visitor-group summary::-webkit-details-marker {
  display: none;
}

.visitor-group summary strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.visitor-group summary span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.visitor-group-arrow {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: var(--blue) !important;
  font-size: 12px;
  font-weight: 900 !important;
}

.visitor-group[open] .visitor-group-arrow {
  color: var(--teal) !important;
}

.visitor-group[open] .visitor-group-arrow::before {
  content: "Showing ";
}

.visitor-group:not([open]) .visitor-group-arrow::before {
  content: "Show ";
}

.visitor-group-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.visitor-card {
  box-shadow: none;
}

.roster-group .visitor-group-list {
  padding: 12px;
}

.guard-card {
  box-shadow: none;
}

.guard-card::before {
  background: linear-gradient(90deg, var(--teal), rgba(25, 122, 114, 0.14));
}

.comments-box {
  display: grid;
  gap: 9px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.checkpoint .comments-box {
  flex-basis: 100%;
  width: 100%;
}

.comments-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.comments-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.comment-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.comment-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.comment-actions button {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.comment-item strong,
.comment-item span {
  display: inline-block;
  margin-right: 8px;
  font-size: 12px;
}

.comment-item span {
  color: var(--muted);
}

.comment-item p {
  margin-top: 4px;
  font-size: 13px;
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.comment-form textarea {
  min-height: 44px;
  resize: vertical;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
}

.time {
  color: var(--blue);
  font-weight: 850;
  font-size: 13px;
}

.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--blue);
}

.timeline-item .time {
  padding-left: 16px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-actions button {
  justify-content: flex-start;
  text-align: left;
  min-height: 52px;
  background:
    linear-gradient(90deg, rgba(45, 115, 196, 0.08), transparent 42%),
    linear-gradient(180deg, #ffffff, #f7fafc);
}

.pie-wrap {
  display: grid;
  grid-template-columns: 220px minmax(320px, 520px);
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 22px 0 12px;
}

.pie-chart {
  width: 220px;
  height: 220px;
  display: block;
}

.pie-total {
  fill: var(--ink);
  font-size: 26px;
  font-weight: 850;
}

.pie-empty {
  fill: var(--muted);
  font-size: 16px;
  font-weight: 850;
}

.pie-empty.small {
  font-size: 12px;
  font-weight: 650;
}

.pie-legend {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
}

.legend-row {
  display: grid;
  grid-template-columns: 14px minmax(120px, auto) minmax(24px, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 13px;
}

.legend-row::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, rgba(102, 112, 133, 0.28), rgba(102, 112, 133, 0.08));
  grid-column: 3;
  grid-row: 1;
}

.legend-row strong {
  color: var(--ink);
  grid-column: 4;
  text-align: right;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 5px;
}

.trend-chart-panel {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 253, 0.94)),
    radial-gradient(circle at 88% 10%, rgba(8, 127, 123, 0.13), transparent 30%);
  box-shadow: 0 14px 32px rgba(18, 51, 79, 0.08);
}

.trend-chart-panel[hidden] {
  display: none;
}

.trend-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.82);
}

.trend-chart-head h3 {
  margin: 0;
  font-size: 18px;
}

.trend-chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trend-total {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(8, 127, 123, 0.1);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 850;
}

.trend-chart-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 250px);
  gap: 16px;
  align-items: center;
}

.trend-chart-svg {
  display: block;
  width: 100%;
  min-height: 230px;
}

.trend-grid {
  stroke: rgba(102, 112, 133, 0.18);
  stroke-width: 1;
}

.trend-axis {
  stroke: rgba(102, 112, 133, 0.34);
  stroke-width: 1.2;
}

.trend-axis-text {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.trend-point {
  stroke: #ffffff;
  stroke-width: 2;
}

.trend-legend {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.trend-legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.trend-legend-row strong {
  color: var(--ink);
}

.trend-empty {
  border: 1px dashed rgba(102, 112, 133, 0.35);
  border-radius: 14px;
  padding: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.photo-thumb {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
}

.photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.photo-thumb span {
  display: block;
  padding: 6px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.incident-photos a {
  display: inline-flex;
  border-radius: 12px;
  cursor: zoom-in;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.incident-photos a:hover,
.incident-photos a:focus-visible {
  box-shadow: 0 10px 22px rgba(15, 59, 87, 0.18);
  outline: 2px solid rgba(21, 112, 239, 0.35);
  outline-offset: 2px;
  transform: translateY(-1px);
}

.incident-photos img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.photo-viewer.open {
  display: flex;
}

.photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 24, 35, 0.72);
  backdrop-filter: blur(6px);
}

.photo-viewer-dialog {
  position: relative;
  z-index: 1;
  width: min(980px, 94vw);
  max-height: 92vh;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 32px 70px rgba(8, 24, 35, 0.35);
  padding: 18px;
}

.photo-viewer-dialog img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 96px);
  border-radius: 16px;
  object-fit: contain;
  background: #f8fafc;
}

.photo-viewer-close {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 2;
  min-height: 42px;
  border: 1px solid rgba(15, 59, 87, 0.12);
  border-radius: 999px;
  padding: 0 16px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(8, 24, 35, 0.18);
}

.photo-viewer-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  word-break: break-word;
}

body.photo-viewer-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .photo-viewer {
    padding: 12px;
  }

  .photo-viewer-dialog {
    width: 96vw;
    padding: 10px;
    border-radius: 20px;
  }

  .photo-viewer-dialog img {
    max-height: calc(92vh - 84px);
    border-radius: 14px;
  }

  .photo-viewer-close {
    right: 12px;
    top: 12px;
  }
}

.lower-row {
  margin-top: 14px;
}

.qr-layout {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-soft);
}

.qr-layout img {
  width: 190px;
  height: 190px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 10px;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  padding: 26px;
  text-align: center;
  background: var(--surface-soft);
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.visitor-help {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.visitor-help div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

#visitorForm .visitor-help {
  margin-top: 10px;
}

.visitor-help strong {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
}

.visitor-help span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.visitor-complete-panel {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 360px;
  margin-top: 14px;
  padding: 34px 24px;
  text-align: center;
  border: 1px solid rgba(18, 51, 79, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 12%, rgba(13, 139, 136, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #f8fbfd);
  box-shadow: var(--shadow-soft);
}

.visitor-complete-panel[hidden] {
  display: none !important;
}

.visitor-complete-icon {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0d8b88, #12334f);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: 0 18px 34px rgba(13, 139, 136, 0.24);
}

.visitor-complete-panel h3 {
  margin: 16px 0 6px;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.05;
}

.visitor-complete-panel p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.visitor-complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
}

.visitor-complete-actions button {
  min-width: 180px;
}

.checkpoint.done {
  background: var(--soft-green);
  border-color: #b9dfc8;
}

.checkpoint.pending-sync {
  background: #fff7e8;
  border-color: #f0c777;
}

.checkpoint-sync-note {
  display: inline-flex;
  width: fit-content;
  margin-top: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff2cc;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 900;
}

.checkpoint {
  flex-wrap: wrap;
}

.checkpoint button {
  min-width: 112px;
}

.checkpoint-qr {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.checkpoint-qr img {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 5px;
}

.checkpoint-qr button {
  min-width: 72px;
  min-height: 32px;
  font-size: 12px;
}

.scanner-box {
  display: none;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, #f8fbff, #eef6fb);
}

.scanner-box.active {
  display: grid;
  gap: 10px;
}

.scanner-box video {
  width: 100%;
  max-height: 360px;
  border-radius: 14px;
  background: #0b1220;
  object-fit: cover;
}

body.desktop-view .app-shell {
  width: min(1480px, 100%);
}

body.desktop-view .workspace {
  padding: 20px;
}

body.tablet-view .app-shell {
  padding: 22px 22px 40px;
}

body.tablet-view .topbar {
  grid-template-columns: 1fr;
  gap: 16px;
}

body.tablet-view .brand-hero {
  min-height: 126px;
}

body.tablet-view .top-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: flex-end;
  gap: 12px;
}

body.tablet-view .report-panel-title {
  grid-column: 1 / -1;
}

body.tablet-view .date-filter,
body.tablet-view .report-multi,
body.tablet-view .check-filter,
body.tablet-view .top-actions > button {
  width: 100%;
}

body.tablet-view .top-actions input,
body.tablet-view .top-actions button,
body.tablet-view .check-filter {
  min-height: 50px;
}

body.tablet-view .connection-panel {
  grid-template-columns: 1fr;
  align-items: stretch;
}

body.tablet-view .connection-main,
body.tablet-view .auth-form {
  flex-wrap: wrap;
  justify-content: flex-start;
}

body.tablet-view .online-team-strip {
  width: 100%;
}

body.tablet-view .status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.tablet-view .dashboard-grid,
body.tablet-view .split,
body.tablet-view .visitor-layout {
  grid-template-columns: 1fr;
}

body.tablet-view .tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

body.tablet-view .tabs button {
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
}

body.mobile-view {
  background:
    linear-gradient(180deg, #f8fbfd 0, var(--bg) 260px, #edf2f6 100%);
}

body.mobile-view::before {
  background-size: 34px 34px;
}

body.mobile-view .app-shell {
  padding: 10px 10px 26px;
}

body.mobile-view .topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

body.mobile-view .brand-hero,
body.mobile-view.auth-locked .brand-hero {
  min-height: auto;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 20px;
}

body.mobile-view .brand-logo,
body.mobile-view.auth-locked .brand-logo {
  width: 96px;
  height: 96px;
}

body.mobile-view .eyebrow {
  font-size: 14px;
}

body.mobile-view .top-actions,
body.mobile-view .connection-panel,
body.mobile-view .workspace,
body.mobile-view .panel {
  border-radius: 18px;
}

body.mobile-view .top-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  padding: 14px;
  margin-bottom: 12px;
}

body.mobile-view .date-filter,
body.mobile-view .check-filter,
body.mobile-view .report-multi,
body.mobile-view .case-search,
body.mobile-view .top-actions button,
body.mobile-view .top-actions input,
body.mobile-view .top-actions select {
  width: 100%;
  min-height: 52px;
}

body.mobile-view .case-search {
  grid-template-columns: 1fr;
  min-width: 0;
  min-height: auto;
}

body.mobile-view .case-search-message,
body.mobile-view .case-search-results {
  min-height: auto;
}

body.mobile-view .check-filter {
  justify-content: center;
}

body.mobile-view .report-panel-title {
  gap: 5px 10px;
  padding-bottom: 12px;
}

body.mobile-view .report-panel-title strong {
  font-size: 19px;
}

body.mobile-view .report-panel-title span {
  font-size: 13px;
}

body.mobile-view .connection-panel,
body.mobile-view.auth-locked .connection-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 0;
  padding: 14px;
}

body.mobile-view .connection-main,
body.mobile-view .auth-form,
body.mobile-view .login-fields {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

body.mobile-view .connection-main,
body.mobile-view .auth-form {
  flex: none;
  gap: 8px;
  margin-left: 0;
  justify-content: flex-start;
}

body.mobile-view .signed-in-badge,
body.mobile-view .duty-status-pill,
body.mobile-view .auth-form button,
body.mobile-view .auth-form input,
body.mobile-view .new-user-toggle {
  width: 100%;
  min-height: 52px;
}

body.mobile-view #dutyToggleBtn {
  min-height: 56px;
  font-size: 18px;
  letter-spacing: 0;
  border-radius: 18px;
}

body.mobile-view .online-team-strip {
  align-items: flex-start;
  flex-direction: column;
  margin-top: 0;
  width: 100%;
  gap: 10px;
  padding: 12px;
}

body.mobile-view .team-chip-row {
  width: 100%;
  gap: 8px;
}

body.mobile-view .team-chip {
  max-width: 100%;
  min-height: 40px;
  padding-right: 12px;
  font-size: 13px;
}

body.mobile-view .status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

body.mobile-view .status-grid article {
  min-height: 104px;
  padding: 15px;
  border-radius: 20px;
}

body.mobile-view .status-grid strong {
  font-size: 28px;
  line-height: 1;
}

body.mobile-view .workspace {
  padding: 10px;
  border-radius: 22px;
}

body.mobile-view .tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

body.mobile-view .tabs button {
  width: 100%;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 16px;
  background: #ffffff;
  border-color: rgba(195, 210, 223, 0.86);
  box-shadow: none;
  font-size: 13.5px;
  white-space: normal;
  line-height: 1.1;
}

body.mobile-view .tabs button.active {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  border-color: transparent;
}

body.mobile-view .dashboard-grid,
body.mobile-view .split,
body.mobile-view .visitor-layout,
body.mobile-view .grid-form,
body.mobile-view .handover-entry-form,
body.mobile-view .quick-actions,
body.mobile-view .pie-wrap,
body.mobile-view .visitor-help,
body.mobile-view .request-form {
  grid-template-columns: 1fr;
  gap: 12px;
}

body.mobile-view .emergency-service-grid,
body.tablet-view .emergency-service-grid {
  grid-template-columns: 1fr;
}

body.mobile-view .wide-field,
body.tablet-view .wide-field {
  grid-column: 1;
}

body.mobile-view .trend-chart-body,
body.tablet-view .trend-chart-body {
  grid-template-columns: 1fr;
}

body.mobile-view .trend-chart-panel {
  padding: 14px;
}

body.mobile-view .trend-chart-head {
  display: grid;
}

body.mobile-view .dashboard-chart {
  order: -5;
}

body.mobile-view .dashboard-main {
  order: 2;
}

body.mobile-view .dashboard-side,
body.mobile-view .dashboard-handover,
body.mobile-view .dashboard-actions {
  order: 3;
}

body.mobile-view .record-top,
body.mobile-view .record-actions,
body.mobile-view .checkpoint,
body.mobile-view .qr-layout {
  align-items: stretch;
  flex-direction: column;
}

body.mobile-view .record-pills {
  justify-content: flex-start;
}

body.mobile-view .success-toast {
  top: 12px;
  right: 12px;
  left: 12px;
  max-width: none;
}

body.mobile-view .back-to-top {
  right: 14px;
  bottom: 14px;
}

body.mobile-view .visitor-home-btn {
  left: 14px;
  right: auto;
  bottom: 14px;
}

body.mobile-view .record-actions button,
body.mobile-view .record-actions select,
body.mobile-view .comment-form,
body.mobile-view .comment-form button {
  width: 100%;
}

body.mobile-view .visitor-group summary {
  align-items: flex-start;
}

body.mobile-view .report-menu {
  position: static;
  width: 100%;
  margin-top: 8px;
}

body.mobile-view .qr-layout {
  display: grid;
  grid-template-columns: 1fr;
}

body.mobile-view .qr-layout img {
  width: min(100%, 220px);
  height: auto;
  justify-self: center;
}

body.mobile-view.auth-locked .top-actions,
body.mobile-view.auth-locked .tabs,
body.mobile-view.auth-locked .status-grid,
body.mobile-view.auth-locked .workspace {
  display: none !important;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .brand-hero {
    min-height: 136px;
  }

  .brand-logo {
    width: 108px;
    height: 108px;
  }

  .connection-panel {
    grid-template-columns: 1fr;
  }

  body.auth-locked .brand-hero {
    min-height: 166px;
  }

  body.auth-locked .brand-logo {
    width: 132px;
    height: 132px;
  }

  .connection-main {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-form {
    justify-content: flex-start;
  }

  .status-grid,
  .dashboard-grid,
  .split,
  .visitor-layout {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-main,
  .dashboard-handover,
  .dashboard-chart,
  .dashboard-actions {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .visitor-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 10px 10px 26px;
  }

  .brand-hero,
  body.auth-locked .brand-hero {
    gap: 12px;
    padding: 10px 12px;
    justify-content: center;
    text-align: center;
  }

  .brand-logo,
  body.auth-locked .brand-logo {
    width: 86px;
    height: 86px;
  }

  .top-actions {
    padding: 14px;
  }

  .connection-panel {
    padding: 14px;
  }

  body.auth-locked .connection-panel {
    margin-top: 18px;
    padding: 16px;
  }

  body.auth-locked .connection-main {
    min-height: 220px;
    padding: 18px;
  }

  .status-grid,
  .dashboard-grid,
  .grid-form,
  .quick-actions,
  .pie-wrap,
  .visitor-help {
    grid-template-columns: 1fr;
  }

  .pie-chart {
    margin: 0 auto;
  }

  .top-actions,
  .tabs,
  .auth-form,
  .login-fields,
  .auth-form input,
  body.auth-locked .auth-form input,
  .auth-form button,
  .request-form,
  .record-actions select,
  .top-actions button,
  .report-multi,
  .report-multi button,
  .tabs button {
    width: 100%;
  }

  .report-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .request-form {
    grid-template-columns: 1fr;
  }

  .invite-link-box {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .dashboard-item {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .comment-form {
    grid-template-columns: 1fr;
  }

  .comment-top {
    flex-direction: column;
  }

  .comment-actions {
    justify-content: flex-start;
  }

  .record-top,
  .record-actions,
  .checkpoint,
  .qr-layout {
    align-items: stretch;
    flex-direction: column;
  }

  .checkpoint-qr {
    justify-items: stretch;
  }

  .checkpoint-qr img {
    width: 120px;
    height: 120px;
  }

  .panel,
  .workspace,
  .connection-panel,
  .status-grid article {
    box-shadow: none;
  }

  .qr-layout {
    display: flex;
    padding: 12px;
  }
}

body.mobile-view .status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.mobile-view .tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Premium app polish for desktop, tablet, and phone */
@media screen {
  body {
    background:
      radial-gradient(circle at 16% -12%, rgba(45, 115, 196, 0.14), transparent 30%),
      radial-gradient(circle at 92% 2%, rgba(13, 139, 136, 0.12), transparent 32%),
      linear-gradient(180deg, #f8fbfd 0, #eef4f8 45%, #e8eff4 100%);
  }

  body::before {
    opacity: 0.72;
    background-size: 48px 48px;
  }

  .app-shell {
    width: min(1500px, 100%);
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: minmax(320px, 0.48fr) minmax(700px, 1fr);
    gap: 26px;
  }

  .brand-hero {
    min-height: 132px;
    overflow: hidden;
    border: 1px solid rgba(196, 212, 226, 0.86);
    border-radius: 28px;
    background:
      radial-gradient(circle at 50% 18%, rgba(13, 139, 136, 0.08), transparent 36%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 254, 0.94));
    box-shadow: 0 22px 54px rgba(18, 52, 77, 0.11);
    backdrop-filter: blur(16px);
  }

  .brand-mark {
    gap: 12px;
  }

  .brand-logo {
    width: 116px;
    height: 116px;
  }

  body.auth-locked .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
    margin-top: 10px;
    margin-bottom: 22px;
  }

  body.auth-locked .brand-hero {
    width: min(520px, 100%);
    min-height: 150px;
  }

  body.auth-locked .brand-logo {
    width: 132px;
    height: 132px;
  }

  body.auth-locked .connection-panel {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding: 20px;
  }

  body.auth-locked .topbar {
    display: none;
  }

  body.auth-locked .auth-card-brand {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 14px;
    min-height: 280px;
    padding: 24px;
    border-radius: 28px;
    background:
      radial-gradient(circle at 50% 36%, rgba(45, 115, 196, 0.12), transparent 42%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 251, 253, 0.9));
  }

  body.auth-locked .auth-card-brand img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 18px 24px rgba(18, 52, 77, 0.18));
    transform-origin: center;
    animation: logoHeartbeat 2.8s ease-in-out infinite;
  }

  body.auth-locked .auth-card-brand strong {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    color: var(--teal);
    font-size: 15px;
    font-weight: 950;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    box-shadow: none !important;
    text-align: center;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .connection-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
    align-items: stretch;
    gap: 14px;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .connection-main {
    min-height: 0;
    justify-content: center;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .login-fields {
    display: grid;
    grid-template-columns: auto auto;
    width: 100%;
    align-items: center;
    justify-content: start;
    gap: 10px 12px;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .login-fields input {
    width: min(280px, 100%);
  }

  body.auth-locked:not(.request-open):not(.invite-mode) #loginEmail,
  body.auth-locked:not(.request-open):not(.invite-mode) #loginPassword {
    grid-column: 1 / -1;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) #loginBtn {
    grid-column: 2;
    grid-row: 3;
    align-self: center;
    justify-self: start;
    min-width: 112px;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) #resetPasswordBtn {
    grid-column: 1;
    grid-row: 3;
    justify-self: start;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .new-user-toggle {
    grid-column: 2;
    justify-self: end;
    min-width: 190px;
  }

  .eyebrow {
    padding: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
  }

  .top-actions,
  .connection-panel,
  .workspace,
  .panel,
  .status-grid article,
  .record-card,
  .checkpoint,
  .timeline-item,
  .dashboard-item,
  .visitor-group,
  .comments-box {
    border-color: rgba(196, 212, 226, 0.78);
  }

  .top-actions {
    min-height: 0;
    border-radius: 28px;
    padding: 20px 22px;
    align-content: start;
    background:
      radial-gradient(circle at 98% 0%, rgba(13, 139, 136, 0.11), transparent 34%),
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 254, 0.94));
    box-shadow: 0 22px 54px rgba(18, 52, 77, 0.12);
  }

  .connection-panel,
  .workspace,
  .panel {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 255, 0.95));
  }

  .connection-panel {
    border-radius: 24px;
    padding: 16px 18px;
    box-shadow: 0 18px 46px rgba(18, 52, 77, 0.09);
  }

  body:not(.auth-locked) .connection-main {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(196, 212, 226, 0.72);
  }

  .connection-copy strong {
    letter-spacing: -0.01em;
  }

  .signed-in-badge {
    border-radius: 18px;
    background: linear-gradient(180deg, #fff, #f8fbfd);
  }

  .duty-status-pill {
    min-height: 42px;
    border-radius: 999px;
  }

  #dutyToggleBtn {
    min-height: 46px;
    border-radius: 16px;
  }

  .online-team-strip {
    border-radius: 22px;
    padding: 12px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 253, 0.9));
  }

  .online-team-strip > strong {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-right: 1px solid rgba(196, 212, 226, 0.72);
  }

  .team-chip {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    min-height: 40px;
    padding: 6px 12px 6px 7px;
    box-shadow: 0 8px 18px rgba(18, 52, 77, 0.05);
  }

  .status-grid {
    gap: 16px;
  }

  .status-grid article,
  .record-card,
  .checkpoint,
  .timeline-item,
  .dashboard-item {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 252, 254, 0.96));
  }

  .status-grid article {
    min-height: 118px;
    border-radius: 26px;
  }

  .status-grid article::after {
    border-radius: 16px;
    background:
      linear-gradient(135deg, rgba(8, 127, 123, 0.2), rgba(33, 103, 174, 0.08));
  }

  .workspace {
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(18, 52, 77, 0.11);
  }

  .panel {
    border-radius: 26px;
  }

  .panel-head {
    margin-bottom: 16px;
  }

  .tabs {
    gap: 8px;
    border-radius: 24px;
  }

  .tabs button {
    min-height: 46px;
    border-radius: 17px;
    font-size: 14px;
    letter-spacing: 0;
  }

  .tabs button.active {
    transform: translateY(-1px);
  }

  input,
  select,
  textarea {
    border-color: rgba(196, 212, 226, 0.9);
    transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
  }

  input:focus,
  select:focus,
  textarea:focus {
    border-color: rgba(45, 115, 196, 0.64);
    box-shadow: 0 0 0 4px rgba(45, 115, 196, 0.12);
  }

  .record-card {
    border-radius: 22px;
  }

  .record-actions button,
  .comment-form button,
  .quick-actions button {
    border-radius: 15px;
  }

  .report-menu {
    border-radius: 18px;
    box-shadow: 0 20px 46px rgba(18, 52, 77, 0.16);
  }

  .pie-legend {
    border-radius: 24px;
  }

  body.tablet-view .app-shell {
    max-width: 980px;
  }

  body.tablet-view .topbar {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: stretch;
  }

  body.tablet-view .brand-hero {
    min-height: 100%;
    padding: 12px;
  }

  body.tablet-view .brand-logo {
    width: 108px;
    height: 108px;
  }

  body.tablet-view .eyebrow {
    font-size: 13px;
    text-align: center;
  }

  body.tablet-view .top-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 26px;
  }

  body.tablet-view .tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.tablet-view .panel,
  body.tablet-view .workspace,
  body.tablet-view .connection-panel {
    border-radius: 24px;
  }

  body.tablet-view.auth-locked .topbar {
    display: none;
  }

  body.tablet-view.auth-locked .brand-hero {
    width: min(520px, 100%);
    min-height: 150px;
  }

  body.tablet-view.auth-locked .brand-logo {
    width: 132px;
    height: 132px;
  }

  body.tablet-view.auth-locked:not(.request-open):not(.invite-mode) .connection-panel {
    width: min(900px, 100%);
    grid-template-columns: minmax(220px, 0.85fr) minmax(330px, 1.15fr);
  }

  body.tablet-view.auth-locked .auth-card-brand {
    min-height: 260px;
  }

  body.tablet-view.auth-locked .auth-card-brand img {
    width: 132px;
    height: 132px;
  }

  body.mobile-view {
    background:
      radial-gradient(circle at 50% -18%, rgba(45, 115, 196, 0.12), transparent 38%),
      linear-gradient(180deg, #f8fbfd 0, #eef4f8 48%, #e8eff4 100%);
  }

  body.mobile-view::before {
    opacity: 0.52;
  }

  body.mobile-view .app-shell {
    width: 100%;
    padding: 10px 10px 28px;
  }

  body.mobile-view .topbar {
    gap: 10px;
  }

  body.mobile-view .brand-hero,
  body.mobile-view.auth-locked .brand-hero {
    min-height: 116px;
    padding: 8px 10px;
  }

  body.mobile-view .brand-logo,
  body.mobile-view.auth-locked .brand-logo {
    width: 90px;
    height: 90px;
  }

  body.mobile-view.auth-locked .topbar {
    display: none;
  }

  body.mobile-view.auth-locked .brand-hero {
    width: 100%;
  }

  body.mobile-view .eyebrow {
    font-size: 12.5px;
    padding: 0;
    text-align: center;
  }

  body.mobile-view .top-actions {
    border-radius: 24px;
  }

  body.mobile-view .connection-panel,
  body.mobile-view.auth-locked .connection-panel {
    border-radius: 24px;
    gap: 12px;
  }

  body.mobile-view:not(.auth-locked) .connection-panel {
    padding: 12px;
  }

  body.mobile-view:not(.auth-locked) .connection-main {
    display: grid;
    gap: 10px;
  }

  body.mobile-view:not(.auth-locked) .connection-copy {
    min-width: 0;
  }

  body.mobile-view:not(.auth-locked) .auth-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.mobile-view .signed-in-badge,
  body.mobile-view .duty-status-pill,
  body.mobile-view .auth-form button,
  body.mobile-view .auth-form input,
  body.mobile-view .new-user-toggle {
    min-height: 50px;
  }

  body.mobile-view #dutyToggleBtn {
    min-height: 58px;
    border-radius: 20px;
    font-size: 18px;
  }

  body.mobile-view .online-team-strip {
    margin-top: 0;
    padding: 12px;
    border-radius: 22px;
  }

  body.mobile-view .team-chip-row {
    gap: 8px;
  }

  body.mobile-view .team-chip {
    min-height: 42px;
    padding: 6px 12px 6px 7px;
  }

  body.mobile-view .status-grid {
    gap: 9px;
  }

  body.mobile-view .status-grid article {
    min-height: 112px;
    border-radius: 24px;
    padding: 16px;
  }

  body.mobile-view .status-grid strong {
    font-size: 30px;
  }

  body.mobile-view .workspace {
    padding: 10px;
    border-radius: 26px;
  }

  body.mobile-view .tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    border-radius: 24px;
    backdrop-filter: blur(16px);
  }

  body.mobile-view .tabs button {
    min-height: 52px;
    font-size: 13.5px;
    border-radius: 17px;
    padding: 0 12px;
  }

  body.mobile-view .panel {
    padding: 16px;
    border-radius: 24px;
  }

  body.mobile-view .panel-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  body.mobile-view .record-card,
  body.mobile-view .dashboard-item,
  body.mobile-view .visitor-group,
  body.mobile-view .comments-box {
    border-radius: 22px;
  }

  body.mobile-view .grid-form,
  body.mobile-view .stacked-form {
    gap: 11px;
  }

  body.mobile-view input,
  body.mobile-view select,
  body.mobile-view textarea,
  body.mobile-view button {
    min-height: 50px;
  }

  body.mobile-view textarea {
    min-height: 96px;
  }

  body.mobile-view.auth-locked .connection-main {
    min-height: 0;
    padding: 20px;
    border-radius: 22px;
  }

  body.mobile-view.auth-locked.request-open .connection-main {
    margin-bottom: 2px;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .connection-panel {
    width: 100%;
    grid-template-columns: 1fr;
    display: grid;
    overflow: hidden;
  }

  body.mobile-view.auth-locked .auth-card-brand {
    min-height: 190px;
    padding: 16px;
    border-radius: 22px;
  }

  body.mobile-view.auth-locked .auth-card-brand img {
    width: 104px;
    height: 104px;
  }

  body.mobile-view.auth-locked .auth-card-brand strong {
    font-size: 12.5px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .connection-main {
    width: 100%;
    display: grid;
    padding: 18px;
    border-radius: 22px;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .connection-copy {
    width: 100%;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .auth-form {
    width: 100%;
    display: grid;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .login-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #loginEmail,
  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #loginPassword,
  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #loginBtn,
  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #resetPasswordBtn {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #loginBtn {
    order: 3;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) #resetPasswordBtn {
    order: 4;
  }

  body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .new-user-toggle {
    justify-self: stretch;
    width: 100%;
  }
}

@media screen and (max-width: 700px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 12px 10px 28px;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .connection-panel {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 14px !important;
    overflow: hidden !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .auth-card-brand {
    width: 100% !important;
    min-height: 178px !important;
    padding: 16px !important;
    border-radius: 22px !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .auth-card-brand img {
    width: 104px !important;
    height: 104px !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .auth-card-brand strong {
    font-size: 12px !important;
    line-height: 1.2;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .connection-main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    display: grid !important;
    gap: 16px !important;
    padding: 18px !important;
    border-radius: 22px !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .connection-copy,
  body.auth-locked:not(.request-open):not(.invite-mode) .auth-form,
  body.auth-locked:not(.request-open):not(.invite-mode) .login-fields {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) .login-fields {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.auth-locked:not(.request-open):not(.invite-mode) #loginEmail,
  body.auth-locked:not(.request-open):not(.invite-mode) #loginPassword,
  body.auth-locked:not(.request-open):not(.invite-mode) #loginBtn,
  body.auth-locked:not(.request-open):not(.invite-mode) #resetPasswordBtn,
  body.auth-locked:not(.request-open):not(.invite-mode) .new-user-toggle {
    width: 100% !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-self: stretch !important;
  }
}

body.auth-locked .auth-card-brand strong,
body.auth-locked:not(.request-open):not(.invite-mode) .auth-card-brand strong,
body.tablet-view.auth-locked .auth-card-brand strong,
body.mobile-view.auth-locked .auth-card-brand strong,
body.mobile-view.auth-locked:not(.request-open):not(.invite-mode) .auth-card-brand strong {
  display: inline;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:not(.auth-locked):not(.visitor-mode) .connection-panel {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 24px;
}

body:not(.auth-locked):not(.visitor-mode) .connection-copy {
  display: none !important;
}

body:not(.auth-locked):not(.visitor-mode) .connection-main {
  justify-content: flex-end;
}

body:not(.auth-locked):not(.visitor-mode) .auth-form {
  display: grid;
  grid-template-columns: minmax(220px, auto) auto minmax(154px, auto) 1fr minmax(118px, auto);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  width: 100%;
}

body:not(.auth-locked):not(.visitor-mode) .signed-in-badge {
  min-height: 54px;
  max-width: 360px;
  padding: 8px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.92));
  box-shadow: 0 10px 24px rgba(16, 44, 66, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

body:not(.auth-locked):not(.visitor-mode) .signed-in-badge span {
  width: 38px;
  height: 38px;
}

body:not(.auth-locked):not(.visitor-mode) .duty-status-pill {
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 18px;
}

body:not(.auth-locked):not(.visitor-mode) #dutyToggleBtn,
body:not(.auth-locked):not(.visitor-mode) #logoutBtn {
  min-height: 46px;
  border-radius: 18px;
  padding-inline: 20px;
  font-size: 15px;
  font-weight: 950;
}

body:not(.auth-locked):not(.visitor-mode) #logoutBtn {
  grid-column: 5;
  justify-self: end;
  background: linear-gradient(180deg, #ffffff, #f8fbfd);
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(16, 44, 66, 0.07);
}

body:not(.auth-locked):not(.visitor-mode) #logoutBtn:hover {
  border-color: rgba(15, 59, 87, 0.28);
  background: #fff;
}

body.tablet-view:not(.auth-locked):not(.visitor-mode) .auth-form {
  grid-template-columns: minmax(240px, auto) auto auto 1fr auto;
  justify-content: stretch;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .connection-panel {
  padding: 14px;
  gap: 12px;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .connection-main {
  display: block;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .auth-form {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .signed-in-badge {
  grid-column: 1 / -1;
  width: 100%;
  max-width: none;
  min-height: 58px;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .duty-status-pill,
body.mobile-view:not(.auth-locked):not(.visitor-mode) #logoutBtn {
  width: 100%;
  min-height: 52px;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) #dutyToggleBtn {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 62px;
  border-radius: 22px;
  font-size: 19px;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) #logoutBtn {
  grid-column: 2;
  justify-self: stretch;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .duty-status-pill {
  grid-column: 1;
}

body.mobile-view:not(.auth-locked):not(.visitor-mode) .online-team-strip {
  padding: 14px;
  border-radius: 24px;
}

body.account-compact:not(.visitor-mode) .connection-panel {
  display: grid !important;
  grid-template-columns: 1fr !important;
  align-items: start !important;
  align-content: start !important;
  height: auto !important;
  min-height: 0 !important;
  gap: 10px !important;
  padding: 14px 16px !important;
  overflow: visible !important;
}

body.account-compact:not(.visitor-mode) .connection-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}

body.account-compact:not(.visitor-mode) .auth-form {
  min-height: 0 !important;
  align-items: center !important;
}

body.account-compact:not(.visitor-mode) .online-team-strip {
  margin-top: 0 !important;
}

body.tablet-view.account-compact:not(.visitor-mode) .connection-panel {
  padding: 14px !important;
}

body.mobile-view.account-compact:not(.visitor-mode) .connection-panel {
  padding: 12px !important;
}

@media (min-width: 1101px) {
  .top-actions.report-panel {
    display: grid;
    grid-template-columns: repeat(5, minmax(118px, 1fr));
    align-items: end;
  }

  .top-actions.report-panel .report-panel-title {
    grid-column: 1 / -1;
  }

  .top-actions.report-panel .case-search {
    grid-column: span 2;
    min-width: 0;
  }

  .top-actions.report-panel .date-filter,
  .top-actions.report-panel .report-multi,
  .top-actions.report-panel .check-filter,
  .top-actions.report-panel > button {
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  .top-actions.report-panel {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    align-items: end !important;
    min-height: 0 !important;
  }

  .top-actions.report-panel .report-panel-title,
  .top-actions.report-panel .case-search {
    grid-column: 1 / -1 !important;
  }

  .top-actions.report-panel .case-search {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0 !important;
  }

  .top-actions.report-panel .date-filter,
  .top-actions.report-panel .report-multi,
  .top-actions.report-panel .check-filter,
  .top-actions.report-panel > button,
  .top-actions.report-panel input {
    width: 100% !important;
    min-width: 0 !important;
  }

  .compliance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .top-actions.report-panel {
    grid-template-columns: 1fr !important;
  }

  .top-actions.report-panel .case-search {
    grid-template-columns: 1fr !important;
  }

  .compliance-grid {
    grid-template-columns: 1fr;
  }

  .staff-profile-form {
    grid-template-columns: 1fr !important;
  }
}

body.mobile-view #patrols .split,
body.tablet-view #patrols .split {
  grid-template-columns: 1fr !important;
}

body.mobile-view #patrols .panel,
body.tablet-view #patrols .panel {
  min-width: 0;
  overflow: hidden;
}

body.mobile-view #patrols,
body.tablet-view #patrols {
  width: 100%;
  overflow-x: hidden;
}

body.mobile-view #patrols .panel-head,
body.tablet-view #patrols .panel-head {
  align-items: stretch;
  gap: 14px;
}

body.mobile-view #patrols .panel-head .record-actions,
body.tablet-view #patrols .panel-head .record-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

body.mobile-view .scanner-box,
body.tablet-view .scanner-box {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border-radius: 18px;
  overflow: hidden;
}

body.mobile-view .scanner-box.active,
body.tablet-view .scanner-box.active {
  display: grid;
  gap: 10px;
}

body.mobile-view .scanner-box video,
body.tablet-view .scanner-box video {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(56vh, 420px);
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  object-fit: cover;
}

body.mobile-view .scanner-box .record-actions,
body.tablet-view .scanner-box .record-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

body.mobile-view #qrScannerStatus,
body.tablet-view #qrScannerStatus {
  display: block;
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

body.mobile-view #patrols,
body.mobile-view #patrols *,
body.tablet-view #patrols,
body.tablet-view #patrols * {
  box-sizing: border-box;
  max-width: 100%;
}

body.mobile-view #patrols .checkpoint-list,
body.tablet-view #patrols .checkpoint-list {
  width: 100%;
  min-width: 0;
}

body.mobile-view #patrols .checkpoint,
body.tablet-view #patrols .checkpoint {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  gap: 12px;
}

body.mobile-view #patrols .checkpoint > *,
body.tablet-view #patrols .checkpoint > * {
  min-width: 0;
  width: 100%;
}

body.mobile-view #patrols .checkpoint .record-title,
body.mobile-view #patrols .checkpoint .meta,
body.tablet-view #patrols .checkpoint .record-title,
body.tablet-view #patrols .checkpoint .meta {
  overflow-wrap: anywhere;
  word-break: normal;
}

body.mobile-view #patrols .checkpoint .record-actions,
body.tablet-view #patrols .checkpoint .record-actions {
  display: grid !important;
  grid-template-columns: 1fr;
}

body.mobile-view #patrols .checkpoint button,
body.tablet-view #patrols .checkpoint button {
  width: 100%;
  min-width: 0;
}

body.mobile-view #patrols .comments-box,
body.tablet-view #patrols .comments-box {
  width: 100%;
}

@media (max-width: 900px) {
  .ai-layout {
    grid-template-columns: 1fr;
  }

  .ai-output {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .ai-action-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .top-actions,
  .tabs,
  form,
  button {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .tab-panel {
    display: block;
  }
}
