:root {
  color-scheme: light;
  --pf-blue: #003e7e;
  --pf-blue-hover: #075aa7;
  --pf-blue-dark: #062b55;
  --pf-blue-soft: #e7eff7;
  --pf-gold: #f7c400;
  --pf-ink: #172233;
  --pf-muted: #687789;
  --pf-line: #d8e0ea;
  --pf-bg: #f8fafc;
  --pf-white: #ffffff;
  --radius: 1mm;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--pf-bg);
  color: var(--pf-ink);
}

body[data-view="check-in"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
  background: #ffffff;
  opacity: 0;
  transition: opacity 1s ease;
}

body[data-view="check-in"].checkin-capture-light::before {
  opacity: 1;
}

body[data-view="check-in"].checkin-capture-light #checkinStaffModal,
body[data-view="check-in"].checkin-capture-light #visitorCheckinModal {
  background: transparent;
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  cursor: pointer;
}

body.auth-pending .app-shell,
body.signed-out .app-shell,
body.signed-in .login-view,
body.auth-pending .login-view {
  display: none;
}

.staff-directory-table .employee-portal-access-action {
  min-width: 112px;
  white-space: nowrap;
}

.employee-portal-access-panel {
  width: min(620px, calc(100vw - 32px));
}

.employee-portal-access-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.employee-portal-access-details > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid #d4dee8;
  border-radius: 6px;
  background: #f7f9fb;
}

.employee-portal-access-details dt {
  margin: 0 0 6px;
  color: #5b7189;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.employee-portal-access-details dd {
  margin: 0;
  color: #002b57;
  font-size: 19px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.employee-portal-code-result {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin: 0 0 20px;
  padding: 18px;
  border: 1px solid #e0b300;
  border-left-width: 5px;
  border-radius: 6px;
  background: #fffbea;
}

.employee-portal-code-result > span {
  color: #5b7189;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.employee-portal-code-result strong {
  color: #002b57;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.employee-portal-code-result p {
  margin: 0;
  color: #536d87;
  font-size: 14px;
}

.employee-portal-access-actions {
  align-items: center;
}

.employee-portal-access-actions .danger-action {
  margin-right: auto;
}

@media (max-width: 620px) {
  .employee-portal-access-details {
    grid-template-columns: 1fr;
  }

  .employee-portal-access-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .employee-portal-access-actions .inline-action {
    width: 100%;
  }
}

.boot-view {
  display: none;
}

body.auth-pending .boot-view {
  display: grid;
  min-height: 100vh;
  place-content: center;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  background: var(--pf-white);
  color: var(--pf-blue-dark);
}

.boot-view img {
  width: min(240px, 62vw);
}

.boot-view p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.boot-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid var(--pf-blue-soft);
  border-top-color: var(--pf-gold);
  border-radius: 50%;
  animation: boot-spinner-turn 800ms linear infinite;
}

@keyframes boot-spinner-turn {
  to {
    transform: rotate(360deg);
  }
}

.login-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-card {
  display: grid;
  gap: 18px;
  justify-items: center;
  width: min(480px, 100%);
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 34px;
  background: var(--pf-white);
  box-shadow: 0 18px 45px rgba(6, 43, 85, 0.08);
  text-align: center;
}

.login-card img {
  width: 180px;
}

.login-card h1 {
  margin: 6px 0 0;
  color: var(--pf-blue-dark);
  font-size: 31px;
  font-weight: 600;
}

.login-card p,
.login-note {
  margin: 0;
  color: var(--pf-muted);
  line-height: 1.45;
}

.login-note {
  font-size: 12px;
}

.kiosk-activation-form {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 18px 0;
  border-top: 1px solid var(--pf-line);
  border-bottom: 1px solid var(--pf-line);
  text-align: left;
}

.kiosk-activation-heading {
  display: grid;
  gap: 5px;
}

.kiosk-activation-heading h2 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 18px;
}

.kiosk-activation-heading p {
  font-size: 13px;
}

.kiosk-activation-form .modal-field > span {
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

#kioskActivationCode {
  min-height: 48px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.kiosk-activation-form .form-status {
  min-height: 0;
  text-align: center;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
  flex: 1;
  height: 1px;
  background: var(--pf-line);
  content: "";
}

.primary-action {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
  font-weight: 700;
  padding: 0 14px;
  transition: background 160ms ease, box-shadow 160ms ease, color 160ms ease, border-color 160ms ease;
}

.primary-action:hover,
.primary-action:focus-visible,
.field-button:hover,
.field-button:focus-visible,
.batch-get-button:hover,
.batch-get-button:focus-visible,
.modal-search button:hover,
.modal-search button:focus-visible,
.modal-results button:hover,
.modal-results button:focus-visible {
  background: var(--pf-blue-hover);
  border-color: var(--pf-blue-hover);
  box-shadow: 0 0 9px rgba(255, 204, 0, 0.68);
  color: var(--pf-white);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 58px;
  padding: 0 28px;
  border-bottom: 1px solid var(--pf-line);
  background: var(--pf-white);
  box-shadow: 0 3px 8px rgba(6, 43, 85, 0.045);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
  color: var(--pf-blue);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 136px;
  height: auto;
}

.brand span {
  padding-left: 10px;
  border-left: 1px solid var(--pf-line);
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 58px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 104px;
  min-height: 58px;
  padding: 0 12px;
  background: transparent;
  color: var(--pf-blue-dark);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: box-shadow 160ms ease, color 160ms ease;
  white-space: nowrap;
}

.nav-link[data-tab="backend-permissions"] {
  min-width: 132px;
}

.nav-icon {
  display: none;
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.nav-link::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 4px;
  background: transparent;
  content: "";
}

.nav-link.active,
.nav-link:hover {
  color: var(--pf-blue);
}

.nav-link:hover,
.nav-link:focus-visible {
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.42);
}

.nav-link.active::after {
  background: var(--pf-gold);
}

.topbar-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.mode-switcher,
.language-switcher {
  display: inline-flex;
  gap: 2px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 2px;
  background: var(--pf-white);
}

.mode-option,
.language-option {
  min-width: 34px;
  min-height: 28px;
  background: transparent;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 600;
}

.mode-option {
  min-width: 56px;
}

.mode-option.active {
  background: var(--pf-blue-dark);
  color: var(--pf-white);
}

.language-option.active {
  background: var(--pf-blue);
  color: var(--pf-white);
}

.mode-option:hover,
.mode-option:focus-visible,
.language-option:hover,
.language-option:focus-visible {
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.42);
}

.message-button,
.user-chip,
.logout-button {
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.message-button {
  position: relative;
}

.message-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.message-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--pf-white);
  border-radius: 50%;
  background: var(--pf-gold);
  opacity: 0;
}

.message-button.has-unread .message-dot {
  opacity: 1;
  animation: pulse-message 1.5s ease-in-out infinite;
}

@keyframes pulse-message {
  0% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(247, 196, 0, 0.65);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(247, 196, 0, 0);
  }
  100% {
    transform: scale(0.85);
    box-shadow: 0 0 0 0 rgba(247, 196, 0, 0);
  }
}

.logout-button {
  padding: 0 8px;
}

.logout-button:hover,
.logout-button:focus-visible,
.modal-close:hover,
.modal-close:focus-visible,
.file-row button:hover,
.file-row button:focus-visible,
.doc-action-buttons button:not(.primary-action):hover,
.doc-action-buttons button:not(.primary-action):focus-visible {
  box-shadow: 0 0 6px rgba(210, 43, 43, 0.42);
  color: #9d1b1b;
}

.workspace {
  min-height: calc(100vh - 58px);
  padding: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.workspace-main {
  grid-column: 1;
  min-width: 0;
  padding: 24px 28px;
}

.face-lab-layout {
  display: grid;
  gap: 18px;
}

.face-lab-toolbar {
  order: 10;
}

.face-camera-panel {
  order: 20;
}

.face-lab-diagnostic-settings {
  order: 25;
}

.face-lab-actions {
  order: 30;
}

.face-lab-results {
  order: 40;
}

.face-enrolled-heading {
  order: 50;
}

#faceLabGrid {
  order: 60;
}

.face-audit-heading {
  order: 70;
}

#faceAuditGrid {
  order: 80;
}

.face-lab-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--pf-line);
  padding-bottom: 14px;
}

.face-lab-toolbar h2,
.face-lab-form h3 {
  margin: 0;
  color: var(--pf-blue-dark);
}

.face-lab-toolbar p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--pf-muted);
  line-height: 1.45;
}

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

.face-camera-panel {
  display: grid;
  grid-template-columns: minmax(260px, 440px) minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 14px;
}

.face-camera-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #0f172a;
}

.face-camera-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.face-camera-crop-guide {
  --face-lab-crop-size: 50%;
  --face-lab-crop-center-y: 50%;
  position: absolute;
  top: var(--face-lab-crop-center-y);
  left: 50%;
  height: var(--face-lab-crop-size);
  aspect-ratio: 1;
  border: 2px solid var(--pf-gold);
  box-shadow: 0 0 0 999px rgba(2, 17, 35, 0.48), 0 0 12px rgba(247, 196, 0, 0.72);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.face-camera-crop-guide.is-full-frame {
  inset: 0;
  width: auto;
  height: auto;
  aspect-ratio: auto;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.face-camera-control-stack {
  display: grid;
  gap: 12px;
}

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

.face-export-sample-button {
  grid-column: 1 / -1;
}

.face-lab-diagnostic-settings {
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 14px 16px 16px;
}

.face-lab-diagnostic-settings > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--pf-line);
  padding-bottom: 10px;
}

.face-lab-diagnostic-settings > header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.face-lab-diagnostic-settings h3 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 15px;
}

.face-lab-local-badge {
  border-radius: 999px;
  background: #e8f3ec;
  color: #176239;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}

.face-lab-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding-top: 12px;
}

.face-lab-diagnostic-grid label {
  display: grid;
  align-content: start;
  gap: 6px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
}

.face-lab-diagnostic-grid select {
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 0 10px;
  font: inherit;
}

.face-lab-range-field > div {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 44px;
  align-items: center;
  min-height: 38px;
  gap: 8px;
}

.face-lab-range-field input {
  width: 100%;
  accent-color: var(--pf-blue);
}

.face-lab-range-field output {
  color: var(--pf-blue-dark);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.face-lab-form {
  display: grid;
  gap: 12px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 16px;
}

.face-lab-form label {
  display: grid;
  gap: 6px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
}

.face-lab-form input,
.face-lab-form select {
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 0 10px;
  font: inherit;
}

.face-result-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--pf-line);
  border-left: 4px solid var(--pf-muted);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 12px 14px;
  color: var(--pf-muted);
}

.face-result-summary.matched {
  border-left-color: #15803d;
}

.face-result-summary strong {
  color: var(--pf-blue-dark);
}

.face-diagnostic-result {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  margin-top: 12px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 14px;
}

.face-diagnostic-capture {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #0f172a;
  object-fit: cover;
}

.face-diagnostic-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
}

.face-diagnostic-metric {
  display: grid;
  align-content: center;
  min-height: 62px;
  border-left: 3px solid var(--pf-line);
  background: #f7f9fc;
  padding: 8px 10px;
}

.face-diagnostic-metric span {
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 700;
}

.face-diagnostic-metric strong {
  margin-top: 3px;
  color: var(--pf-blue-dark);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.face-expected-summary {
  grid-column: 1 / -1;
  border-left-color: var(--pf-gold);
}

.face-candidate-row.is-expected {
  box-shadow: inset 4px 0 0 var(--pf-gold);
}

.face-expected-label {
  display: inline-block;
  margin-left: 8px;
  border-radius: 999px;
  background: #fff4c2;
  color: #6b5300;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.face-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--pf-line);
  padding-bottom: 8px;
}

.face-section-heading h3 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 15px;
}

.face-enrollment-launchers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 240px));
  gap: 12px;
}

.face-enrollment-launcher {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  padding: 10px 12px 10px 16px;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.face-enrollment-launcher:hover,
.face-enrollment-launcher:focus-visible {
  border-color: rgba(6, 43, 85, 0.42);
  box-shadow: 0 5px 14px rgba(6, 43, 85, 0.1);
  transform: translateY(-1px);
}

.face-enrollment-launcher strong {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef5fb;
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.modal-panel.face-enrollment-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(900px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
}

.face-enrollment-list {
  min-height: 150px;
  overflow: auto;
  border-top: 1px solid var(--pf-line);
}

.face-enrollment-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, auto) auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  border-bottom: 1px solid var(--pf-line);
  padding: 12px 2px;
}

.face-enrollment-person h3 {
  margin: 0 0 4px;
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.face-enrollment-person p,
.face-enrollment-meta > span:not(.badge) {
  margin: 0;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.4;
}

.face-enrollment-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 7px;
}

.face-enrollment-row-actions {
  display: grid;
  gap: 8px;
}

.face-enrollment-row-actions .inline-action {
  min-width: 138px;
  width: 100%;
}

.face-enrollment-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  color: var(--pf-muted);
  text-align: center;
}

.face-worker-row,
.face-audit-row,
.face-candidate-row {
  grid-template-columns: minmax(240px, 1fr) auto auto minmax(130px, auto);
}

.face-worker-row {
  grid-template-columns: minmax(240px, 1fr) auto auto minmax(130px, auto) minmax(130px, auto);
}

.danger-action {
  border-color: rgba(185, 28, 28, 0.28);
  color: #991b1b;
}

.danger-action:hover:not(:disabled) {
  border-color: rgba(185, 28, 28, 0.5);
  background: #fef2f2;
}

