html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin: 0;
  background: #f7f8fa;
  color: #172033;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.navbar-brand {
  font-weight: 700;
}

.auth-shell {
  min-height: 72vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid #e2e5ea;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 16px 50px rgba(20, 26, 38, .08);
}

.auth-panel h1 {
  font-size: 1.8rem;
}

.auth-panel label {
  margin-top: 14px;
  margin-bottom: 6px;
  font-weight: 600;
}

.demo-login {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e8ebf0;
  color: #5b6472;
  font-size: .92rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.setup-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  background: #fff;
  border: 1px solid #e0e5ec;
  border-radius: 8px;
  color: #162033;
  text-decoration: none;
}

.setup-card:hover {
  border-color: #8bb3ff;
  color: #0b58ca;
}

.setup-card strong {
  font-size: 1.05rem;
}

.setup-card span {
  color: #657080;
}

.setup-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: #fff;
  border: 1px solid #e0e5ec;
  border-radius: 8px;
}

.setup-form.wide {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.setup-form .span-2 {
  grid-column: span 2;
}

@media (max-width: 700px) {
  .setup-form .span-2 {
    grid-column: span 1;
  }
}

.app-body {
  min-height: 100vh;
  overflow-x: hidden;
}

.app-shell {
  --sidebar-width: 276px;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  background: #f3f5f8;
}

.app-shell.sidebar-collapsed {
  --sidebar-width: 84px;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #101826;
  color: #e8edf6;
  padding: 18px 14px;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #2f7cf6;
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}

.brand-text {
  font-weight: 750;
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #bac5d8;
  text-decoration: none;
  font-weight: 600;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, .09);
  color: #fff;
}

.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  font-size: .78rem;
  font-weight: 800;
}

.sidebar-collapsed .brand-text,
.sidebar-collapsed .nav-text {
  opacity: 0;
  pointer-events: none;
}

.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 14px 26px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid #e3e8ef;
  backdrop-filter: blur(10px);
}

.icon-button {
  display: grid;
  gap: 4px;
  place-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
}

.icon-button span {
  display: block;
  width: 17px;
  height: 2px;
  background: #293548;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 750;
}

.topbar-subtitle {
  color: #657080;
  font-size: .88rem;
}

.topbar-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #4a5567;
  font-weight: 600;
}

.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e7efff;
  color: #1d5fd1;
  font-weight: 800;
}

.content-shell {
  width: min(100%, 1360px);
  padding: 28px;
}

.setup-card,
.setup-form {
  box-shadow: 0 10px 30px rgba(23, 32, 51, .04);
}

.form-control,
.form-select {
  min-height: 44px;
  border-color: #d8e0eb;
  border-radius: 8px;
  color: #172033;
}

.form-control::placeholder {
  color: #8a95a7;
}

.form-control:focus,
.form-select:focus {
  border-color: #2f7cf6;
  box-shadow: 0 0 0 .22rem rgba(47, 124, 246, .12);
}

.form-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fbfcfe;
}

.form-check .form-check-input {
  margin-left: 0;
}

.table {
  overflow: hidden;
  border: 1px solid #e0e5ec;
  border-radius: 8px;
  background: #fff;
}

.table thead th {
  background: #f1f4f8;
  color: #556174;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.table tbody td {
  color: #253044;
}

code {
  color: #174ea6;
  background: #eef4ff;
  border-radius: 6px;
  padding: 2px 6px;
}

.status-pill {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: .78rem;
  font-weight: 800;
}

.status-pill.active {
  background: #dcfce7;
  color: #166534;
}

.status-pill.inactive {
  background: #f1f5f9;
  color: #64748b;
}

.content-shell.is-loading {
  opacity: .68;
  pointer-events: none;
}

.content-shell.is-loading::before {
  content: "Processing...";
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 2000;
  padding: 9px 14px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: .88rem;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(17, 24, 39, .22);
}

.setup-form {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border-top: 3px solid #2f7cf6;
}

.form-control,
.form-select {
  min-height: 38px;
  padding: 7px 11px;
  font-size: .92rem;
  background-color: #fbfdff;
}

.btn {
  border-radius: 8px;
  font-weight: 700;
}

