:root {
  --pharos-navy: #1e3a5f;
  --pharos-navy-dark: #152a45;
  --pharos-accent: #2f6fed;
  --pharos-bg: #f0f3f7;
  --pharos-sidebar: #1e3a5f;
  --pharos-sidebar-text: rgba(255, 255, 255, 0.85);
  --pharos-panel-border: #dde3ec;
}

body {
  margin: 0;
  background: var(--pharos-bg);
  color: #1a2332;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* —— Login —— */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, #152a45 0%, #1e3a5f 45%, #2a4a73 100%);
  padding: 1.5rem;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.login-card {
  border: none;
  border-radius: 0.75rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.65rem;
  background: var(--pharos-navy);
  color: #fff;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.brand-mark-sm {
  width: 2rem;
  height: 2rem;
  font-size: 0.95rem;
  border-radius: 0.45rem;
  vertical-align: middle;
}

.brand-logo {
  display: inline-block;
  width: 3rem;
  height: 3rem;
  border-radius: 0.65rem;
  object-fit: cover;
  vertical-align: middle;
}

.brand-logo-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 0.45rem;
}

.login-page .btn-primary {
  background: var(--pharos-accent);
  border-color: var(--pharos-accent);
}

.login-page .btn-primary:hover {
  background: #245ccc;
  border-color: #245ccc;
}

/* —— Complete registration (public) —— */
.register-page {
  min-height: 100vh;
  background:
    linear-gradient(160deg, #152a45 0%, #1e3a5f 45%, #2a4a73 100%);
  padding: 1.5rem;
}

.register-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.register-wrap-narrow {
  max-width: 520px;
  margin-top: 4vh;
}

.register-panel {
  border: none;
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.18);
}

.register-page .btn-primary {
  background: var(--pharos-accent);
  border-color: var(--pharos-accent);
}

.register-page .btn-primary:hover {
  background: #245ccc;
  border-color: #245ccc;
}

.register-page .btn-outline-primary {
  color: var(--pharos-accent);
  border-color: var(--pharos-accent);
}

.register-page .btn-outline-primary:hover {
  background: var(--pharos-accent);
  border-color: var(--pharos-accent);
  color: #fff;
}

.register-page .form-control:disabled,
.register-page .form-control[readonly] {
  background-color: #eef2f7;
  opacity: 1;
}

/* —— Dashboard shell —— */
.dashboard-page {
  background: var(--pharos-bg);
}

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--pharos-sidebar);
  color: var(--pharos-sidebar-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
}

.sidebar-brand {
  color: #fff;
  display: flex;
  align-items: center;
}

.sidebar .nav-link {
  color: var(--pharos-sidebar-text);
  border-radius: 0.4rem;
  padding: 0.55rem 0.75rem;
}

.sidebar .nav-link:hover:not(.disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar .nav-link.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-weight: 600;
}

.sidebar .nav-link.disabled {
  opacity: 0.45;
}

.sidebar .nav-section-toggle {
  display: flex;
  align-items: center;
  text-align: left;
}