.checkin-kiosk-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 18, 47, 0.18), rgba(7, 18, 47, 0.38)),
    url("assets/checkin-background.jpg") center / cover no-repeat;
  color: #07182f;
}

.checkin-kiosk-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-height: 100vh;
  padding: clamp(22px, 4vw, 48px);
  user-select: none;
}

.checkin-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.checkin-connectivity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: min(56vw, 360px);
  padding: 0 13px;
  border: 1px solid rgba(6, 43, 85, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #26384d;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(6, 43, 85, 0.16);
}

.checkin-connectivity-dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d49a00;
  box-shadow: 0 0 0 4px rgba(212, 154, 0, 0.16);
}

.checkin-connectivity[data-state="online"] .checkin-connectivity-dot {
  background: #178347;
  box-shadow: 0 0 0 4px rgba(23, 131, 71, 0.16);
}

.checkin-connectivity[data-state="offline"] .checkin-connectivity-dot,
.checkin-connectivity[data-state="server"] .checkin-connectivity-dot {
  background: #c56f00;
  box-shadow: 0 0 0 4px rgba(197, 111, 0, 0.16);
}

.checkin-connectivity[data-state="database"] .checkin-connectivity-dot,
.checkin-connectivity[data-state="session"] .checkin-connectivity-dot,
.checkin-connectivity.has-sync-error .checkin-connectivity-dot {
  background: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
}

.checkin-connectivity-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-sync-diagnostics {
  position: absolute;
  z-index: 24;
  top: clamp(70px, 10vh, 96px);
  left: clamp(22px, 4vw, 48px);
  width: min(calc(100vw - 44px), 760px);
  max-height: min(36vh, 300px);
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.4);
  border-left: 5px solid #b42318;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(7, 24, 47, 0.26);
  color: #431407;
  user-select: text;
}

.checkin-sync-diagnostics strong {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}

.checkin-sync-diagnostics pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.checkin-staff-button {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  border: 1px solid rgba(255, 204, 0, 0.48);
  background: rgba(255, 255, 255, 0.76);
  color: var(--pf-blue-dark);
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 700;
  padding: 0 18px;
  box-shadow:
    0 0 18px rgba(255, 204, 0, 0.52),
    0 12px 28px rgba(6, 43, 85, 0.22);
  transition: opacity 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  touch-action: manipulation;
}

.checkin-staff-button::before {
  content: "";
  position: absolute;
  top: -24px;
  right: -28px;
  bottom: -24px;
  left: -28px;
  background: transparent;
}

.checkin-staff-button:disabled {
  cursor: default;
  opacity: 0.42;
  filter: grayscale(0.45) saturate(0.5);
  pointer-events: none;
  box-shadow: none;
}

.checkin-staff-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.checkin-welcome-stack {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(20px, 4vw, 36px);
  padding-top: clamp(10px, 5vh, 54px);
  padding-bottom: clamp(18px, 4vh, 54px);
  text-align: center;
}

.checkin-logo {
  width: min(420px, 56vw);
  max-height: 140px;
}

.checkin-welcome-stack h1 {
  margin: 0;
  color: #050505;
  font-size: clamp(24px, 3.5vw, 41px);
  font-weight: 800;
  letter-spacing: 0;
  text-shadow:
    0 0 10px rgba(255, 204, 0, 0.98),
    0 0 26px rgba(255, 184, 0, 0.84),
    0 2px 6px rgba(255, 255, 255, 0.82);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.checkin-actions {
  display: grid;
  gap: clamp(18px, 2.4vw, 26px);
  justify-self: center;
  width: min(600px, 74vw);
  margin-top: clamp(16px, 3vh, 42px);
  padding-bottom: clamp(24px, 5vh, 64px);
}

.checkin-action {
  position: relative;
  z-index: 1;
  min-height: clamp(72px, 8.2vw, 94px);
  border-radius: 999px;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0;
  box-shadow:
    0 0 24px rgba(255, 204, 0, 0.58),
    0 18px 38px rgba(6, 43, 85, 0.28);
  touch-action: manipulation;
}

.checkin-action::before {
  content: "";
  position: absolute;
  top: -8px;
  right: -18px;
  bottom: -8px;
  left: -18px;
  background: transparent;
}

.checkin-action-primary {
  background: #061a44;
  color: var(--pf-white);
  border: 1px solid rgba(255, 204, 0, 0.42);
}

.checkin-action-secondary {
  border: 1px solid rgba(255, 204, 0, 0.5);
  background: rgba(255, 255, 255, 0.92);
  color: #061a44;
}

.checkin-status {
  min-height: 22px;
  margin: 0;
  color: var(--pf-muted);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.checkin-engine-loading {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 20px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.9);
  color: #061a44;
  text-align: center;
}

.checkin-engine-loading strong {
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0;
}

.checkin-engine-spinner {
  width: 54px;
  height: 54px;
  border: 6px solid rgba(6, 43, 85, 0.16);
  border-top-color: var(--pf-gold);
  border-radius: 50%;
  animation: checkin-engine-spin 0.8s linear infinite;
}

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

.checkin-staff-panel {
  width: min(860px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 36px));
  overflow: visible;
}

.modal-panel.checkin-staff-panel {
  gap: 10px;
  padding-top: 14px;
}

.checkin-visitor-panel {
  width: min(920px, calc(100vw - 48px));
  max-height: min(820px, calc(100vh - 36px));
  overflow: visible;
}

.checkin-staff-panel .modal-title-row,
.checkin-visitor-panel .modal-title-row {
  justify-content: center;
  text-align: center;
}

.checkin-staff-panel .modal-title-row {
  margin-top: -6px;
  margin-bottom: -2px;
}

.checkin-staff-panel .modal-title-row > div,
.checkin-visitor-panel .modal-title-row > div {
  width: 100%;
}

.checkin-staff-panel h2,
.checkin-visitor-panel h2 {
  font-size: clamp(21px, 2.8vw, 30px);
  line-height: 1.15;
}

.checkin-staff-panel .modal-title-row span,
.checkin-visitor-panel .modal-title-row span {
  display: block;
  color: var(--pf-blue-dark);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.12;
}

.checkin-worker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 250px);
  gap: 12px;
  align-items: stretch;
  justify-self: center;
  width: min(760px, 100%);
}

.checkin-worker-search-wrap {
  position: relative;
  display: grid;
  align-content: start;
  min-width: 0;
}

.checkin-worker-search-wrap input,
.checkin-modal-submit {
  min-height: 72px;
  height: 72px;
  font-size: 27px;
}

.checkin-worker-search-wrap input {
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  color: var(--pf-ink);
  padding: 0 14px;
  text-align: center;
}

.checkin-modal-submit {
  position: relative;
  z-index: 1;
  padding: 0 18px;
  touch-action: manipulation;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, opacity 160ms ease, filter 160ms ease;
}

.checkin-modal-submit.is-pending {
  pointer-events: none;
  filter: saturate(0.55);
}

.checkin-modal-submit::before {
  content: "";
  position: absolute;
  top: -12px;
  right: -16px;
  bottom: -12px;
  left: -5px;
  background: transparent;
}

.checkin-staff-panel .checkin-camera-meta,
.checkin-visitor-panel .checkin-camera-meta,
.checkin-staff-panel #checkinStaffStatus {
  display: none !important;
}

.checkin-visitor-panel #visitorCheckinStatus {
  display: none !important;
}

.checkin-modal-submit.checkin-modal-submit-out,
.checkin-modal-submit.checkin-modal-submit-out:hover,
.checkin-modal-submit.checkin-modal-submit-out:focus-visible,
.checkin-modal-submit.checkin-modal-submit-out:disabled {
  border-color: #8f1f1f;
  background: #8f1f1f;
  color: var(--pf-white);
}

.checkin-worker-suggestions,
.visitor-host-suggestions,
.visitor-company-suggestions,
.visitor-name-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 6;
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  box-shadow: 0 18px 36px rgba(6, 43, 85, 0.18);
}

.visitor-host-suggestions,
.visitor-company-suggestions {
  top: auto;
  bottom: calc(100% + 6px);
  box-shadow: 0 -18px 36px rgba(6, 43, 85, 0.18);
}

.visitor-host-suggestions.opens-below,
.visitor-company-suggestions.opens-below {
  top: calc(100% + 6px);
  bottom: auto;
  box-shadow: 0 18px 36px rgba(6, 43, 85, 0.18);
}

.checkin-worker-suggestions button,
.visitor-host-suggestions button,
.visitor-company-suggestions button,
.visitor-name-suggestions button {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
  color: var(--pf-blue-dark);
  padding: 11px 13px;
  text-align: left;
}

.checkin-worker-suggestions button:hover,
.checkin-worker-suggestions button:focus-visible,
.visitor-host-suggestions button:hover,
.visitor-host-suggestions button:focus-visible,
.visitor-company-suggestions button:hover,
.visitor-company-suggestions button:focus-visible,
.visitor-name-suggestions button:hover,
.visitor-name-suggestions button:focus-visible {
  background: var(--pf-blue-soft);
  outline: 0;
}

.checkin-worker-suggestions button span,
.visitor-host-suggestions button span,
.visitor-company-suggestions button span,
.visitor-name-suggestions button span,
.checkin-worker-empty {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 600;
}

.checkin-worker-empty {
  padding: 12px 13px;
}

.checkin-camera-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 12px;
}

.checkin-visitor-modal.manual-entry-mode .checkin-camera-card {
  border: 0;
  background: transparent;
  padding: 0;
}

.checkin-visitor-modal.manual-entry-mode .checkin-camera-crop,
.checkin-visitor-modal.manual-entry-mode .checkin-camera-meta {
  display: none !important;
}

.checkin-camera-crop {
  position: relative;
  display: block;
  justify-self: center;
  width: min(100%, 46vh, 500px);
  max-width: 500px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #0f172a;
}

.checkin-camera-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scaleX(-1) scale(2);
  transform-origin: center;
  transition: opacity 360ms ease;
}

.checkin-camera-crop.camera-preview-visible video {
  opacity: 1;
}

.visitor-checkout-message {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(100%, 46vh, 500px);
  min-height: min(46vh, 500px);
  color: var(--pf-blue-dark);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  padding: 28px;
  text-align: center;
}

.visitor-active-visit-prompt {
  display: grid;
  align-content: center;
  justify-items: center;
  justify-self: center;
  gap: 30px;
  width: min(760px, 100%);
  min-height: min(46vh, 500px);
  text-align: center;
}

.visitor-active-visit-prompt p {
  max-width: 720px;
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
}

.visitor-active-visit-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(520px, 100%);
}

.visitor-active-visit-actions button {
  min-height: 72px;
  font-size: 27px;
  font-weight: 800;
}

.visitor-active-visit-no {
  border: 1px solid var(--pf-blue);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
}

.visitor-active-visit-no:hover,
.visitor-active-visit-no:focus-visible {
  background: var(--pf-blue-soft);
  box-shadow: 0 0 9px rgba(255, 204, 0, 0.68);
}

.checkin-camera-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
}

.checkin-camera-meta .error {
  color: #9d1b1b;
}

.checkin-visitor-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-self: center;
  width: min(760px, 100%);
}

.visitor-instruction-modal {
  z-index: 55;
  padding: 28px;
  background: rgba(255, 255, 255, 0.97);
}

.visitor-instruction-panel {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 18px;
  width: min(920px, calc(100vw - 56px));
  max-height: calc(100vh - 56px);
  overflow: auto;
  border-top: 7px solid var(--pf-gold);
  border-right: 1px solid var(--pf-line);
  border-bottom: 1px solid var(--pf-line);
  border-left: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 42px 54px 28px;
  box-shadow: 0 18px 50px rgba(6, 43, 85, 0.2);
  color: var(--pf-ink);
  text-align: center;
}

.checkin-status.is-prominent {
  justify-self: center;
  width: min(680px, 86vw);
  min-height: 54px;
  border: 1px solid rgba(255, 204, 0, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--pf-blue-dark);
  padding: 12px 18px;
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.2;
  box-shadow: 0 0 18px rgba(255, 204, 0, 0.48), 0 12px 30px rgba(6, 43, 85, 0.2);
}

.visitor-instruction-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 18px;
  font-weight: 900;
}

.visitor-instruction-success {
  color: #177343;
  font-size: 18px;
  font-weight: 800;
}

.visitor-instruction-panel h2 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.15;
}

.visitor-instruction-message {
  max-width: 780px;
  color: #24364a;
  font-size: clamp(21px, 2.7vw, 30px);
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-wrap;
}

.visitor-instruction-media {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  justify-self: stretch;
  width: 100%;
  min-height: 0;
}

.visitor-instruction-media img,
.visitor-instruction-media iframe {
  display: block;
  width: 100%;
  max-height: 48vh;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  object-fit: contain;
}

.visitor-instruction-media iframe {
  height: 48vh;
  max-width: none;
  justify-self: stretch;
}

.visitor-instruction-pdf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  width: 100%;
  height: 48vh;
  max-height: 48vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #dfe4ea;
  -webkit-overflow-scrolling: touch;
}

.visitor-instruction-pdf[hidden] {
  display: none;
}

.visitor-instruction-pdf canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--pf-white);
}

.visitor-instruction-pdf-loading {
  align-self: center;
  justify-self: center;
  color: var(--pf-muted);
  font-size: 18px;
  font-weight: 800;
}