.btn-primary {
  background: linear-gradient(135deg, #246bfe, #0ea5e9);
  border: 0;
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-danger {
  background: #fff;
}

.list-panel {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, .05);
  overflow: hidden;
}

.list-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: linear-gradient(135deg, #eef6ff, #f9fbff);
  border-bottom: 1px solid #dfe7f1;
}

.list-toolbar .form-control,
.list-toolbar .form-select {
  min-height: 34px;
  background: #fff;
}

.list-summary {
  justify-self: end;
  color: #526071;
  font-size: .86rem;
  font-weight: 700;
}

.list-panel .table {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.list-panel .table th,
.list-panel .table td {
  padding: 8px 10px;
  vertical-align: middle;
}

.list-panel .table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.list-panel .table tbody tr:hover {
  background: #eef6ff;
}

.list-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  padding: 10px;
  background: #fbfdff;
  border-top: 1px solid #dfe7f1;
}

.pager-button {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid #d4dfec;
  border-radius: 8px;
  background: #fff;
  color: #263445;
  font-weight: 700;
}

.pager-button:hover:not(:disabled),
.pager-button.active {
  background: #246bfe;
  border-color: #246bfe;
  color: #fff;
}

.pager-button:disabled {
  opacity: .5;
}

.queue-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eef6ff;
  color: #174ea6;
  font-weight: 700;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.preview-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.preview-summary span {
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #dfe7f1;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .04);
}

.candidate-filled-summary,
.mapping-source-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.candidate-filled-summary > div,
.mapping-source-card > div {
  min-height: 68px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid #dbeafe;
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .04);
}

.candidate-filled-summary > div:nth-child(2n) {
  border-left-color: #16a34a;
}

.candidate-filled-summary > div:nth-child(3n) {
  border-left-color: #ea580c;
}

.candidate-data-shell {
  display: grid;
  gap: 16px;
}

.candidate-filled-summary span,
.mapping-source-card span {
  display: block;
  color: #667085;
  font-size: .76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.candidate-filled-summary strong,
.mapping-source-card strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.session-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.session-panel > div {
  min-width: 160px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(23, 32, 51, .04);
}

.session-label {
  display: block;
  color: #667085;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.automation-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: 0 10px 30px rgba(23, 32, 51, .05);
}

.automation-panel h2 {
  margin: 0;
  font-size: 1.02rem;
}

.automation-panel p {
  margin: 4px 0 0;
  color: #526071;
}

.automation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 860px) {
  .automation-panel {
    align-items: stretch;
    flex-direction: column;
  }

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

.page-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.page-status-strip span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f0fdf4;
  color: #166534;
  font-size: .84rem;
}

.audit-panel {
  margin-top: 18px;
  padding: 14px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(23, 32, 51, .05);
}

.audit-panel h2 {
  font-size: 1.02rem;
  margin: 0 0 10px;
}

.audit-item {
  display: grid;
  grid-template-columns: 120px 180px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
}

.audit-item:first-of-type {
  border-top: 0;
}

.audit-item span {
  color: #667085;
  font-size: .84rem;
}

.audit-item p {
  margin: 0;
}

@media (max-width: 760px) {
  .audit-item {
    grid-template-columns: 1fr;
  }
}

.preview-page {
  margin-top: 18px;
  background: #fff;
  border: 1px solid #dfe7f1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(23, 32, 51, .05);
}

.preview-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #eef6ff, #f9fbff);
  border-bottom: 1px solid #dfe7f1;
}

.preview-page-title h2 {
  margin: 0;
  font-size: 1.02rem;
}

.page-status-note {
  display: block;
  margin-top: 4px;
  color: #526071;
  font-size: .82rem;
  font-weight: 700;
}

.preview-page-title span {
  color: #526071;
  font-weight: 700;
}

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

.preview-page-actions form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.action-reason {
  width: 128px;
  min-height: 31px;
}

@media (max-width: 860px) {
  .preview-page-title {
    align-items: stretch;
    flex-direction: column;
  }

  .preview-page-actions {
    justify-content: flex-start;
  }

  .preview-page-actions form {
    width: 100%;
  }

  .action-reason {
    flex: 1;
    min-width: 0;
  }
}

.preview-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}

.wafeed-form-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  padding: 12px;
  background: linear-gradient(135deg, #fbfdff, #f8fafc);
}

.wafeed-form-row {
  display: grid;
  gap: 10px;
  align-items: start;
  min-height: 112px;
  padding: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0ea5e9;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 32, 51, .04);
}

.wafeed-form-row.missing {
  border-color: #fca5a5;
  border-left-color: #dc2626;
  background: #fff7f7;
}