.sidebar .nav-section-chevron {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.sidebar .nav-section-toggle[aria-expanded="true"] .nav-section-chevron {
  transform: rotate(180deg);
}

.sidebar .pharos-admin-subnav {
  gap: 0.1rem;
  margin-top: 0.15rem;
}

.sidebar .nav-sublink {
  padding-left: 2.15rem;
  font-size: 0.92rem;
}

.sidebar-divider {
  border-color: rgba(255, 255, 255, 0.15);
  opacity: 1;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.sidebar-footer .btn {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-footer .btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.topbar {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.top-search {
  max-width: 50rem;
  position: relative;
}

.top-search .input-group {
  flex-wrap: nowrap;
}

.global-search-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 1050;
  background: #fff;
  border: 1px solid var(--pharos-panel-border);
  border-radius: 0.65rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  max-height: min(28rem, 70vh);
  overflow: auto;
  padding: 0.35rem 0;
}

.global-search-section + .global-search-section {
  border-top: 1px solid #eef1f5;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

.global-search-section-label {
  padding: 0.45rem 0.9rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.global-search-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.45rem 0.9rem;
  color: inherit;
}

.global-search-item:hover,
.global-search-item.is-active {
  background: #f1f5f9;
}

.global-search-item-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.1rem 0;
  color: inherit;
}

.global-search-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.global-search-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--pharos-navy);
}

.global-search-item-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.global-search-empty {
  padding: 0.85rem 0.9rem 0.35rem;
  color: #64748b;
  font-size: 0.9rem;
}

.global-search-footer {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid #eef1f5;
  background: #fafbfc;
  text-align: left;
  padding: 0.7rem 0.9rem;
  font-size: 0.85rem;
  color: var(--pharos-navy);
  font-weight: 600;
}

.global-search-footer:hover {
  background: #f1f5f9;
}

mark.search-hit {
  background: #fde68a;
  color: inherit;
  padding: 0 0.1em;
  border-radius: 0.15rem;
}

.site-picker {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 11rem;
}

.site-picker .form-select {
  min-width: 10.5rem;
  max-width: 16rem;
  border-color: var(--pharos-panel-border);
}

.user-chip {
  color: #334155;
}

.panel {
  background: #fff;
  border: 1px solid var(--pharos-panel-border);
  border-radius: 0.5rem;
  overflow: hidden;
}

.panel-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--pharos-panel-border);
  background: #fafbfc;
}

.panel-header-dark {
  background: var(--pharos-navy);
  border-bottom-color: var(--pharos-navy-dark);
  color: #fff;
}

.panel-header-dark .h6,
.panel-header-dark h2 {
  color: #fff;
}

.resident-profile-photo-frame {
  width: 100%;
  max-width: 180px;
  margin-inline: auto;
  background: #f8f9fa;
  border: 1px solid var(--pharos-panel-border);
  border-radius: 0.375rem;
  overflow: hidden;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resident-profile-photo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #fff;
}

.resident-profile-photo-placeholder {
  color: #6c757d;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.5rem 0.5rem;
}

.resident-profile-photo-placeholder i {
  font-size: 2.5rem;
  line-height: 1;
}

.resident-quick-parcel-bar {
  border-bottom: 1px solid var(--pharos-panel-border);
}

.resident-quick-parcel-bar .table {
  width: 100%;
  max-width: 32rem;
}

.resident-quick-parcel-bar th,
.resident-quick-parcel-bar td {
  width: 50%;
}

.resident-quick-parcel-bar th {
  font-weight: 700;
  color: #1a2332;
  background: #fff;
  border-bottom-color: #e5e7eb;
  padding: 0.65rem 1rem 0.35rem;
}

.resident-quick-parcel-bar td {
  background: #f8fafc;
  padding: 0.55rem 1rem 0.75rem;
  border-bottom: 0;
}

.pharos-stats-table th {
  white-space: nowrap;
  font-size: 0.8rem;
  vertical-align: middle;
}

.pharos-stats-table td {
  vertical-align: middle;
}

.pharos-stats-table .site-id-badge {
  display: inline-block;
  min-width: 2.5rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  color: var(--pharos-navy);
  background: #e8eef5;
  border-radius: 0.25rem;
}

.pharos-stats-actions {
  border-top: 1px solid var(--pharos-panel-border);
  background: #fafbfc;
}

.panel-body {
  padding: 1rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--pharos-panel-border);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
}

.stat-card .label {
  font-size: 0.8rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card .value {
  font-size: 1.5rem;
  font-weight: 650;
  color: var(--pharos-navy);
  line-height: 1.2;
}

.stat-card-interactive {
  cursor: pointer;
  appearance: none;
  display: block;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    transform 0.12s ease;
}

.stat-card-interactive:hover {
  border-color: #b8c6db;
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.08);
  background: #f8fafc;
}

.stat-card-interactive:active {
  transform: translateY(1px);
}

.stat-card-interactive:focus-visible {
  outline: 2px solid var(--pharos-accent);
  outline-offset: 2px;
}