.visitor-instruction-file {
  width: auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-instruction-position {
  min-height: 18px;
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 720px) {
  .visitor-instruction-modal {
    padding: 14px;
  }

  .visitor-instruction-panel {
    width: calc(100vw - 28px);
    max-height: calc(100vh - 28px);
    padding: 38px 20px 22px;
  }
}

.visitor-contact-fields {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 12px;
}

.checkin-visitor-form .modal-field > span,
.checkin-visitor-form .modal-field > label,
.visitor-name-step .modal-field > span,
.visitor-consent-row {
  color: var(--pf-blue-dark);
  font-size: 18px;
  font-weight: 800;
}

.visitor-name-step {
  position: relative;
  justify-self: center;
  width: min(760px, 100%);
}

.visitor-name-step input,
.checkin-visitor-form input:not([type="checkbox"]),
.checkin-visitor-form .modal-field select,
.checkin-visitor-submit,
.checkin-visitor-next {
  min-height: 72px;
  font-size: 27px;
}

.visitor-name-step input,
.checkin-visitor-form input:not([type="checkbox"]),
.checkin-visitor-form .modal-field select {
  text-align: center;
}

.checkin-worker-search-wrap.is-changeable input,
.visitor-name-field.is-changeable input {
  cursor: pointer;
}

.checkin-worker-change {
  justify-self: center;
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--pf-muted);
  padding: 4px 12px 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.checkin-worker-change:hover,
.checkin-worker-change:focus-visible {
  background: transparent;
  color: var(--pf-blue-dark);
  box-shadow: none;
  outline: 2px solid rgba(255, 204, 0, 0.72);
  outline-offset: 1px;
}

.checkin-worker-change[hidden] {
  display: none;
}

.checkin-worker-search-wrap input,
.visitor-name-step input {
  font-size: 40px;
}

.visitor-host-field,
.visitor-company-field,
.visitor-consent-row,
.checkin-visitor-submit {
  grid-column: 1 / -1;
}

.visitor-host-field,
.visitor-company-field {
  position: relative;
}

.visitor-consent-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(247, 196, 0, 0.46);
  border-radius: var(--radius);
  background: #fffbed;
  color: #172233;
  line-height: 1.35;
  padding: 12px;
}

.visitor-consent-row input {
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
}

.checkin-visitor-next {
  justify-self: center;
  width: min(520px, 100%);
  margin-top: 4px;
}

.checkin-visitor-submit {
  min-height: 72px;
  font-size: 27px;
}

.checkin-hidden-zone {
  position: absolute;
  z-index: 29;
  opacity: 0;
}

.checkin-admin-zone {
  top: 0;
  left: 0;
  width: 112px;
  height: 112px;
}

body.checkin-evacuation-mode .checkin-status {
  color: #9d1b1b;
}

.modal.evacuation-confirm-modal {
  z-index: 10000;
  background: rgba(17, 24, 39, 0.72);
}

.evacuation-confirm-panel {
  justify-items: center;
  width: min(560px, calc(100vw - 40px));
  padding: 36px;
  text-align: center;
}

.evacuation-confirm-panel h2 {
  margin: 0;
  color: #8f1616;
  font-size: 38px;
  letter-spacing: 0;
}

.evacuation-confirm-panel p {
  min-height: 24px;
  margin: 0;
  color: var(--pf-muted);
  font-size: 20px;
  font-weight: 700;
}

.evacuation-confirm-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 18px;
  width: 100%;
}

.evacuation-confirm-actions button {
  min-height: 72px;
  font-size: 26px;
  font-weight: 800;
}

.evacuation-confirm-yes {
  background: #a61b1b;
}

.evacuation-screen {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f4f6f8;
  color: #172233;
}

.evacuation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 132px;
  background: #8f1616;
  color: #ffffff;
  padding: 20px 28px;
  box-shadow: 0 4px 18px rgba(83, 13, 13, 0.28);
}

.evacuation-header h1 {
  margin: 2px 0 0;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}

.evacuation-header p {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 700;
}

.evacuation-alarm-label {
  color: #ffda44;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.evacuation-summary {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 220px;
  text-align: right;
}

.evacuation-summary strong {
  font-size: 38px;
  line-height: 1;
}

.evacuation-network {
  min-height: 20px;
  color: #ffef9a;
  font-weight: 800;
}

.evacuation-body {
  min-height: 0;
  overflow: auto;
  padding: 22px 26px;
  overscroll-behavior: contain;
}

.evacuation-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 16px;
}

.evacuation-toolbar label {
  font-size: 16px;
  font-weight: 800;
}

.evacuation-toolbar select {
  width: min(240px, 50vw);
  min-height: 48px;
  border: 1px solid #aeb9c7;
  border-radius: var(--radius);
  background: #ffffff;
  color: #172233;
  font-size: 17px;
  font-weight: 700;
}

.evacuation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  align-content: start;
}

.evacuation-person {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  min-height: 126px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  background: #b42318;
  color: #ffffff;
  padding: 16px;
  text-align: left;
  box-shadow: 0 7px 16px rgba(73, 14, 14, 0.2);
}

.evacuation-person.safe {
  background: #157347;
  box-shadow: 0 7px 16px rgba(11, 75, 44, 0.2);
}

.evacuation-person-type {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.evacuation-person strong {
  align-self: center;
  font-size: 23px;
  line-height: 1.15;
}

.evacuation-person-meta {
  display: grid;
  gap: 2px;
  font-size: 13px;
  opacity: 0.9;
}

.evacuation-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  color: var(--pf-muted);
  font-size: 24px;
  font-weight: 800;
  text-align: center;
}

.evacuation-footer {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 10px 18px;
  align-items: end;
  border-top: 1px solid #cbd3dd;
  background: #ffffff;
  padding: 16px 26px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 16px rgba(23, 34, 51, 0.12);
}

.evacuation-responsible-field {
  display: grid;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
}

.evacuation-responsible-search {
  position: relative;
}

.evacuation-responsible-field input {
  width: 100%;
  min-height: 58px;
  border: 1px solid #aeb9c7;
  border-radius: var(--radius);
  color: var(--pf-ink);
  padding: 0 14px;
  font: inherit;
  font-size: 21px;
}

.evacuation-responsible-suggestions {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 140;
  display: grid;
  max-height: min(42vh, 320px);
  overflow: auto;
  border: 1px solid #aeb9c7;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 -18px 36px rgba(6, 43, 85, 0.2);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.evacuation-responsible-suggestions button {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border-bottom: 1px solid var(--pf-line);
  border-radius: 0;
  background: #ffffff;
  color: var(--pf-blue-dark);
  padding: 10px 13px;
  text-align: left;
}

.evacuation-responsible-suggestions button:last-child {
  border-bottom: 0;
}

.evacuation-responsible-suggestions button:focus-visible,
.evacuation-responsible-suggestions button:hover {
  background: var(--pf-blue-soft);
  outline: 0;
}

.evacuation-responsible-suggestions button strong {
  font-size: 18px;
}

.evacuation-responsible-suggestions button span {
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 700;
}

.evacuation-footer-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 12px;
}

.evacuation-cancel,
.evacuation-save {
  min-width: 220px;
  min-height: 58px;
  color: #ffffff;
  font-size: 21px;
  font-weight: 800;
  padding: 0 24px;
}

.evacuation-cancel {
  min-width: 150px;
  border: 2px solid #9d1b1b;
  background: #ffffff;
  color: #9d1b1b;
}

.evacuation-save {
  background: #062b55;
}

.evacuation-cancel:disabled,
.evacuation-save:disabled {
  cursor: wait;
  opacity: 0.6;
}

.evacuation-save-status {
  grid-column: 1 / -1;
  min-height: 20px;
  color: var(--pf-muted);
  font-size: 14px;
  font-weight: 700;
}

body.evacuation-active {
  overflow: hidden;
}

@media (max-width: 720px) {
  .evacuation-header {
    align-items: flex-start;
    min-height: 116px;
    padding: 16px 18px;
  }

  .evacuation-header h1 {
    font-size: 34px;
  }

  .evacuation-summary {
    min-width: 150px;
  }

  .evacuation-summary strong {
    font-size: 30px;
  }

  .evacuation-body {
    padding: 14px;
  }

  .evacuation-toolbar {
    margin-bottom: 12px;
  }

  .evacuation-toolbar select {
    width: min(220px, 58vw);
  }

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

  .evacuation-person {
    min-height: 112px;
    padding: 12px;
  }

  .evacuation-person strong {
    font-size: 19px;
  }

  .evacuation-footer {
    grid-template-columns: 1fr;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .evacuation-save {
    width: 100%;
  }

  .evacuation-footer-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .evacuation-cancel,
  .evacuation-save {
    min-width: 0;
  }
}

html.checkin-viewport-locked {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.checkin-viewport-locked body[data-view="check-in"] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

html.checkin-viewport-locked body[data-view="check-in"] .app-shell,
html.checkin-viewport-locked body[data-view="check-in"] .workspace,
html.checkin-viewport-locked body[data-view="check-in"] .workspace-grid,
html.checkin-viewport-locked body[data-view="check-in"] .workspace-main,
html.checkin-viewport-locked body[data-view="check-in"] #check-in,
html.checkin-viewport-locked body[data-view="check-in"] .checkin-kiosk-page,
html.checkin-viewport-locked body[data-view="check-in"] .checkin-kiosk-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-view="check-in"] #checkinStaffModal,
body[data-view="check-in"] #visitorCheckinModal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-view="check-in"] .checkin-staff-panel,
body[data-view="check-in"] .checkin-visitor-panel {
  max-height: calc(100% - 36px);
  overflow: hidden;
  overscroll-behavior: none;
}

body[data-view="check-in"] .checkin-visitor-panel {
  overflow: visible;
}

body[data-view="check-in"] .visitor-host-field,
body[data-view="check-in"] .visitor-company-field {
  z-index: 100;
}

body[data-view="check-in"] .visitor-host-suggestions,
body[data-view="check-in"] .visitor-company-suggestions {
  z-index: 1000;
}

@media (min-width: 721px) and (max-height: 900px) {
  body[data-view="check-in"] .checkin-visitor-modal:not(.manual-entry-mode) {
    padding: 12px;
  }

  body[data-view="check-in"] .checkin-visitor-modal:not(.manual-entry-mode) .checkin-visitor-panel {
    position: relative;
    max-height: calc(100% - 12px);
    padding-top: 28px;
  }

  body[data-view="check-in"] .checkin-visitor-modal:not(.manual-entry-mode) .modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
  }

  body[data-view="check-in"] .checkin-visitor-modal:not(.manual-entry-mode) .checkin-camera-card {
    padding-bottom: 28px;
  }
}

body[data-view="check-in"] .checkin-staff-modal.manual-entry-mode .checkin-staff-panel,
body[data-view="check-in"] .checkin-visitor-modal.manual-entry-mode .checkin-visitor-panel {
  position: relative;
  align-content: start;
  overflow: visible;
  transform: translateY(calc(-8vh - 72px));
}

body[data-view="check-in"] .checkin-staff-modal.manual-entry-mode .checkin-staff-panel {
  min-height: min(310px, calc(100% - 36px));
  align-content: space-between;
}

body[data-view="check-in"] .checkin-staff-modal.manual-entry-mode .modal-title-row,
body[data-view="check-in"] .checkin-staff-modal.manual-entry-mode .checkin-worker-row {
  transform: translateY(-27px);
}

body[data-view="check-in"] .checkin-visitor-modal.manual-entry-mode .checkin-visitor-panel {
  min-height: min(396px, calc(100% - 36px));
}

body[data-view="check-in"] .checkin-visitor-modal.manual-entry-mode.details-step .checkin-visitor-panel {
  transform: translateY(0);
}

body[data-view="check-in"] .checkin-visitor-panel .visitor-name-step input {
  font-size: 27px;
}

body[data-view="check-in"] .checkin-visitor-modal.manual-entry-mode .checkin-visitor-next {
  margin-top: 31px;
}

body[data-view="check-in"] .manual-entry-mode .checkin-worker-row,
body[data-view="check-in"] .manual-entry-mode .visitor-name-step,
body[data-view="check-in"] .manual-entry-mode .checkin-worker-search-wrap,
body[data-view="check-in"] .manual-entry-mode .visitor-name-field {
  position: relative;
  z-index: 100;
}

body[data-view="check-in"] .manual-entry-mode .checkin-worker-suggestions,
body[data-view="check-in"] .manual-entry-mode .visitor-name-suggestions {
  z-index: 1000;
}

body[data-view="check-in"] .visitor-host-field,
body[data-view="check-in"] .visitor-company-field {
  z-index: auto;
}

body[data-view="check-in"] .visitor-host-suggestions,
body[data-view="check-in"] .visitor-company-suggestions {
  z-index: 5000;
}

body[data-view="check-in"] .manual-entry-mode .checkin-worker-suggestions,
body[data-view="check-in"] .manual-entry-mode .visitor-name-suggestions {
  top: auto;
  bottom: calc(100% + 6px);
  box-shadow: 0 -18px 36px rgba(6, 43, 85, 0.18);
}

body[data-view="check-in"] .checkin-worker-suggestions,
body[data-view="check-in"] .visitor-name-suggestions,
body[data-view="check-in"] .visitor-host-suggestions,
body[data-view="check-in"] .visitor-company-suggestions {
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body[data-view="check-in"] .topbar {
  display: none;
}

body[data-view="check-in"] .workspace,
body[data-view="check-in"] .workspace-grid {
  min-height: 100vh;
}

body[data-view="check-in"] .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-view="check-in"] .workspace-main {
  grid-column: 1;
  padding: 0;
}

body[data-view="check-in"] .workspace-main > .tab-panel:not(#check-in) {
  display: none !important;
}

body[data-view="check-in"] #check-in {
  display: block;
}

body[data-view="face-lab"] .workspace-main > .tab-panel:not(#face-lab) {
  display: none !important;
}