.wafeed-form-label {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.wafeed-form-label strong {
  color: #334155;
  font-size: .82rem;
  text-transform: uppercase;
}

.wafeed-form-value {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wafeed-form-value > strong {
  color: #0f172a;
  font-size: 1rem;
}

.wafeed-form-map {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 7px;
  border-top: 1px dashed #d8e0eb;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.wafeed-form-map code {
  font-size: .76rem;
}

.mapping-table-wrap {
  overflow-x: auto;
}

.mapping-table-wrap .table {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.country-map-link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  color: #172033;
  text-decoration: none;
}

.country-map-link span {
  color: #2563eb;
  font-size: .76rem;
  font-weight: 800;
}

.country-map-link:hover strong,
.country-map-link:hover span {
  text-decoration: underline;
}

.country-setup-note {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.mapping-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 12px;
  padding: 12px;
  background: #fbfdff;
}

.mapping-card {
  display: grid;
  gap: 10px;
  min-height: 178px;
  padding: 12px;
  border: 1px solid #c7d2fe;
  border-left: 5px solid #4f46e5;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(23, 32, 51, .05);
}

.mapping-card.select {
  border-color: #bae6fd;
  border-left-color: #0284c7;
}

.mapping-card.choice {
  border-color: #bbf7d0;
  border-left-color: #16a34a;
}

.mapping-card.file {
  border-color: #fed7aa;
  border-left-color: #ea580c;
}

.mapping-card.date {
  border-color: #ddd6fe;
  border-left-color: #7c3aed;
}

.mapping-card.inactive {
  opacity: .62;
  background: #f8fafc;
  border-left-color: #94a3b8;
}

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

.mapping-card-top strong {
  color: #111827;
  overflow-wrap: anywhere;
}

.mapping-card-top span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #174ea6;
  font-size: .73rem;
  font-weight: 800;
}

.mapping-card-source {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.mapping-card-source span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mapping-card-source code,
.mapping-card-meta code {
  overflow-wrap: anywhere;
  white-space: normal;
}

.mapping-card-meta {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: .78rem;
  font-weight: 700;
}

.mapping-card-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.audit-report-list {
  display: grid;
  gap: 12px;
}

.audit-report-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #dbe5f1;
  border-left: 5px solid #2563eb;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .05);
}

.audit-report-head,
.audit-report-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.audit-report-head strong {
  display: block;
  color: #172033;
}

.audit-report-head span {
  color: #64748b;
  font-size: .82rem;
  font-weight: 700;
}

.audit-report-grid {
  justify-content: flex-start;
}

.audit-report-grid > div {
  min-width: 180px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
}

.audit-report-grid span {
  display: block;
  color: #64748b;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.audit-report-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.audit-report-card p {
  margin: 0;
  color: #334155;
}

.required-dot {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: .72rem;
  font-weight: 800;
}

@media (max-width: 780px) {
  .wafeed-form-row {
    grid-template-columns: 1fr;
  }
}

.preview-field {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.preview-field.missing {
  border-color: #fca5a5;
  background: #fff7f7;
}

.preview-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.preview-field-head span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: .76rem;
  font-weight: 800;
}

.preview-field dl {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  font-size: .88rem;
}

.preview-field dt {
  color: #667085;
}

.preview-field dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.preview-field .value-cell {
  max-height: 92px;
  overflow: auto;
}

.file-message {
  margin-top: 5px;
  color: #526071;
  font-size: .8rem;
  font-weight: 700;
}

.field-warning {
  margin-top: 10px;
  color: #b91c1c;
  font-weight: 800;
  font-size: .84rem;
}

.learned-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.learned-option-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
}

.learned-option-card > div {
  display: grid;
  gap: 3px;
}

.learned-option-card strong,
.learned-option-card span {
  overflow-wrap: anywhere;
}

.learned-option-card small {
  color: #64748b;
  font-weight: 700;
}

@media (max-width: 760px) {
  .list-toolbar {
    grid-template-columns: 1fr;
  }

  .list-summary {
    justify-self: start;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    z-index: 30;
    width: 276px;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-shell.sidebar-collapsed {
    --sidebar-width: 276px;
  }

  .sidebar-collapsed .brand-text,
  .sidebar-collapsed .nav-text {
    opacity: 1;
  }

  .app-topbar {
    padding: 12px 16px;
  }

  .topbar-subtitle,
  .topbar-user span:not(.user-avatar) {
    display: none;
  }

  .content-shell {
    padding: 18px;
  }
}