.stat-card-interactive.is-active {
  border-color: var(--pharos-accent);
  background: #eef4ff;
  box-shadow: 0 0 0 1px var(--pharos-accent);
}

.stat-card-hint {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.stat-card-interactive.is-active .stat-card-hint {
  color: var(--pharos-accent);
}

.stat-detail-panel {
  border-color: #c5d4ea;
  box-shadow: 0 1px 4px rgba(30, 58, 95, 0.06);
}

.stat-summary-dl dt {
  font-weight: 500;
  padding-top: 0.35rem;
}

.stat-summary-dl dd {
  margin-bottom: 0.35rem;
  font-weight: 600;
  color: var(--pharos-navy);
}

.busy-summary-card .value {
  font-size: 1.35rem;
}

.busy-summary-in {
  color: #0d6efd;
}

.busy-summary-out {
  color: #198754;
}

.busy-grid th,
.busy-grid td {
  min-width: 7.5rem;
  vertical-align: middle;
}

.busy-grid th:first-child,
.busy-grid td:first-child {
  min-width: 4.5rem;
  position: sticky;
  left: 0;
  z-index: 1;
}

.busy-cell-line {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.busy-cell-line:last-child {
  margin-bottom: 0;
}

.busy-badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.8rem;
  line-height: 1.2;
  white-space: nowrap;
}

.busy-badge-in {
  background: #0d6efd;
  color: #fff;
}

.busy-badge-out {
  background: #198754;
  color: #fff;
}

.busy-badge-empty {
  color: #94a3b8;
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.busy-totals-row {
  background: #f8fafc;
  border-top: 2px solid #1e3a5f;
}

.list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef1f5;
  font-size: 0.9rem;
}

.list-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.list-row:first-child {
  padding-top: 0;
}

.btn-action {
  padding: 0.15rem 0.45rem;
  line-height: 1.2;
}

.table td.actions-cell {
  white-space: nowrap;
  width: 1%;
}

.table td.actions-cell .btn-group {
  gap: 0.15rem;
}

.properties-toolbar .properties-action-btn {
  white-space: nowrap;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.qty-stepper .qty-input {
  width: 3.25rem;
  text-align: center;
}

.signature-pad {
  touch-action: none;
  cursor: crosshair;
  max-width: 100%;
  height: 160px;
}

.parcel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  background: #e9eef4;
  border-radius: 0.5rem;
  padding: 0.85rem;
}

.parcel-card {
  background: #fff;
  border-radius: 0.55rem;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.12);
  padding: 0.85rem 0.9rem;
  position: relative;
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.parcel-card:hover {
  box-shadow: 0 2px 8px rgba(30, 58, 95, 0.18);
}

.parcel-card.selected {
  border-color: var(--pharos-accent);
  box-shadow: 0 0 0 1px var(--pharos-accent), 0 2px 8px rgba(47, 111, 237, 0.25);
  background: #f5f8ff;
}

.parcel-card.selected::after {
  content: "✓";
  position: absolute;
  top: 0.45rem;
  right: 0.55rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--pharos-accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.parcel-card-name {
  font-size: 0.85rem;
  color: #4a5568;
  margin-bottom: 0.35rem;
}

.parcel-card-storage {
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.parcel-card-items {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}

.parcel-card-ref {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

.key-signout-table-wrap {
  margin-top: 1rem;
}

.key-bundle-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.key-bundle-pick {
  border: 2px solid var(--pharos-panel-border);
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  background: #fff;
  text-align: center;
}

.key-bundle-pick.selected,
.key-bundle-pick:has(input:checked) {
  border-color: var(--pharos-accent);
  background: #f5f8ff;
}

.key-bundle-pick.disabled {
  pointer-events: none;
  cursor: not-allowed;
}

.key-bundle-pick img {
  max-width: 100%;
  height: 120px;
  object-fit: contain;
  margin: 0.5rem 0;
  background: #f0f3f7;
  border-radius: 0.35rem;
}

.key-bundle-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 0.3rem;
  background: #eef1f5;
}

/* Keep Sign keys out / status badges in one column across holder rows */
.key-holder-actions {
  display: inline-grid;
  grid-template-columns: 8.75rem auto;
  column-gap: 0.35rem;
  align-items: center;
  justify-content: start;
}

.key-holder-actions-manage {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  min-height: 1.75rem;
}

.key-holder-actions-sign {
  display: flex;
  align-items: center;
}

.file-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 140px;
  padding: 1rem;
  border: 2px dashed var(--pharos-panel-border);
  border-radius: 0.5rem;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.file-drop-zone:hover,
.file-drop-zone.is-dragover {
  border-color: var(--pharos-accent);
  background: #f0f5ff;
}

.file-drop-zone-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.file-drop-zone-preview {
  max-width: 100%;
  max-height: 140px;
  margin-top: 0.5rem;
  border-radius: 0.35rem;
  object-fit: contain;
}

/* Email template editor body (legacy min-height parity) */
.template-body-editor {
  min-height: 310px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* Site Visitors — visitor pass */
.visitors-table td {
  vertical-align: middle;
}

.visitor-pass {
  max-width: 42rem;
  background: #fff;
  border: 1px solid var(--pharos-panel-border) !important;
  border-radius: 0.65rem;
  overflow: hidden;
}

.visitor-pass-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: #f7f9fc;
  border-bottom: 1px solid var(--pharos-panel-border);
}

.visitor-pass-logo {
  max-height: 72px;
  max-width: 160px;
  object-fit: contain;
}

.visitor-pass-kicker {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.visitor-pass-title {
  color: var(--pharos-navy);
}

.visitor-pass-body {
  padding: 1.25rem 1.5rem;
}

.visitor-pass-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem 1.25rem;
}

.visitor-pass-grid dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.visitor-pass-grid dd {
  margin: 0;
  font-weight: 500;
  color: #1e293b;
}

.visitor-pass-span {
  grid-column: 1 / -1;
}

.visitor-pass-terms {
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid var(--pharos-panel-border);
  background: #fafbfc;
}

.visitor-pass-terms-body {
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: #334155;
}

@media (max-width: 575.98px) {
  .visitor-pass-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767.98px) {
  .sidebar {
    width: 72px;
  }

  .sidebar-brand strong,
  .sidebar .nav-link span {
    display: none;
  }

  .sidebar .nav-link {
    text-align: center;
    padding: 0.65rem;
  }

  .sidebar .nav-link i {
    margin-right: 0 !important;
  }

  .sidebar .nav-section-chevron {
    display: none;
  }

  .sidebar .nav-sublink {
    padding-left: 0.65rem;
  }

  .site-picker {
    min-width: 8.5rem;
  }

  .site-picker .form-select {
    min-width: 8.5rem;
  }
}

/* Collections tabbed overview */
.collections-tabs-panel .collections-tabs {
  border-bottom: 1px solid var(--pharos-panel-border);
  gap: 0.15rem;
}

.collections-tabs-panel .collections-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  border-radius: 0;
  padding: 0.75rem 0.9rem;
}

.collections-tabs-panel .collections-tabs .nav-link:hover {
  color: var(--pharos-navy);
  border-bottom-color: #cbd5e1;
}

.collections-tabs-panel .collections-tabs .nav-link.active {
  color: var(--pharos-navy);
  background: transparent;
  border-bottom-color: var(--pharos-navy);
}

.collections-tabs-panel .collections-tab-content .tab-pane[hidden] {
  display: none !important;
}

.settings-tabs-panel .settings-tabs {
  gap: 0.15rem;
  border-bottom: 1px solid var(--pharos-panel-border);
}

.settings-tabs-panel .settings-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  color: #64748b;
  font-weight: 600;
  border-radius: 0;
  padding: 0.75rem 0.9rem;
}

.settings-tabs-panel .settings-tabs .nav-link:hover {
  color: var(--pharos-navy);
  border-bottom-color: #cbd5e1;
}

.settings-tabs-panel .settings-tabs .nav-link.active {
  color: var(--pharos-navy);
  background: transparent;
  border-bottom-color: var(--pharos-navy);
}

.settings-tabs-panel .settings-tab-content .tab-pane[hidden] {
  display: none !important;
}

.collections-tab-search .form-control {
  border-color: var(--pharos-panel-border);
}

.collections-tab-footer {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid #eef1f5;
}

/* Parcel label OCR scanner */
.scan-resident-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.scan-resident-btn .bi-camera,
.scan-resident-btn .bi-camera-fill {
  font-size: 1rem;
  line-height: 1;
}

.scan-resident-btn-label {
  display: inline;
}

.scan-resident-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: min(58vh, 28rem);
  overflow: hidden;
  border-radius: 0.65rem;
  background: #0f172a;
}