body[data-view="face-lab"] #face-lab {
  display: block;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .face-camera-panel {
    grid-template-columns: minmax(260px, 1fr) 260px;
  }

  .face-camera-actions {
    grid-template-columns: repeat(2, minmax(116px, 1fr));
  }

  .face-lab-diagnostic-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 820px) {
  .face-lab-actions,
  .face-camera-panel,
  .face-worker-row,
  .face-audit-row,
  .face-candidate-row {
    grid-template-columns: 1fr;
  }

  .face-camera-actions {
    grid-template-columns: 1fr;
  }

  .face-lab-diagnostic-grid,
  .face-diagnostic-result,
  .face-diagnostic-metrics {
    grid-template-columns: 1fr;
  }

  .face-diagnostic-capture {
    width: min(100%, 280px);
  }

  .face-enrollment-launchers,
  .face-enrollment-row {
    grid-template-columns: 1fr;
  }

  .face-enrollment-launchers {
    max-width: 420px;
  }

  .face-clear-enrollment-button {
    width: 100%;
  }

  .face-result-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .checkin-worker-row {
    grid-template-columns: 1fr;
  }

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

  .visitor-contact-fields {
    grid-template-columns: 1fr;
  }
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-section {
  padding: 0;
}

.document-tabs {
  display: flex;
  gap: 2rem;
  align-items: center;
  border-bottom: 1px solid var(--pf-line);
}

.document-tab {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--pf-blue-dark);
  font-size: 14px;
  font-weight: 700;
}

.document-tab.active {
  border-bottom-color: var(--pf-gold);
}

.document-tab:hover,
.document-tab:focus-visible {
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.42);
}

.workspace-section h2 {
  margin: 0 0 12px;
  color: var(--pf-blue-dark);
  font-size: 24px;
  font-weight: 500;
}

.workspace-section p {
  margin: 0;
  max-width: 880px;
  color: var(--pf-muted);
  line-height: 1.55;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  margin-bottom: 12px;
  color: var(--pf-blue-dark);
}

.table-toolbar span {
  color: var(--pf-muted);
  font-size: 12px;
}

.table-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.table-toolbar-actions button {
  min-height: 28px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 0 9px;
}

.table-toolbar-actions button:disabled {
  opacity: 0.45;
}

.help-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.help-button:hover,
.help-button:focus-visible {
  background: var(--pf-blue);
  color: var(--pf-white);
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.48);
}

.pn-table {
  display: grid;
  gap: 0;
  width: 100%;
  overflow-x: auto;
}

.stock-table {
  width: 100%;
  overflow-x: auto;
}

.stock-grid {
  display: grid;
  min-width: 980px;
}

.stock-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) minmax(280px, 1.7fr) repeat(4, minmax(105px, 0.55fr));
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-bottom: 1px solid var(--pf-line);
  background: transparent;
  color: var(--pf-ink);
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.stock-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stock-row.header span:nth-child(n+3) {
  text-align: right;
}

.stock-pn-row,
.stock-batch-row {
  cursor: pointer;
}

.stock-pn-row:hover,
.stock-pn-row:focus-visible,
.stock-batch-row:hover,
.stock-batch-row:focus-visible {
  background: rgba(255, 204, 0, 0.08);
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.42);
}

.stock-batch-row {
  background: rgba(255, 255, 255, 0.52);
  color: var(--pf-muted);
}

.stock-batch-row span:first-child {
  padding-left: 28px;
}

.scrap-report-grid {
  display: grid;
  min-width: 1280px;
}

.scrap-report-row {
  display: grid;
  grid-template-columns: minmax(145px, 0.8fr) minmax(260px, 1.4fr) minmax(110px, 0.6fr) minmax(150px, 0.75fr) minmax(120px, 0.65fr) minmax(170px, 0.9fr) minmax(150px, 0.8fr) minmax(80px, 0.42fr);
  gap: 12px;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-ink);
  font-size: 13px;
}

.scrap-report-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.scrap-report-row.header span:last-child {
  text-align: right;
}

.scrap-report-row.group {
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.scrap-report-row.aircraft-group {
  background: #dfeaf5;
}

.scrap-summary-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  color: var(--pf-ink);
  font-size: 13px;
}

.scrap-summary-table th,
.scrap-summary-table td {
  border-bottom: 1px solid var(--pf-line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.scrap-summary-table th {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.scrap-summary-table th:nth-child(n+3),
.scrap-summary-table td:nth-child(n+3) {
  text-align: right;
}

.scrap-summary-table tr.group td {
  background: #dfeaf5;
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.scrap-summary-table tfoot td {
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.stock-taking-doc-grid,
.stock-taking-lines {
  display: grid;
  min-width: 1080px;
}

.stock-taking-doc-row,
.stock-taking-line-row {
  display: grid;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.stock-taking-doc-row {
  grid-template-columns: minmax(120px, 0.7fr) minmax(150px, 0.8fr) minmax(170px, 1fr) minmax(150px, 0.9fr) repeat(4, minmax(80px, 0.45fr)) minmax(100px, 0.55fr);
}

.stock-taking-line-row {
  grid-template-columns: 54px minmax(135px, 0.75fr) minmax(230px, 1.3fr) minmax(95px, 0.45fr) minmax(100px, 0.5fr) minmax(85px, 0.45fr) minmax(190px, 1fr) minmax(130px, 0.65fr);
}

.stock-taking-doc-row.header,
.stock-taking-line-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stock-taking-doc-row.header span:nth-child(n+5),
.stock-taking-line-row.header span:nth-child(4),
.stock-taking-line-row.header span:nth-child(5),
.stock-taking-line-row.header span:nth-child(6) {
  text-align: right;
}

.stock-taking-line-row input,
.stock-taking-line-row select {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 0 8px;
}

.stock-taking-line-row small {
  color: var(--pf-muted);
}

.stock-taking-fill-panel .modal-form,
.stock-taking-scan-panel .modal-form {
  max-height: 72vh;
}

.stock-taking-location-list {
  width: 100%;
  max-height: 48vh;
}

.stock-taking-location-list .kit-availability-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.stock-taking-location-list .kit-availability-option input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  justify-self: center;
}

.stock-taking-location-list .kit-availability-option span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.stock-taking-scan-info {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--pf-line);
  background: var(--pf-blue-pale);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.modal.front-modal {
  z-index: 90;
}

.stock-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border: 1px solid var(--pf-line);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.stock-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stock-card-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.stock-card-summary div {
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-blue-soft);
  padding: 12px;
}

.stock-card-summary span {
  display: block;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.stock-card-summary strong {
  display: block;
  margin-top: 6px;
  color: var(--pf-blue-dark);
  font-size: 18px;
}

.supported-documents {
  display: grid;
  gap: 6px;
  margin: -4px 0 16px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  padding: 12px;
}

.supported-documents span {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.supported-documents small {
  color: var(--pf-muted);
  font-size: 12px;
}

.supported-documents strong {
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 600;
}

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

.supported-document-links a {
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  text-decoration: none;
}

.supported-document-links a:hover,
.supported-document-links a:focus-visible {
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.68);
}

.stock-card-table {
  display: grid;
  max-height: 56vh;
  overflow: auto;
}

.stock-card-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(180px, 1.1fr) minmax(170px, 1fr) repeat(3, minmax(85px, 0.5fr));
  gap: 10px;
  align-items: center;
  min-width: 840px;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.stock-card-row.header,
.stock-card-row.closing {
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.stock-card-movement-row {
  width: 100%;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.stock-card-movement-row:hover,
.stock-card-movement-row:focus-visible {
  background: var(--pf-blue-soft);
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.45);
  outline: none;
}

.stock-card-row.header span:nth-child(n+4) {
  text-align: right;
}

.batch-total-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.batch-detail-actions {
  justify-content: flex-start;
  margin: 0 0 12px;
}

.modal-subtitle {
  margin: 18px 0 8px;
  color: var(--pf-blue-dark);
  font-size: 16px;
  font-weight: 700;
}

.batch-total-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(90px, 0.45fr);
  gap: 10px;
  align-items: center;
  min-width: 620px;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.contractor-doc-row {
  display: grid;
  grid-template-columns: 70px minmax(150px, 0.9fr) minmax(170px, 1fr) 90px minmax(150px, 1fr) minmax(260px, 1.6fr) minmax(110px, 0.6fr);
  gap: 12px;
  align-items: center;
  min-width: 940px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.movement-doc-row {
  display: grid;
  grid-template-columns: 70px minmax(145px, 0.8fr) minmax(160px, 0.9fr) 80px minmax(180px, 1fr) minmax(150px, 0.9fr) minmax(220px, 1.2fr) minmax(110px, 0.5fr);
  gap: 12px;
  align-items: center;
  min-width: 1120px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.kit-template-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(100px, 0.45fr) minmax(220px, 1.1fr) minmax(70px, 0.35fr) minmax(90px, 0.4fr) minmax(220px, 1.1fr) minmax(110px, 0.45fr);
  gap: 12px;
  align-items: center;
  min-width: 1050px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.kit-build-doc-row {
  display: grid;
  grid-template-columns: 64px minmax(130px, 0.65fr) minmax(150px, 0.8fr) minmax(260px, 1.35fr) minmax(120px, 0.65fr) minmax(220px, 1fr) minmax(160px, 0.8fr) minmax(80px, 0.4fr) minmax(100px, 0.45fr);
  gap: 12px;
  align-items: center;
  min-width: 1320px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.kit-template-line-row {
  display: grid;
  grid-template-columns: 70px minmax(260px, 1.1fr) minmax(340px, 1.4fr) minmax(80px, 0.4fr) minmax(120px, 0.5fr);
  gap: 10px;
  align-items: center;
  min-width: 880px;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.warehouse-check-list {
  display: grid;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}

.movement-doc-row.header,
.kit-build-doc-row.header,
.kit-template-row.header,
.kit-template-line-row.header,
.contractor-doc-row.header,
.backend-doc-row.header,
.document-operation-row.header,
.location-transfer-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kit-build-form {
  display: grid;
  gap: 14px;
}

.kit-build-header {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(320px, 1.35fr) minmax(220px, 0.95fr) minmax(240px, 1fr) minmax(150px, 0.65fr);
  gap: 12px;
  align-items: end;
}

.kit-build-header input,
.kit-build-header select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  padding: 0 10px;
}

.kit-build-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
}

.kit-build-operation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-weight: 700;
  white-space: nowrap;
}

.kit-build-operation-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--pf-blue);
}

.kit-build-operation-toggle:has(input:disabled) {
  opacity: 0.7;
}

.kit-build-actions button {
  min-height: 42px;
  padding: 0 18px;
  font-weight: 700;
  white-space: nowrap;
}

.kit-build-lines {
  max-height: min(58vh, 620px);
  overflow: auto;
}

.kit-build-line-row {
  display: grid;
  grid-template-columns: 58px minmax(180px, 0.85fr) minmax(330px, 1.35fr) minmax(90px, 0.4fr) minmax(90px, 0.4fr) minmax(90px, 0.4fr) minmax(180px, 0.65fr);
  gap: 10px;
  align-items: center;
  min-width: 1130px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.kit-build-line-group {
  min-width: 1130px;
  border-bottom: 1px solid var(--pf-line);
}

.kit-build-line-group .kit-build-line-row {
  border-bottom: 0;
}

.kit-build-line-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kit-build-need-row {
  background: var(--pf-white);
}

.kit-build-line-group.is-ready .kit-build-need-row {
  background: #eef8ef;
}

.kit-build-line-group.is-open .kit-build-need-row {
  background: #fff0f0;
}

.kit-build-allocations {
  display: grid;
  gap: 0;
}

.kit-build-allocation-row {
  min-height: 40px;
  color: var(--pf-muted);
  background: rgba(255, 255, 255, 0.62);
}

.kit-build-allocation-row strong {
  color: var(--pf-blue-dark);
}

.kit-build-allocation-row small {
  color: var(--pf-muted);
}

.kit-build-empty-allocation {
  min-height: 30px;
  padding: 0 0 8px 68px;
  color: var(--pf-muted);
  font-size: 12px;
}

.kit-build-short {
  color: #9f5c00;
  font-weight: 700;
}

.kit-build-ready {
  color: #16724a;
  font-weight: 700;
}

.kit-build-line-row input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  padding: 0 8px;
}

.kit-combo {
  position: relative;
  min-width: 0;
}

.kit-combo input {
  padding-right: 34px;
}

.kit-combo-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-grid;
  place-items: center;
  width: 24px;
  min-height: 24px;
  transform: translateY(-50%);
  border: 1px solid transparent;
  background: transparent;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.kit-combo-clear:hover,
.kit-combo-clear:focus-visible {
  border-color: #efb8b8;
  background: var(--pf-white);
  color: #8e1f1f;
  box-shadow: 0 0 4px rgba(200, 54, 54, 0.22);
}

.kit-combo-menu {
  z-index: 75;
  max-height: 260px;
}

.kit-availability-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  margin-left: 4px;
  padding: 0 8px;
  border: 1px solid var(--pf-line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.kit-availability-badge.is-enough {
  border-color: #b9dfc3;
  background: #e8f7ec;
  color: #176640;
}

.kit-availability-badge.is-short {
  border-color: #efb8b8;
  background: #fdeaea;
  color: #9a2a2a;
}

.kit-batch-panel {
  width: min(1360px, 95vw);
  max-height: 92vh;
  overflow: hidden;
}

.kit-availability-panel {
  width: min(620px, calc(100vw - 48px));
}

.kit-availability-panel .modal-form {
  grid-template-columns: 1fr;
}

.kit-availability-list {
  display: grid;
  gap: 8px;
  width: 100%;
  max-height: min(50vh, 390px);
  overflow: auto;
  padding-right: 4px;
}

.kit-availability-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-soft);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.kit-availability-option span {
  min-width: 0;
  line-height: 1.25;
}

.kit-availability-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--pf-blue);
}

.kit-availability-actions {
  justify-content: flex-end;
  gap: 10px;
}

.kit-availability-actions button {
  min-height: 42px;
  padding: 0 16px;
  font-weight: 700;
}

.kit-batch-results {
  display: grid;
  gap: 0;
  max-height: min(70vh, 760px);
  overflow: auto;
  border-top: 1px solid var(--pf-line);
}

.kit-batch-result-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.58fr) minmax(300px, 1.2fr) 95px minmax(220px, 0.92fr) 100px 110px;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 6px 0;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.kit-batch-result-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.kit-batch-result-row input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  padding: 0 8px;
}

.location-transfer-workbench {
  display: grid;
  gap: 18px;
}

.location-transfer-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(112px, 0.42fr) minmax(140px, 0.55fr) minmax(240px, 1fr) minmax(240px, 1fr) 100px 130px 100px;
  gap: 10px;
  align-items: end;
  margin-top: 0.5em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--pf-line);
}

.location-transfer-modal-form {
  margin-top: 0;
}

.transfer-combo {
  position: relative;
  min-width: 0;
}

.transfer-field {
  display: grid;
  gap: 5px;
}

.transfer-field label {
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.transfer-field input,
.transfer-field select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  font-size: 16px;
  padding: 0 10px;
}

.transfer-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.transfer-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--pf-blue);
}

.location-transfer-form .primary-action,
.location-transfer-form > button {
  min-height: 42px;
  width: auto;
  padding: 0 16px;
  font-weight: 700;
}

.location-transfer-form > button:not(.primary-action) {
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
}

.transfer-info,
.location-transfer-form .form-status {
  color: var(--pf-muted);
  line-height: 1.3;
}

.transfer-info {
  grid-column: 1 / -1;
  align-self: start;
  min-height: 28px;
  padding-top: 4px;
  font-size: 16px;
  font-weight: 600;
}

.location-transfer-form .form-status {
  grid-column: 1 / -1;
  align-self: center;
  font-size: 13px;
  min-height: 18px;
}

.location-transfer-form .batch-combo-menu {
  z-index: 95;
  max-height: min(430px, 58vh);
}

.location-transfer-table {
  display: grid;
  width: 100%;
  overflow-x: auto;
}

.location-transfer-row {
  display: grid;
  grid-template-columns: minmax(115px, 0.7fr) minmax(150px, 0.8fr) minmax(120px, 0.7fr) minmax(220px, 1.3fr) 80px minmax(200px, 1fr) minmax(200px, 1fr) minmax(180px, 0.9fr) minmax(100px, 0.5fr);
  gap: 12px;
  align-items: center;
  min-width: 1320px;
  min-height: 44px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.backend-doc-row {
  display: grid;
  grid-template-columns: 64px minmax(130px, 0.8fr) minmax(110px, 0.6fr) minmax(150px, 0.9fr) minmax(170px, 0.9fr) minmax(170px, 1fr) minmax(220px, 1.2fr) 90px minmax(230px, 1.1fr);
  gap: 12px;
  align-items: center;
  min-width: 1320px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.backend-doc-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.document-operation-table {
  display: grid;
  max-height: 62vh;
  overflow: auto;
}

.document-operation-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) 80px minmax(200px, 1.2fr) minmax(120px, 0.7fr) minmax(80px, 0.5fr) minmax(170px, 1fr) minmax(150px, 0.8fr) minmax(200px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 1120px;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.inline-status {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0 10px;
}

.database-table {
  width: 100%;
  overflow: auto;
}

.database-grid {
  display: grid;
  min-width: max-content;
}

.database-row {
  display: contents;
}

.database-cell {
  min-width: 130px;
  max-width: 320px;
  border-bottom: 1px solid var(--pf-line);
  padding: 9px 10px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.database-cell.header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 5px;
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.database-cell.header input {
  min-height: 28px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 12px;
  padding: 0 7px;
}

.table-button.active {
  border-color: var(--pf-blue);
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
}

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

.table-button span {
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-button small {
  color: var(--pf-muted);
  font-size: 11px;
  text-align: right;
}

.pn-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(260px, 1.8fr) 90px 90px minmax(190px, 0.8fr);
  gap: 12px;
  align-items: center;
  min-width: 850px;
  min-height: 42px;
  border-bottom: 1px solid var(--pf-line);
  font-size: 13px;
}

.pn-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.pn-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pn-actions button {
  min-height: 28px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 0 9px;
}

.pn-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pn-actions .danger-action {
  color: #8e1f1f;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 34, 51, 0.28);
}

#pnAlternativeModal {
  z-index: 40;
}

#kitBatchModal {
  z-index: 60;
}

#kitAvailabilityModal {
  z-index: 70;
}

#dirtyPnScanModal {
  z-index: 80;
}

#documentOperationsModal {
  padding: 2.5vh 2.5vw;
}

#locationTransferModal {
  padding: 1.5vh 1.5vw;
}

.modal-panel {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  padding: 22px;
  box-shadow: 0 18px 45px rgba(6, 43, 85, 0.18);
}

.manual-panel {
  width: min(940px, calc(100vw - 48px));
  max-height: min(780px, calc(100vh - 48px));
}

.manual-content {
  display: grid;
  gap: 16px;
  color: var(--pf-ink);
  font-size: 14px;
  line-height: 1.58;
}

.manual-content section {
  border-top: 1px solid var(--pf-line);
  padding-top: 12px;
}

.manual-content section:first-child {
  border-top: 0;
  padding-top: 0;
}

.manual-content h3 {
  margin: 0 0 6px;
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.manual-content p {
  margin: 0;
}

.pn-create-panel {
  width: min(1110px, calc(100vw - 48px));
  max-height: calc(100vh - 36px);
  overflow: visible;
  padding: 18px;
}

#documentOperationsModal .pn-create-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1380px, 95vw);
  height: 95vh;
  max-height: 95vh;
  overflow: hidden;
}

#documentOperationsBody {
  min-height: 0;
  overflow: auto;
}

.location-transfer-panel {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1720px, 98vw);
  max-height: 97vh;
  overflow: hidden;
}

#locationTransferBody {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
}

.location-transfer-panel .location-transfer-form {
  min-width: 1500px;
}

.contractor-doc-panel {
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.contractor-doc-panel .contractor-doc-form {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.scan-panel {
  width: min(680px, calc(100vw - 48px));
}

.dirty-pn-scan-panel {
  width: min(480px, calc(100vw - 48px));
}

.performance-panel {
  width: min(780px, calc(100vw - 48px));
}

.performance-form {
  grid-template-columns: minmax(0, 1fr);
}

.performance-doc-grid {
  display: grid;
  gap: 7px;
}

.performance-doc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.performance-doc-row input {
  min-height: 34px;
  text-align: right;
}

.performance-clear-check {
  grid-column: 1 / -1;
}

.dirty-pn-scan-panel .modal-form {
  grid-template-columns: 1fr;
}

.dirty-pn-scan-panel .form-status {
  min-height: 22px;
}

.modal-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.modal-panel h2 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 22px;
}

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

.modal-close {
  position: relative;
  z-index: 3;
  justify-self: end;
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  width: 30px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 14px;
  font-weight: 700;
  padding: 0;
  touch-action: manipulation;
}

.modal-close::before {
  content: "";
  position: absolute;
  inset: -15px;
  background: transparent;
}

.modal-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.modal-search input {
  min-height: 36px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  font: inherit;
  padding: 0 10px;
}

.modal-search button,
.modal-results button {
  min-height: 36px;
  border: 1px solid var(--pf-line);
  background: var(--pf-blue);
  color: var(--pf-white);
  font-weight: 700;
  padding: 0 12px;
}

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

.modal-field {
  display: grid;
  gap: 5px;
}

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

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

.doc-toolbar.full,
.doc-action-row.full {
  display: flex;
  grid-column: 1 / -1;
}

.doc-toolbar.full {
  justify-content: flex-start;
}

.doc-action-row.full {
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.doc-action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dirty-scan-actions {
  align-content: end;
}

.dirty-scan-button-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dirty-scan-button-row .primary-action {
  min-height: 36px;
  min-width: 112px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
}

.doc-toolbar .primary-action,
.doc-action-row .primary-action {
  width: auto;
  min-width: 132px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 14px;
}

.form-section-title {
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.modal-field label {
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.modal-field input,
.modal-field select,
.modal-field textarea,
.field-button {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  padding: 0 10px;
}

.field-button {
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
  font-weight: 700;
  text-align: center;
}

.modal-field textarea {
  min-height: 46px;
  padding: 9px 10px;
  resize: vertical;
}

.modal-form h3 {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.doc-lines {
  display: grid;
  gap: 8px;
}

#contractorDocLines {
  display: grid;
  gap: 8px;
}

.doc-line {
  display: grid;
  grid-template-columns: minmax(230px, 1.6fr) 90px minmax(178px, 1fr) minmax(190px, 1.1fr) 72px 36px;
  gap: 8px;
  align-items: end;
}

.doc-line.header {
  align-items: center;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.doc-line input,
.doc-line select {
  min-height: 34px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  font-size: 13px;
  padding: 0 8px;
}

.doc-line input[readonly] {
  background: var(--pf-blue-soft);
  color: var(--pf-muted);
}

.batch-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 6px;
}

.pn-combo {
  position: relative;
  min-width: 0;
}

.pn-combo.has-clear input[data-doc-line-pn-input] {
  padding-right: 34px;
}

.pn-clear-button {
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 5px;
  width: 24px;
  min-height: 24px !important;
  height: 24px;
  transform: translateY(-50%);
  border-color: transparent !important;
  background: transparent !important;
  color: #8e1f1f !important;
  padding: 0 !important;
  line-height: 1;
}

.pn-clear-button:hover,
.pn-clear-button:focus-visible {
  box-shadow: 0 0 6px rgba(210, 43, 43, 0.42);
}

.pn-combo-menu {
  position: absolute;
  z-index: 45;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  box-shadow: 0 12px 28px rgba(6, 43, 85, 0.18);
}

.pn-combo-menu.combo-menu-up {
  top: auto;
  bottom: calc(100% + 4px);
  z-index: 95;
  max-height: min(420px, 58vh);
}

.batch-combo-menu {
  min-width: min(520px, calc(100vw - 48px));
}

.batch-scan-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 6px;
  max-height: min(340px, 45vh);
  overflow: auto;
}

.batch-scan-list-title {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.batch-scan-list button {
  display: grid;
  grid-template-columns: minmax(96px, 0.6fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 7px 9px;
  text-align: left;
}

.batch-scan-list button:hover,
.batch-scan-list button:focus-visible {
  background: var(--pf-blue-soft);
  box-shadow: 0 0 9px rgba(255, 204, 0, 0.48);
}

.batch-scan-list small {
  color: var(--pf-muted);
  font-size: 11px;
}

.pn-combo-menu button,
.pn-combo-menu span {
  min-height: 30px;
  border: 0;
  border-bottom: 1px solid var(--pf-line);
  border-radius: 0;
  background: var(--pf-white);
  color: var(--pf-ink);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 8px;
  text-align: left;
}

.pn-combo-menu button:hover,
.pn-combo-menu button:focus-visible {
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
}

.doc-line button {
  min-height: 34px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.doc-line .batch-get-button {
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
}

.pn-actions button {
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
}

.pn-actions button:hover,
.pn-actions button:focus-visible,
.doc-line button[data-doc-line-print]:hover,
.doc-line button[data-doc-line-print]:focus-visible {
  box-shadow: 0 0 9px rgba(255, 204, 0, 0.68);
}

.doc-line button[data-doc-line-remove]:hover,
.doc-line button[data-doc-line-remove]:focus-visible {
  box-shadow: 0 0 6px rgba(210, 43, 43, 0.42);
  color: #9d1b1b;
}

.doc-line button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.file-list {
  display: grid;
  gap: 6px;
  margin-top: 6px;
  max-height: 116px;
  overflow-y: auto;
}

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

.file-list a {
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.file-row button,
.doc-action-buttons button {
  min-height: 34px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
  padding: 0 10px;
}

.doc-action-buttons .primary-action {
  min-height: 36px;
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
}

.file-input-hidden {
  display: none;
}

.file-drop-zone {
  display: grid;
  min-height: 38px;
  place-items: center;
  border: 1px dashed var(--pf-blue);
  border-radius: var(--radius);
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-weight: 700;
}

.file-drop-zone.drag-over {
  background: var(--pf-white);
  border-style: solid;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
}

.form-actions button {
  min-height: 36px;
  border: 1px solid var(--pf-line);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-weight: 700;
  padding: 0 12px;
}

.form-actions .primary-action {
  width: auto;
  border-color: var(--pf-blue);
  background: var(--pf-blue);
  color: var(--pf-white);
}

.primary-action:hover,
.primary-action:focus-visible,
.doc-toolbar .primary-action:hover,
.doc-toolbar .primary-action:focus-visible,
.doc-action-row .primary-action:hover,
.doc-action-row .primary-action:focus-visible,
.doc-action-buttons .primary-action:hover,
.doc-action-buttons .primary-action:focus-visible,
.form-actions .primary-action:hover,
.form-actions .primary-action:focus-visible,
.field-button:hover,
.field-button:focus-visible,
.batch-get-button:hover,
.batch-get-button:focus-visible,
.doc-line .batch-get-button:hover,
.doc-line .batch-get-button:focus-visible,
.pn-actions button:hover,
.pn-actions button:focus-visible,
.modal-search button:hover,
.modal-search button:focus-visible,
.modal-results button:hover,
.modal-results button:focus-visible {
  background: var(--pf-blue-hover);
  border-color: var(--pf-blue-hover);
  box-shadow: 0 0 9px rgba(255, 204, 0, 0.68);
  color: var(--pf-white);
}

.form-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--pf-muted);
  font-size: 12px;
}

.modal-results {
  display: grid;
  gap: 8px;
}

.result-row,
.detail-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--pf-line);
  padding: 8px 0;
  font-size: 13px;
}

.detail-row {
  grid-template-columns: 160px minmax(0, 1fr);
}

.data-grid {
  display: grid;
  gap: 10px;
  align-content: start;
  width: 100%;
}

.backend-view .data-grid {
  overflow-x: auto;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(210px, 1.2fr) minmax(135px, 0.75fr) 80px minmax(160px, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--pf-line);
  color: var(--pf-ink);
  font-size: 13px;
}

.data-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.users-row {
  grid-template-columns: minmax(130px, 0.9fr) minmax(210px, 1.1fr) minmax(120px, 0.7fr) 78px 70px minmax(155px, 0.85fr) minmax(120px, 0.55fr) minmax(165px, 0.85fr) minmax(105px, 0.55fr) minmax(150px, 0.75fr);
  min-width: 1380px;
}

.users-row select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
}

.user-panel {
  width: min(980px, calc(100vw - 48px));
}

.user-permissions-panel {
  width: min(1180px, calc(100vw - 48px));
}

.user-role-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}

.warehouse-access-list {
  max-height: min(30vh, 260px);
  overflow: auto;
  padding-right: 4px;
}

.permission-check,
.permission-row {
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
}

.permission-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
}