.scan-resident-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-resident-frame {
  position: absolute;
  inset: 18% 14%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 0.5rem;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  pointer-events: none;
}

.scan-resident-frame-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.45rem);
  transform: translateX(-50%);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

#modal-scan-resident {
  z-index: 1065;
}

.scan-resident-match-list {
  max-height: min(50vh, 22rem);
  overflow: auto;
}

.scan-resident-photo-guide {
  border-style: dashed !important;
}

.scan-resident-photo-preview {
  display: block;
  width: 100%;
  max-height: min(50vh, 22rem);
  object-fit: contain;
  border-radius: 0.65rem;
  background: #0f172a;
}

/* Resident local services */
.resident-ls-filter {
  min-width: 14rem;
}

.resident-ls-table img.resident-ls-logo,
.resident-ls-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  background: #f8f9fa;
}

.resident-ls-logo-fallback {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
}

.resident-ls-empty {
  color: #6c757d;
}

.resident-ls-empty-icon {
  font-size: 2rem;
  opacity: 0.55;
}

.resident-ls-text-cell {
  white-space: pre-wrap;
  max-width: 18rem;
}

/* Resident Keys Management */
.rk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

.rk-tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0.15rem 0.65rem;
  color: var(--bs-secondary-color, #6c757d);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

.rk-tab:hover {
  color: var(--bs-body-color, #212529);
}

.rk-tab.active {
  color: var(--bs-primary, #0d6efd);
  border-bottom-color: var(--bs-primary, #0d6efd);
}

.rk-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  background: #e9ecef;
  color: #495057;
}

.rk-status-success {
  background: #d1e7dd;
  color: #0f5132;
}

.rk-status-warn {
  background: #fff3cd;
  color: #664d03;
}

.rk-status-danger {
  background: #f8d7da;
  color: #842029;
}

.rk-bundle-thumb,
.rk-holder-thumb,
.rk-thumb-preview {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid var(--bs-border-color, #dee2e6);
  background: #f8f9fa;
}

.rk-bundle-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 1.25rem;
}

.rk-history-search {
  max-width: 16rem;
}

.email-status-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.28em 0.65em;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.email-status-opened {
  background: #d1f2df;
  color: #0f7a3d;
}

.email-status-delivered {
  background: #d6e8ff;
  color: #1a5fb4;
}

.email-status-sent {
  background: #fff3cd;
  color: #8a6d1b;
}

.email-status-clicked {
  background: #e4d7ff;
  color: #5b2bbd;
}

.email-status-bounced {
  background: #f8d7da;
  color: #b02a37;
}

.email-status-not-sent {
  background: #e9ecef;
  color: #495057;
}

.comms-metric-card {
  border: 1px solid var(--bs-border-color, #dee2e6);
  box-shadow: none;
}

.comms-metric-card .comms-metric-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.comms-metric-recipients { border-top: 3px solid #5b6778; }
.comms-metric-delivered { border-top: 3px solid #1a5fb4; }
.comms-metric-opened { border-top: 3px solid #0f7a3d; }
.comms-metric-clicked { border-top: 3px solid #5b2bbd; }
.comms-metric-failed { border-top: 3px solid #b02a37; }
.comms-metric-pending { border-top: 3px solid #8a6d1b; }

.email-log-table th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5b6778;
}