.permission-check small {
  grid-column: 2;
  color: var(--pf-muted);
  font-size: 11px;
}

.user-permission-summary {
  min-height: 22px;
  color: var(--pf-muted);
  font-size: 12px;
}

.permission-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 4px;
}

.permission-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 10px;
  align-items: start;
  min-height: 72px;
  padding: 9px 10px;
}

.permission-row span,
.permission-row em {
  display: grid;
  gap: 2px;
}

.permission-row small,
.permission-row em {
  color: var(--pf-muted);
  font-size: 11px;
  font-style: normal;
}

.permission-row em {
  grid-column: 2;
}

.permission-row.is-effective {
  background: var(--pf-blue-soft);
}

.permission-row.is-inherited em {
  color: var(--pf-blue-dark);
}

.permission-table {
  display: grid;
  min-width: 860px;
  overflow-x: auto;
}

.permission-table-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.1fr) minmax(110px, 0.45fr) minmax(260px, 1.4fr) minmax(80px, 0.35fr);
  gap: 14px;
  align-items: center;
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid var(--pf-line);
  border-radius: 0;
  background: transparent;
  color: var(--pf-ink);
  font: inherit;
  font-size: 13px;
  padding: 8px 10px;
  text-align: left;
}

.permission-table-row.header {
  min-height: 34px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.permission-open-row {
  cursor: pointer;
}

.permission-open-row:hover,
.permission-open-row:focus-visible {
  background: var(--pf-blue-soft);
  box-shadow: 0 0 6px rgba(255, 204, 0, 0.42);
  outline: 0;
}

.permission-table-row strong,
.permission-table-row small {
  display: block;
}

.permission-table-row strong {
  color: var(--pf-blue-dark);
}

.permission-table-row small {
  margin-top: 2px;
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 600;
}

.permission-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: min(760px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
}

.permission-panel .modal-title-row span {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 600;
}

.permission-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.permission-role-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 9px;
  align-items: center;
  min-height: 64px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.permission-role-tile.active {
  border-color: rgba(0, 62, 126, 0.45);
  background: var(--pf-blue-soft);
}

.permission-role-tile.locked {
  cursor: not-allowed;
  opacity: 0.72;
}

.permission-role-tile input {
  margin: 0;
}

.permission-role-tile small {
  grid-column: 2;
  color: var(--pf-muted);
  font-size: 11px;
  font-weight: 600;
}

.form-status.error {
  color: #9d1b1b;
}

.page-head {
  margin-bottom: 18px;
}

.panel-card,
.data-card,
.empty-body {
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
}

.panel-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.panel-card h2,
.data-card h3 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-weight: 600;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-count {
  min-width: 28px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.data-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
}

.data-card p,
.data-card small {
  margin: 0;
  color: var(--pf-muted);
  line-height: 1.45;
}

.database-action-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--pf-blue-soft);
}

.database-action-panel h3 {
  margin: 0 0 4px;
  color: var(--pf-blue-dark);
  font-size: 16px;
}

.database-action-panel p {
  margin: 0;
  color: var(--pf-muted);
  line-height: 1.4;
}

.photo-storage-settings {
  margin: 20px 0;
  padding: 20px 0;
  border-top: 1px solid var(--pf-line);
  border-bottom: 1px solid var(--pf-line);
}

.photo-storage-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.photo-storage-heading h3 {
  margin: 0 0 4px;
  color: var(--pf-blue-dark);
  font-size: 18px;
}

.photo-storage-heading p {
  margin: 0;
  color: var(--pf-muted);
  line-height: 1.45;
}

.photo-storage-heading .badge {
  flex: 0 0 auto;
}

.photo-storage-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.photo-storage-option {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  min-height: 82px;
  padding: 15px;
  background: #fff;
  cursor: pointer;
}

.photo-storage-option:nth-child(odd) {
  border-right: 1px solid var(--pf-line);
}

.photo-storage-option:nth-child(n + 3) {
  border-top: 1px solid var(--pf-line);
}

.photo-storage-option input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--pf-blue);
}

.photo-storage-option span {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.photo-storage-option strong {
  color: var(--pf-blue-dark);
  font-size: 15px;
}

.photo-storage-option small {
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.35;
}

.photo-storage-option.fixed-option {
  background: var(--pf-blue-soft);
  cursor: default;
}

.recognition-threshold-option {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: center;
  gap: 24px;
  min-height: 92px;
  border-top: 1px solid var(--pf-line);
  padding: 16px;
  background: var(--pf-white);
}

.recognition-threshold-option > span:first-child {
  display: grid;
  gap: 5px;
}

.recognition-threshold-option strong {
  color: var(--pf-blue-dark);
  font-size: 15px;
}

.recognition-threshold-option small {
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.35;
}

.recognition-threshold-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 14px;
}

.recognition-threshold-control input[type="range"] {
  width: 100%;
  accent-color: var(--pf-blue);
}

.recognition-threshold-control output {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.photo-storage-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 14px;
}

.photo-storage-actions .form-status {
  margin: 0 auto 0 0;
}

@media (max-width: 760px) {
  .photo-storage-heading,
  .photo-storage-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .photo-storage-options {
    grid-template-columns: 1fr;
  }

  .photo-storage-option:nth-child(odd) {
    border-right: 0;
  }

  .photo-storage-option:nth-child(n + 2) {
    border-top: 1px solid var(--pf-line);
  }

  .recognition-threshold-option {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.records-table {
  gap: 8px;
}

.record-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(130px, 0.7fr);
  align-items: center;
  gap: 12px;
  min-height: 68px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--pf-white);
}

.record-row h3 {
  margin: 0 0 4px;
  color: var(--pf-blue-dark);
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.record-row p,
.record-row span {
  min-width: 0;
}

.record-row p {
  margin: 0;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.badge-success {
  background: #e7f6ed;
  color: #1d6b3a;
}

.badge-muted {
  background: #eef2f6;
  color: #617083;
}

.badge-danger {
  background: #fae9e9;
  color: #982b2b;
}

.secondary-action {
  min-height: 36px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-weight: 700;
  padding: 0 14px;
}

.secondary-action.danger-action {
  border-color: #e7bcbc;
  color: #982b2b;
}

.panel-heading-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.panel-heading-copy p {
  margin: 0;
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.4;
}

.kiosk-devices-panel > .panel-title-row .panel-count {
  margin-left: auto;
}

.archived-devices-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.archived-devices-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

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

.kiosk-device-card {
  align-content: start;
  min-height: 210px;
}

.kiosk-device-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kiosk-device-card-heading > div {
  min-width: 0;
}

.kiosk-device-meta {
  display: grid;
  gap: 6px;
  margin: 4px 0;
}

.kiosk-device-meta div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  font-size: 12px;
}

.kiosk-device-meta dt {
  color: var(--pf-muted);
}

.kiosk-device-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--pf-blue-dark);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.kiosk-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.kiosk-device-dialog {
  width: min(640px, 100%);
}

.archived-kiosk-devices-dialog {
  width: min(760px, 100%);
}

.archived-kiosk-devices-list {
  display: grid;
  max-height: min(62vh, 560px);
  overflow-y: auto;
  border-top: 1px solid var(--pf-line);
}

.archived-kiosk-device-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--pf-line);
}

.archived-kiosk-device-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.archived-kiosk-device-copy strong {
  color: var(--pf-blue-dark);
  font-size: 16px;
}

.archived-kiosk-device-copy span,
.archived-kiosk-device-copy small {
  color: var(--pf-muted);
  overflow-wrap: anywhere;
}

.archived-kiosk-devices-empty {
  padding: 30px 4px;
  color: var(--pf-muted);
  text-align: center;
}

.kiosk-device-form {
  grid-template-columns: minmax(0, 1fr);
}

.kiosk-device-station-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: min(34vh, 300px);
  overflow-y: auto;
  padding-right: 4px;
}

.kiosk-device-station-option:has(input:disabled) {
  background: var(--pf-blue-soft);
}

@media (max-width: 620px) {
  .kiosk-device-station-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kiosk-activation-result {
  display: grid;
  gap: 16px;
}

.kiosk-activation-result > p,
.kiosk-activation-result > small {
  margin: 0;
  color: var(--pf-muted);
  line-height: 1.45;
}

.kiosk-activation-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--pf-line);
  padding: 12px;
  background: var(--pf-blue-soft);
}

.kiosk-activation-code-row strong {
  color: var(--pf-blue-dark);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
  letter-spacing: 0;
  text-align: center;
}

@media (max-width: 760px) {
  .kiosk-devices-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kiosk-devices-panel > .panel-title-row {
    align-items: stretch;
    flex-direction: column;
  }

  .kiosk-devices-panel > .panel-title-row .panel-count {
    align-self: flex-start;
    margin-left: 0;
  }

  .archived-kiosk-device-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .archived-kiosk-device-row .primary-action {
    justify-self: start;
  }

  .kiosk-activation-code-row strong {
    font-size: 20px;
  }
}

.inline-action {
  width: auto;
  min-width: 116px;
}

.empty-body {
  min-height: 420px;
  border-style: dashed;
}

.full-field,
.user-modal-actions {
  grid-column: 1 / -1;
}

.user-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.user-modal-header span,
.form-hint {
  color: var(--pf-muted);
  font-size: 12px;
}

.role-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 600;
}

.user-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.backend-list-panel {
  min-width: 0;
}

.backend-directory-card {
  align-content: start;
  overflow: hidden;
}

.backend-directory-title {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 340px) auto;
}

.backend-directory-title input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 0 11px;
}

.backend-directory-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
}

.backend-directory-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  color: var(--pf-ink);
  font-size: 13px;
}

.backend-directory-table th,
.backend-directory-table td {
  border-bottom: 1px solid var(--pf-line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.backend-directory-table th {
  background: var(--pf-blue-soft);
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}

.backend-directory-table tbody tr:last-child td {
  border-bottom: 0;
}

.backend-directory-table td {
  overflow-wrap: anywhere;
}

.backend-directory-table td strong {
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.identity-mismatch-settings {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(280px, 420px) auto;
  align-items: end;
  gap: 14px 18px;
  border-bottom: 1px solid var(--pf-line);
  padding: 4px 0 20px;
}

.identity-mismatch-settings-copy h2,
.identity-mismatch-settings-copy p {
  margin: 0;
}

.identity-mismatch-settings-copy h2 {
  color: var(--pf-blue-dark);
  font-size: 16px;
}

.identity-mismatch-settings-copy p,
.identity-mismatch-cron-status {
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.45;
}

.identity-mismatch-settings-copy p {
  margin-top: 5px;
}

.identity-mismatch-enabled {
  align-self: center;
}

.identity-mismatch-recipients textarea {
  min-height: 78px;
  resize: vertical;
}

.identity-mismatch-settings-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
}

.identity-mismatch-settings-actions .form-status {
  max-width: 260px;
  text-align: right;
}

.identity-mismatch-title {
  margin-top: 4px;
}

.identity-mismatch-table-wrap {
  margin-bottom: 14px;
}

.identity-mismatch-table tbody tr[data-identity-mismatch-id] {
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.identity-mismatch-table tbody tr[data-identity-mismatch-id]:hover,
.identity-mismatch-table tbody tr[data-identity-mismatch-id]:focus-visible {
  background: #f5f8fb;
  box-shadow: inset 3px 0 0 var(--pf-yellow);
  outline: 0;
}

.identity-mismatch-table td small {
  display: block;
  margin-top: 4px;
  color: var(--pf-muted);
}

.identity-mismatch-dialog {
  width: min(940px, calc(100vw - 40px));
  max-height: min(820px, calc(100vh - 40px));
  overflow: auto;
}

.identity-mismatch-detail {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.identity-mismatch-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #f5f8fb;
  color: var(--pf-muted);
  font-weight: 700;
}

.identity-mismatch-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.identity-mismatch-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--pf-line);
}

.identity-mismatch-facts > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  border-bottom: 1px solid var(--pf-line);
  padding: 11px 12px;
}

.identity-mismatch-facts > div > span {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
}

.identity-mismatch-facts > div > strong {
  color: var(--pf-blue-dark);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.identity-mismatch-facts .identity-mismatch-candidates {
  grid-column: 1 / -1;
}

.identity-mismatch-candidates ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.identity-mismatch-candidates li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.identity-mismatch-review-form {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 1.3fr);
  gap: 16px;
  border-top: 1px solid var(--pf-line);
  margin-top: 22px;
  padding-top: 18px;
}

.identity-mismatch-review-form .form-status,
.identity-mismatch-review-form .user-modal-actions {
  grid-column: 1 / -1;
}

.backend-directory-status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.backend-directory-message-row td {
  height: 96px;
  color: var(--pf-muted);
  text-align: center;
}

@media (max-width: 820px) {
  .backend-directory-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .backend-directory-title input {
    grid-column: 1 / -1;
  }

  .backend-directory-title .panel-heading-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .backend-directory-title .panel-count {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
  }

  .identity-mismatch-settings {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .identity-mismatch-settings-actions {
    justify-items: stretch;
  }

  .identity-mismatch-settings-actions .form-status {
    max-width: none;
    text-align: left;
  }

  .identity-mismatch-detail,
  .identity-mismatch-review-form {
    grid-template-columns: 1fr;
  }

  .identity-mismatch-photo {
    width: min(100%, 360px);
    justify-self: center;
  }
}

.visitor-companies-card {
  align-content: start;
  overflow: hidden;
}

.visitor-companies-title {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) auto auto;
}

.visitor-companies-title input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  padding: 0 11px;
}

.visitor-companies-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
}

.visitor-companies-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  color: var(--pf-ink);
  font-size: 13px;
}

.visitor-companies-table th,
.visitor-companies-table td {
  border-bottom: 1px solid var(--pf-line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.visitor-companies-table th {
  background: var(--pf-blue-soft);
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}

.visitor-companies-table th:nth-child(1) {
  width: 34%;
}

.visitor-companies-table th:nth-child(2),
.visitor-companies-table th:nth-child(3) {
  width: 9%;
}

.visitor-companies-table th:nth-child(4) {
  width: 20%;
}

.visitor-companies-table tbody tr:last-child td {
  border-bottom: 0;
}

.visitor-companies-table td:first-child strong,
.visitor-companies-table td:first-child small {
  display: block;
}

.visitor-companies-table td:first-child strong {
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.visitor-companies-table td:first-child small {
  margin-top: 3px;
  color: var(--pf-muted);
}

.visitor-companies-table tr.is-merged td:first-child strong {
  color: var(--pf-muted);
}

.visitor-company-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.visitor-company-table-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.visitor-companies-message-row td {
  height: 96px;
  color: var(--pf-muted);
  text-align: center;
}

.visitor-company-dialog {
  width: min(580px, calc(100vw - 40px));
}

.visitor-company-form {
  grid-template-columns: minmax(0, 1fr);
}

.visitor-company-merge-note {
  margin: 0;
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.5;
}

.list-management-card {
  align-content: start;
  overflow: hidden;
}

.list-management-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.list-management-table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
}

.list-management-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  color: var(--pf-ink);
  font-size: 13px;
}

.list-management-table th,
.list-management-table td {
  border-bottom: 1px solid var(--pf-line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: middle;
}

.list-management-table th {
  background: var(--pf-blue-soft);
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 800;
}

.list-management-table tbody tr:last-child td {
  border-bottom: 0;
}

.list-management-table td:first-child strong,
.list-management-table td:first-child small {
  display: block;
}

.list-management-table td:first-child strong {
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.list-management-table td:first-child small {
  margin-top: 3px;
  color: var(--pf-muted);
}

.station-settings-table {
  min-width: 720px;
  table-layout: fixed;
}

.station-settings-table th:nth-child(1) {
  width: 34%;
}

.station-settings-table th:nth-child(2),
.station-settings-table th:nth-child(3) {
  width: 13%;
}

.station-settings-table th:nth-child(4),
.station-settings-table th:nth-child(5) {
  width: 20%;
}

.station-settings-table tbody tr[data-station-settings-id] {
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.station-settings-table tbody tr[data-station-settings-id]:hover,
.station-settings-table tbody tr[data-station-settings-id]:focus-visible {
  background: #f5f9fd;
  box-shadow: inset 4px 0 0 var(--pf-gold);
  outline: 0;
}

.station-settings-time {
  color: var(--pf-blue-dark);
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.station-settings-table td:first-child .badge {
  margin-top: 6px;
}

.station-settings-dialog {
  width: min(620px, calc(100vw - 40px));
}

.station-settings-dialog .modal-title-row span {
  display: block;
  margin-top: 4px;
  color: var(--pf-muted);
  font-size: 13px;
}

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

.station-settings-form .modal-field > span {
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.station-settings-form input[type="time"],
.station-settings-form input[type="number"] {
  min-height: 42px;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.station-auto-checkout-field {
  margin-top: 4px;
  align-self: stretch;
}

.station-portal-location-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px solid #d8e1ea;
}

.station-portal-location-heading strong,
.station-portal-location-heading small {
  display: block;
}

.station-portal-location-heading strong {
  color: var(--pf-blue-dark);
  font-size: 14px;
}

.station-portal-location-heading small {
  margin-top: 4px;
  color: var(--pf-muted);
  font-size: 12px;
  line-height: 1.4;
}

.station-portal-radius-field input {
  max-width: 220px;
}

.station-location-map-modal {
  z-index: 50;
}

.station-location-map-dialog {
  grid-template-rows: auto auto minmax(320px, 54vh) auto auto;
  width: min(860px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow: hidden;
}

.station-location-map-dialog .modal-title-row span {
  display: block;
  margin-top: 4px;
  color: var(--pf-muted);
  font-size: 13px;
}

.station-location-map-status {
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #f5f8fb;
  color: var(--pf-muted);
  font-size: 14px;
  font-weight: 700;
}

.station-location-map-canvas {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #e8eef4;
  overflow: hidden;
}

.station-location-map-canvas.leaflet-container {
  color: var(--pf-ink);
  font-family: inherit;
}

.station-location-map-selection {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--pf-muted);
  font-size: 13px;
}

.station-location-map-selection strong {
  color: var(--pf-blue-dark);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

@media (max-width: 620px) {
  .station-portal-location-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .station-location-map-modal {
    padding: 12px;
  }

  .station-location-map-dialog {
    grid-template-rows: auto auto minmax(300px, 52vh) auto auto;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 16px;
  }

  .station-location-map-selection {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.list-management-message-row td {
  height: 96px;
  color: var(--pf-muted);
  text-align: center;
}

.list-management-actions {
  display: flex;
  justify-content: flex-end;
}

.list-management-action {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.notification-purpose-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.notification-purpose-badges .badge {
  white-space: nowrap;
}

.notification-delivery-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #cdd9e6;
  border-radius: var(--radius);
  background: #f5f8fb;
  color: var(--pf-blue-dark);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
}

.notification-delivery-badge.screen {
  border-color: #e2c34e;
  background: #fff9dc;
}

.list-editor-dialog {
  width: min(580px, calc(100vw - 40px));
}

.list-editor-form {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr);
}

.list-editor-active {
  align-self: end;
}

.visitor-notification-editor-dialog {
  width: min(860px, calc(100vw - 40px));
}

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

.visitor-notification-form textarea {
  min-height: 150px;
  padding: 10px;
  resize: vertical;
}

.notification-delivery-field,
.notification-purpose-field {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.notification-delivery-field legend,
.notification-purpose-field legend {
  margin-bottom: 7px;
  color: var(--pf-blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.notification-delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
}

.notification-delivery-options label {
  position: relative;
  display: grid;
  min-height: 42px;
  place-items: center;
  border-right: 1px solid var(--pf-line);
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.notification-delivery-options label:last-child {
  border-right: 0;
}

.notification-delivery-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.notification-delivery-options label:has(input:checked) {
  background: var(--pf-blue);
  color: var(--pf-white);
}

.notification-purpose-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 9px;
}

.notification-purpose-options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.notification-purpose-options input {
  width: 18px;
  height: 18px;
}

.notification-existing-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: #f8fafc;
  padding: 9px 11px;
}

.notification-existing-attachment a {
  min-width: 0;
  overflow: hidden;
  color: var(--pf-blue);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .list-management-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .list-management-title .panel-heading-copy {
    grid-column: 1 / -1;
  }

  .visitor-notification-form,
  .list-editor-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .visitor-companies-title {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .visitor-companies-title .panel-heading-copy,
  .visitor-companies-title input {
    grid-column: 1 / -1;
  }
}

.mail-settings-page.active {
  display: grid;
  align-content: start;
  gap: 18px;
}

.mail-settings-card,
.manager-notification-card {
  align-content: start;
  overflow: hidden;
}

.manager-notification-title {
  grid-template-columns: minmax(0, 1fr) auto;
}

.manager-notification-toolbar {
  display: grid;
  grid-template-columns: minmax(320px, 560px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
}

.manager-notification-test-recipient {
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
}

.manager-notification-automation {
  justify-self: end;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.manager-notification-automation.available {
  color: #1d6b3a;
}

.manager-notification-automation.unavailable {
  color: #9b2929;
}

.manager-notification-feedback {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #e8f0fa;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.manager-notification-feedback.success {
  background: #e7f6ed;
  color: #1d6b3a;
}

.manager-notification-feedback.error {
  background: #fae9e9;
  color: #9b2929;
}

.manager-notification-grid,
.manager-notification-delivery-grid {
  overflow-x: auto;
}

.manager-notification-row {
  min-width: 1120px;
  grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1.1fr) minmax(155px, 0.9fr) minmax(190px, 1fr) minmax(150px, 0.8fr) 190px;
}

.manager-notification-delivery-row {
  min-width: 920px;
  grid-template-columns: 150px minmax(190px, 1fr) minmax(210px, 1fr) minmax(220px, 1.1fr) minmax(130px, 0.7fr);
}

.manager-notification-row > span,
.manager-notification-delivery-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.manager-notification-row strong,
.manager-notification-row small,
.manager-notification-delivery-row strong,
.manager-notification-delivery-row small {
  display: block;
}

.manager-notification-row small,
.manager-notification-delivery-row small {
  margin-top: 3px;
  color: var(--pf-muted);
  font-size: 11px;
  line-height: 1.35;
}

.manager-notification-dialog {
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.manager-notification-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.manager-notification-name-field {
  grid-column: span 2;
}

.manager-notification-custom-field {
  grid-column: span 2;
}

.manager-notification-body-field textarea {
  min-height: 180px;
  line-height: 1.45;
}

.manager-notification-placeholders {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  gap: 6px 10px;
  border-top: 1px solid var(--pf-line);
  padding-top: 10px;
  color: var(--pf-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
}

.manager-notification-active-field {
  grid-column: span 2;
}

.manager-notification-modal-test {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.manager-notification-modal-test button {
  min-height: 36px;
}

.manager-notification-form .form-status,
.manager-notification-actions {
  grid-column: 1 / -1;
}

.manager-notification-form .form-status {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #e8f0fa;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.manager-notification-form .form-status.error {
  background: #fae9e9;
  color: #9b2929;
}

.mail-settings-title {
  display: grid;
  align-items: center;
}

.mail-journal-title {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.mail-settings-profile-title {
  grid-template-columns: minmax(0, 1fr) auto;
}

.mail-settings-title .panel-count {
  justify-self: end;
}

.mail-settings-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.mail-settings-heading h2 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 19px;
  font-weight: 700;
}

.mail-profile-count {
  color: var(--pf-muted);
  font-size: 13px;
  font-weight: 700;
}

.mail-profile-count.success {
  color: #1d6b3a;
}

.mail-profile-count.error {
  color: #9b2929;
}

.mail-settings-copy {
  margin: 0;
  color: var(--pf-muted);
  font-size: 13px;
  line-height: 1.45;
}

.mail-test-recipient {
  width: min(420px, 100%);
}

body[data-view="backend-mail"] .mail-test-recipient {
  display: grid;
  width: min(560px, 100%);
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
}

.mail-section-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--pf-line);
}

.mail-section-title h3 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 17px;
  font-weight: 700;
}

.mail-section-title input {
  width: min(360px, 100%);
  min-height: 38px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--pf-white);
  color: var(--pf-ink);
}

.mail-account-grid,
.mail-host-grid,
.mail-notification-grid,
.mail-log-grid {
  overflow-x: auto;
}

.mail-account-row {
  min-width: 1220px;
  grid-template-columns: minmax(175px, 1fr) minmax(225px, 1.25fr) minmax(210px, 1.15fr) minmax(210px, 1fr) 292px;
}

.mail-account-row.is-default {
  background: #fffdf4;
  box-shadow: inset 4px 0 var(--pf-gold);
}

.mail-host-row {
  min-width: 850px;
  grid-template-columns: minmax(200px, 1.15fr) minmax(190px, 1fr) minmax(280px, 1.4fr) 92px;
}

.mail-notification-row {
  min-width: 990px;
  grid-template-columns: 150px minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(210px, 1.1fr);
}

.mail-log-row {
  min-width: 800px;
  grid-template-columns: 150px minmax(190px, 1fr) minmax(240px, 1.25fr) minmax(240px, 1.25fr);
}

.mail-account-row > span,
.mail-host-row > span,
.mail-notification-row > span,
.mail-log-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mail-account-row strong,
.mail-host-row strong,
.mail-notification-row strong,
.mail-log-row strong,
.mail-account-row small,
.mail-host-row small,
.mail-notification-row small,
.mail-log-row small,
.mail-host-email-field small {
  display: block;
}

.mail-account-row small,
.mail-host-row small,
.mail-notification-row small,
.mail-log-row small,
.mail-host-email-field small {
  margin-top: 3px;
  color: var(--pf-muted);
  font-size: 11px;
  line-height: 1.35;
}

.mail-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.mail-small-action {
  min-width: 68px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.mail-use-action {
  min-width: 130px;
}

.mail-account-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mail-host-email-field {
  display: grid;
  min-width: 0;
}

.mail-host-email-field input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--pf-white);
  color: var(--pf-ink);
}

.status-pill,
.mail-queue-status {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2f6;
  color: #526174;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.status-pill.active,
.mail-queue-status.sent {
  background: #e7f6ed;
  color: #1d6b3a;
}

.status-pill.disabled,
.mail-queue-status.failed {
  background: #fae9e9;
  color: #9b2929;
}

.status-pill.selected {
  background: #fff4d2;
  color: #765400;
}

.mail-queue-status.pending,
.mail-queue-status.sending {
  background: #fff4d2;
  color: #765400;
}

.mail-queue-status.waiting_account,
.mail-queue-status.waiting_recipient {
  background: #e8f0fa;
  color: #245989;
}

.mail-account-dialog {
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.mail-account-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mail-checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  align-self: end;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
}

.mail-checkbox-field input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.mail-account-form .form-status,
.mail-account-actions {
  grid-column: 1 / -1;
}

.mail-account-form .form-status {
  min-height: 38px;
  border-radius: var(--radius);
  padding: 9px 11px;
  background: #e8f0fa;
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 600;
}

.mail-account-form .form-status.error {
  background: #fae9e9;
  color: #9b2929;
}

@media (max-width: 1000px) {
  .mail-account-form,
  .manager-notification-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .manager-notification-name-field,
  .manager-notification-custom-field,
  .manager-notification-active-field,
  .manager-notification-modal-test {
    grid-column: 1 / -1;
  }

  .manager-notification-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .manager-notification-automation {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 1320px) {
  .mail-account-row {
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mail-account-row.header > span:last-child {
    display: none;
  }

  .mail-account-row .mail-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

body[data-view="lists"] .mail-account-row {
  min-width: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body[data-view="lists"] .mail-account-row.header > span:last-child {
  display: none;
}

body[data-view="lists"] .mail-account-row .mail-row-actions {
  grid-column: 1 / -1;
  justify-content: flex-start;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 184px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 16px;
  }

  .brand span {
    display: none;
  }

  .nav-link {
    min-width: 46px;
    min-height: 46px;
    padding: 0 11px;
  }

  .nav-link[data-tab="backend-permissions"] {
    min-width: 46px;
  }

  .nav-icon {
    display: block;
  }

  .nav-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 150px minmax(0, 1fr);
    min-height: auto;
    padding: 10px 14px;
  }

  .main-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    height: 42px;
    overflow-x: auto;
  }

  .topbar-tools {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

  .workspace-main {
    grid-column: 1;
  }

  .record-row,
  .database-action-panel {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .brand img {
    width: 118px;
  }

  .mode-option {
    min-width: 45px;
  }

  .workspace-main {
    padding: 18px 14px;
  }

  .modal-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .mail-settings-title,
  .mail-section-title {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .mail-settings-title .panel-count {
    justify-self: start;
  }

  .mail-section-title input,
  .mail-settings-title .inline-action {
    width: 100%;
  }

  body[data-view="backend-mail"] .mail-test-recipient {
    grid-template-columns: minmax(0, 1fr);
  }

  .mail-account-dialog {
    width: calc(100vw - 24px);
  }

  .modal-title-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .login-card {
    padding: 28px 22px;
  }
}

body[data-view="frontend-logs"] .workspace-grid,
body[data-view="backend-logs"] .workspace-grid,
body[data-view="lists"] .workspace-grid {
  grid-template-columns: 258px minmax(0, 1fr);
}

body[data-view="frontend-logs"] .workspace-main,
body[data-view="backend-logs"] .workspace-main,
body[data-view="lists"] .workspace-main {
  grid-column: 2;
  grid-row: 1;
}

.checkin-logs-sidebar,
.backend-lists-sidebar {
  position: sticky;
  top: 58px;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  align-content: start;
  gap: 20px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  border-right: 1px solid var(--pf-line);
  background: #eef3f8;
  padding: 24px 16px;
}

.checkin-logs-sidebar h2,
.backend-lists-sidebar h2 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 24px;
  font-weight: 700;
}

.backend-lists-sidebar {
  gap: 16px;
}

.backend-lists-menu {
  display: grid;
  gap: 4px;
}

.backend-list-link {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px 0 16px;
  background: transparent;
  color: #40546c;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.backend-list-link::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: transparent;
  content: "";
}

.backend-list-link:hover,
.backend-list-link:focus-visible {
  border-color: #d4dee9;
  background: rgba(255, 255, 255, 0.72);
  color: var(--pf-blue-dark);
}

.backend-list-link.active {
  border-color: #cbd6e3;
  background: var(--pf-white);
  color: var(--pf-blue-dark);
}

.backend-list-link.active::before {
  background: var(--pf-gold);
}

.checkin-log-filter-section,
.checkin-log-filter-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.checkin-log-filter-section {
  margin: 0;
  border: 0;
  padding: 0;
}

.checkin-log-filter-section legend,
.checkin-log-filter-label,
.checkin-log-filter-field > span {
  color: #53667c;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.checkin-log-filter-field select,
.checkin-log-filter-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd6e3;
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-ink);
  font: inherit;
  padding: 0 10px;
}

.checkin-log-filter-field input[type="date"] {
  min-width: 0;
}

.checkin-log-type-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid #cbd6e3;
  border-radius: var(--radius);
  background: var(--pf-white);
}

.checkin-log-type-filter label {
  position: relative;
  min-width: 0;
}

.checkin-log-type-filter label + label {
  border-left: 1px solid #cbd6e3;
}

.checkin-log-type-filter input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkin-log-type-filter span {
  display: grid;
  place-items: center;
  min-height: 40px;
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.checkin-log-type-filter input:checked + span {
  background: var(--pf-blue-dark);
  color: var(--pf-white);
}

.checkin-log-type-filter input:focus-visible + span {
  outline: 2px solid var(--pf-gold);
  outline-offset: -3px;
}

.checkin-log-display-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid #cbd6e3;
  border-radius: var(--radius);
  background: var(--pf-white);
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 11px;
  cursor: pointer;
}

.checkin-log-display-toggle input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--pf-blue);
}

.checkin-log-display-toggle input:focus-visible {
  outline: 2px solid var(--pf-gold);
  outline-offset: 2px;
}

.checkin-log-timeline-toggle {
  width: 100%;
  min-height: 44px;
}

.checkin-log-timeline-toggle.active {
  border-color: var(--pf-blue-dark);
  background: var(--pf-blue-dark);
  color: var(--pf-white);
}

.checkin-log-reset {
  width: 100%;
  margin-top: 2px;
}

.checkin-logs-page {
  min-width: 0;
}

.checkin-logs-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.checkin-logs-header h1 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 28px;
  font-weight: 700;
}

.checkin-logs-header p,
.checkin-logs-updated {
  margin: 5px 0 0;
  color: var(--pf-muted);
  font-size: 13px;
}

.checkin-logs-updated {
  flex: 0 0 auto;
  text-align: right;
}

.checkin-logs-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.clear-checkin-logs-panel {
  width: min(560px, calc(100vw - 48px));
}

.clear-checkin-logs-copy {
  margin: 6px 0 0;
  color: var(--pf-muted);
  font-size: 13px;
}

.clear-checkin-logs-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.clear-checkin-logs-warning {
  margin: 0;
  border-left: 4px solid #b91c1c;
  background: #fef2f2;
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.45;
  padding: 11px 12px;
}

.checkin-logs-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--pf-line);
  border-radius: var(--radius);
  background: var(--pf-white);
}

.checkin-logs-table {
  width: 100%;
  min-width: 710px;
  border-collapse: collapse;
  table-layout: fixed;
}

.checkin-logs-table.show-checkout-photos {
  min-width: 800px;
}

.checkin-logs-table.timeline-mode {
  min-width: 640px;
}

.checkin-log-checkout-photo-column[hidden],
.checkin-log-duration-column[hidden] {
  display: none;
}

.checkin-logs-table th,
.checkin-logs-table td {
  border-bottom: 1px solid var(--pf-line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

.checkin-logs-table th {
  background: #f0f4f8;
  color: #52647a;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.checkin-logs-table th:nth-child(1) {
  width: 82px;
}

.checkin-logs-table th:nth-child(2) {
  width: 116px;
}

.checkin-logs-table td:nth-child(2) {
  white-space: nowrap;
}

.checkin-logs-table th:nth-child(4),
.checkin-logs-table th:nth-child(5) {
  width: 122px;
}

.checkin-logs-table th:nth-child(6) {
  width: 82px;
}

.checkin-logs-table th:nth-child(7) {
  width: 112px;
}

.checkin-logs-table tbody tr:last-child td {
  border-bottom: 0;
}

.checkin-logs-table tbody tr[data-checkin-log-key] {
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.checkin-logs-table tbody tr[data-checkin-log-key]:hover,
.checkin-logs-table tbody tr[data-checkin-log-key]:focus-visible {
  background: #f5f9fd;
  box-shadow: inset 4px 0 0 var(--pf-gold);
  outline: 0;
}

.checkin-log-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid #cad6e3;
  border-radius: var(--radius);
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.checkin-log-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.checkin-log-photo img.checkin-log-photo-pending {
  opacity: 0;
}

.checkin-log-person {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.checkin-log-person strong {
  overflow: hidden;
  color: var(--pf-blue-dark);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-log-person small {
  overflow: hidden;
  color: var(--pf-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkin-log-type {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 22px;
  border-radius: 999px;
  background: var(--pf-blue-soft);
  color: var(--pf-blue-dark);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
}

.checkin-log-type.visitor {
  background: #fff3cf;
  color: #6f5200;
}

.checkin-log-event {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  white-space: nowrap;
}

.checkin-log-event.check-in {
  background: #e4f4ea;
  color: #176438;
}

.checkin-log-event.check-out {
  background: #fee8e8;
  color: #9f2525;
}

.checkin-log-time,
.checkin-log-duration {
  color: var(--pf-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.checkin-log-open {
  display: block;
  margin-top: 4px;
  color: #1d6b3a;
  font-size: 11px;
  font-weight: 700;
}

.checkin-logs-message-row td {
  height: 180px;
  color: var(--pf-muted);
  text-align: center;
}

.checkin-log-detail-panel {
  width: min(820px, calc(100vw - 48px));
}

.checkin-log-detail-layout {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.checkin-log-detail-photo {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
}

.checkin-log-detail-info {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.checkin-log-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.checkin-log-detail-info h3 {
  margin: 0;
  color: var(--pf-blue-dark);
  font-size: 25px;
  overflow-wrap: anywhere;
}

.checkin-log-detail-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--pf-line);
}

.checkin-log-detail-list > div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  border-bottom: 1px solid var(--pf-line);
  padding: 11px 0;
}

.checkin-log-detail-list dt {
  color: var(--pf-muted);
  font-size: 12px;
  font-weight: 700;
}

.checkin-log-detail-list dd {
  margin: 0;
  color: var(--pf-ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (min-width: 901px) and (max-width: 1180px) {
  body[data-view="frontend-logs"] .workspace-main,
  body[data-view="backend-logs"] .workspace-main,
  body[data-view="lists"] .workspace-main {
    padding: 20px 18px;
  }

  .checkin-logs-table {
    min-width: 680px;
  }

  .checkin-logs-table th,
  .checkin-logs-table td {
    padding-right: 10px;
    padding-left: 10px;
  }

  .checkin-logs-table th:nth-child(1) {
    width: 74px;
  }

  .checkin-logs-table th:nth-child(2) {
    width: 112px;
  }

  .checkin-logs-table th:nth-child(4),
  .checkin-logs-table th:nth-child(5) {
    width: 112px;
  }

  .checkin-logs-table th:nth-child(6) {
    width: 74px;
  }

  .checkin-logs-table th:nth-child(7) {
    width: 94px;
  }
}

@media (max-width: 900px) {
  body[data-view="frontend-logs"] .workspace-grid,
  body[data-view="backend-logs"] .workspace-grid,
  body[data-view="lists"] .workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body[data-view="lists"] .workspace-grid {
    align-content: start;
  }

  body[data-view="frontend-logs"] .workspace-main,
  body[data-view="backend-logs"] .workspace-main,
  body[data-view="lists"] .workspace-main {
    grid-column: 1;
    grid-row: 2;
    padding: 20px;
  }

  .checkin-logs-sidebar {
    position: static;
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--pf-line);
    padding: 18px 20px;
  }

  .checkin-logs-sidebar h2,
  .checkin-log-reset {
    grid-column: 1 / -1;
  }

  .backend-lists-sidebar {
    position: static;
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--pf-line);
    padding: 16px 20px;
  }

  .backend-lists-sidebar h2 {
    font-size: 20px;
  }

  .backend-lists-menu {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .backend-list-link {
    justify-content: center;
    padding: 0 8px;
    text-align: center;
  }

  .backend-list-link::before {
    top: auto;
    right: 8px;
    bottom: 0;
    left: 8px;
    width: auto;
    height: 3px;
  }
}

@media (max-width: 660px) {
  .backend-lists-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkin-logs-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkin-logs-sidebar h2,
  .checkin-log-reset {
    grid-column: 1;
  }

  .checkin-logs-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .checkin-logs-updated {
    text-align: left;
  }

  .checkin-log-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkin-log-detail-photo {
    width: min(280px, 100%);
    justify-self: center;
  }
}
