:root {
  --ink: #17202a;
  --muted: #607082;
  --line: #d9e1ea;
  --panel: #ffffff;
  --bg: #f5f7fb;
  --brand: #6f4cf5;
  --brand-dark: #4f2dd6;
  --brand-soft: #ece5ff;
  --accent: #ff9a1f;
  --accent-soft: #fff0df;
  --sky: #21c7f3;
  --sky-soft: #e3f8fd;
  --danger: #b91c1c;
  --ok: #15803d;
  --sidebar: #171429;
  --sidebar-line: #2d2747;
  --sidebar-ink: #dde0ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  background:
    linear-gradient(90deg, rgba(111, 76, 245, 0.10), rgba(33, 199, 243, 0.10), rgba(255, 154, 31, 0.08)),
    rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: grid;
  gap: 1px;
  line-height: 1;
  font-weight: 800;
  color: var(--brand-dark);
  min-width: 0;
}

.brand-mark {
  display: block;
  width: auto;
  height: 20px;
  max-width: none;
}

.brand-sub {
  font-size: 12px;
  font-weight: 700;
  color: #6f7b8d;
  text-transform: lowercase;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
}

nav a.active,
nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 20px 56px;
}

.hero,
.customer-hero {
  min-height: 430px;
  display: grid;
  align-items: center;
  padding: 56px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(115deg, rgba(111, 76, 245, 0.94), rgba(33, 199, 243, 0.78), rgba(255, 154, 31, 0.42)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='700' viewBox='0 0 1200 700'%3E%3Crect width='1200' height='700' fill='%23364854'/%3E%3Cpath d='M160 430h880l-80-150c-22-42-58-70-106-70H340c-46 0-82 25-105 65z' fill='%239fb8bf'/%3E%3Ccircle cx='330' cy='455' r='58' fill='%2317202a'/%3E%3Ccircle cx='870' cy='455' r='58' fill='%2317202a'/%3E%3Cpath d='M380 245h340l55 110H310z' fill='%23d8e8ea'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}

.customer-hero {
  position: relative;
  min-height: 360px;
}

.pulse {
  position: absolute;
  right: 7%;
  bottom: 18%;
  width: 160px;
  height: 160px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.72); opacity: 1; }
  100% { transform: scale(1.28); opacity: 0; }
}

.hero h1,
.customer-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: 0;
}

.hero p,
.customer-hero p {
  max-width: 650px;
  font-size: 18px;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.page-head h1,
.panel h2 {
  margin: 0 0 8px;
}

.page-head p,
.hint {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

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

.panel {
  margin: 18px 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel.narrow {
  max-width: 620px;
}

main.activate {
  min-height: 100vh;
  padding: 0;
  background: #f5f7fb;
}

html.activate-route .topbar,
body.activate-mode .topbar {
  display: none;
}

.customer-shell {
  display: grid;
  gap: 16px;
  width: 100%;
  min-height: 100vh;
  padding: 16px;
}

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

.language-card {
  display: grid;
  gap: 6px;
  padding: 18px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.language-card.active {
  border-color: rgba(111, 76, 245, 0.36);
  background: linear-gradient(180deg, rgba(111, 76, 245, 0.08), rgba(255, 255, 255, 1));
}

.welcome-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.doc-type-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.doc-type-switch .button.active {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
}

.mobile-verify-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.mobile-verify-status {
  display: grid;
  gap: 8px;
}

.customer-capture-card {
  width: min(760px, 100%);
  display: grid;
  gap: 14px;
}

.customer-capture-preview img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

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

.wizard-stepper-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  text-align: left;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.wizard-stepper-item.active {
  color: var(--ink);
  border-color: rgba(111, 76, 245, 0.36);
  background: linear-gradient(90deg, rgba(111, 76, 245, 0.08), rgba(33, 199, 243, 0.08), rgba(255, 154, 31, 0.08));
}

.wizard-stepper-item.done {
  border-color: rgba(21, 128, 61, 0.24);
}

.wizard-stepper-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  font-weight: 800;
}

.wizard-stepper-copy {
  display: grid;
  min-width: 0;
}

.wizard-stepper-copy strong,
.wizard-stepper-copy span {
  min-width: 0;
}

.wizard-stepper-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.wizard-step {
  display: grid;
  gap: 16px;
  margin: 0;
}

.wizard-step[hidden] {
  display: none !important;
}

.wizard-step-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.wizard-step-head h2 {
  margin-bottom: 6px;
}

.step-error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

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

.doc-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  cursor: pointer;
}

.doc-card.ready {
  border-color: rgba(21, 128, 61, 0.28);
}

.doc-card.error-state {
  border-color: rgba(185, 28, 28, 0.35);
  background: #fff8f8;
}

.doc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.doc-card-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

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

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

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

.review-grid h3 {
  margin: 0 0 10px;
}

.review-list {
  margin: 0;
  padding-left: 18px;
}

.admin-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 86px;
  width: 100%;
  padding: 22px;
  color: var(--sidebar-ink);
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background:
    radial-gradient(circle at top right, rgba(33, 199, 243, 0.20), transparent 24%),
    radial-gradient(circle at bottom left, rgba(255, 154, 31, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(111, 76, 245, 0.26), rgba(33, 199, 243, 0.08) 24%, rgba(23, 20, 41, 0) 56%),
    var(--sidebar);
}

.admin-sidebar-head h1 {
  margin: 0 0 10px;
  color: #fff;
}

.admin-sidebar-head p:last-child {
  color: #c6c2eb;
}

.admin-sidebar-nav {
  display: grid;
  gap: 8px;
  margin: 22px 0;
}

.admin-sidebar-subnav {
  display: grid;
  gap: 6px;
  margin: -2px 0 8px 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-nav a {
  padding: 12px 14px;
  color: var(--sidebar-ink);
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-sidebar-nav a:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.11);
}

.admin-sidebar-nav a.active {
  color: #fff;
  border-color: rgba(33, 199, 243, 0.34);
  background:
    linear-gradient(90deg, rgba(111, 76, 245, 0.34), rgba(33, 199, 243, 0.20), rgba(255, 154, 31, 0.10)),
    rgba(111, 76, 245, 0.16);
}

.admin-sidebar-subnav a {
  padding: 10px 12px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-sidebar-note {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar-note .hint {
  color: #b9b4e2;
}

.admin-content {
  min-width: 0;
  width: 100%;
}

.admin-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
}

.admin-head-actions {
  justify-content: flex-end;
}

.admin-menu-toggle {
  display: none;
}

.admin-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.kpi-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.kpi-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.kpi-card strong {
  font-size: 28px;
  line-height: 1;
}

.kpi-card.teal { background: linear-gradient(180deg, #eefaf8, #fff); }
.kpi-card.amber { background: linear-gradient(180deg, #fff3e4, #fff); }
.kpi-card.red { background: linear-gradient(180deg, #fff0ef, #fff); }
.kpi-card.violet { background: linear-gradient(180deg, #f1ebff, #fff); }
.kpi-card.green { background: linear-gradient(180deg, #edf9f0, #fff); }
.kpi-card.blue { background: linear-gradient(180deg, #eaf8ff, #fff); }

.grid.two.compact {
  align-items: start;
}

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

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

.report-home-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-home-card:hover {
  border-color: #c8d0de;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.report-nav-panel {
  padding: 14px 18px;
}

.report-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.report-subnav-item {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
}

.report-subnav-item.active {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand), var(--sky));
}

.report-sheet {
  display: grid;
  gap: 14px;
}

.report-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fcfdff, #f9fbff);
}

.report-panel h3 {
  margin: 0 0 14px;
}

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

.report-filters input,
.report-filters select {
  margin: 0;
}

.report-panel .table {
  overflow-x: auto;
}

.report-panel table {
  min-width: 760px;
}

.report-panel .table small {
  word-break: break-word;
}

.ocr-doc-grid,
.ocr-output-grid,
.ocr-summary-grid {
  display: grid;
  gap: 14px;
}

.ocr-doc-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ocr-doc-card,
.ocr-output-block,
.ocr-stat,
.ocr-check-item,
.ocr-doc-status-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.ocr-doc-card h3,
.ocr-output-block h3 {
  margin: 0;
}

.ocr-preview {
  width: 100%;
  aspect-ratio: 1.58;
  object-fit: cover;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f8;
}

.ocr-preview.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.ocr-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.ocr-stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ocr-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

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

.ocr-check-list,
.ocr-doc-status-list {
  display: grid;
  gap: 12px;
}

.ocr-check-item header,
.ocr-doc-status-item header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ocr-check-value {
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-family: Consolas, "Courier New", monospace;
}

.ocr-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  min-height: 30px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
}

.ocr-flag.pass {
  color: #0f5132;
  background: #dcfce7;
}

.ocr-flag.review {
  color: #92400e;
  background: #fef3c7;
}

.ocr-flag.fail {
  color: #991b1b;
  background: #fee2e2;
}

main.admin {
  padding: 0;
}

main.admin .admin-shell {
  min-height: calc(100vh - 62px);
}

main.admin .admin-content {
  display: grid;
  gap: 18px;
}

main.admin .page-head,
main.admin .panel,
main.admin .report-grid,
main.admin .admin-kpis,
main.admin .admin-head,
main.admin #admin-page-content {
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 18, 35, 0.52);
}

.modal-card {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(23, 21, 43, 0.22);
}

.security-modal-card {
  width: min(940px, 100%);
}

.auditor-modal-card {
  width: min(1200px, 100%);
}

.auditor-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.auditor-modal-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  overflow-x: auto;
}

.auditor-modal-section.full-span {
  grid-column: 1 / -1;
}

.auditor-modal-section h3 {
  margin: 0 0 12px;
}

.auditor-modal-form {
  display: contents;
}

.auditor-summary-chips {
  margin-top: 10px;
}

.auditor-request-grid {
  display: grid;
  gap: 12px;
}

.auditor-request-card {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  cursor: pointer;
}

.auditor-request-card:hover {
  border-color: #c8d0de;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.06);
}

.auditor-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.auditor-request-head h3 {
  margin: 4px 0 0;
}

.auditor-request-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  color: var(--muted);
}

.auditor-doc-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.auditor-doc-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.auditor-doc-card img {
  width: 100%;
  aspect-ratio: 1 / 1.25;
  object-fit: cover;
  border-radius: 6px;
  background: #f1f5f9;
}

.auditor-doc-card.missing {
  min-height: 180px;
  justify-items: start;
  background: #fbfbfd;
}

.auditor-edit-table {
  width: 100%;
  border-collapse: collapse;
}

.auditor-edit-table th,
.auditor-edit-table td {
  padding: 10px 8px;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.auditor-edit-table th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}

.auditor-field-name {
  width: 18%;
  font-weight: 600;
}

.auditor-field-original {
  width: 25%;
  color: var(--muted);
}

.auditor-field-editable {
  width: 47%;
}

.auditor-field-action {
  width: 10%;
  white-space: nowrap;
}

.auditor-field-editable input,
.auditor-field-editable textarea {
  margin: 0;
}

.auditor-field-editable textarea {
  min-height: 72px;
  resize: vertical;
}

.auditor-field-editable input[readonly],
.auditor-field-editable textarea[readonly] {
  background: #f7f9fc;
}

.auditor-field-editable input.is-editable,
.auditor-field-editable textarea.is-editable {
  border-color: var(--brand);
  background: #fff;
}

.auditor-modal-actions {
  margin-top: 18px;
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.role-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 96px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.role-option span {
  color: var(--muted);
  line-height: 1.4;
}

.role-option.selected {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f1ebff, #e9f8ff);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

input,
textarea,
select {
  width: 100%;
  margin: 8px 0 14px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

label {
  display: block;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  box-shadow: 0 8px 18px rgba(111, 76, 245, 0.18);
}

.button.danger {
  color: #fff;
  border-color: var(--danger);
  background: var(--danger);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

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

.table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  background: #f8fafc;
}

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.qr-card {
  position: relative;
  padding: 14px;
  background: #fff;
  border: 1px dashed #9aa9b8;
  border-radius: 8px;
  break-inside: avoid;
}

.qr-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.qr-card-actions {
  margin-top: 10px;
}

.qr-select {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.qr-select input {
  margin: 0;
}

.qr-timeline {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.qr-timeline strong {
  color: var(--ink);
}

.qr-box {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin-bottom: 10px;
  color: var(--brand);
  font-weight: 800;
  text-align: center;
  border: 8px solid #17202a;
  background: repeating-linear-gradient(45deg, #fff 0 10px, #eef6f4 10px 20px);
}

.qr-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  margin-bottom: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
}

.qr-page-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.qr-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  padding: 18px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.72);
}

.qr-preview-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.3);
}

.qr-preview-toolbar {
  margin-bottom: 14px;
}

.qr-preview-sheet {
  gap: 8px;
}

.qr-preview-modal .qr-card {
  padding: 0;
  border: 0;
  background: transparent;
}

.qr-print-task-list {
  display: grid;
  gap: 12px;
}

.qr-print-task-card {
  padding: 16px;
}

.qr-print-task-card h3 {
  margin: 0;
  font-size: 15px;
}

.qr-print-task-card p {
  margin: 6px 0 0;
}

.qr-preview-modal .qr-card > :not(.qr-image):not(.qr-box) {
  display: none !important;
}

.qr-preview-modal .qr-card .qr-image,
.qr-preview-modal .qr-card .qr-box {
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.qr-preview-modal .qr-box {
  font-size: 0;
}

@media print {
  body {
    background: #fff;
  }
  .topbar,
  .admin-sidebar,
  .admin-head,
  .page-head .actions,
  .panel,
  .qr-card-actions,
  .actions.wrap,
  nav,
  .button,
  input,
  select {
    display: none !important;
  }
  main {
    padding: 0;
  }
  .admin-shell {
    display: block;
  }
  .admin-content {
    width: 100%;
  }
  .qr-preview-modal {
    position: static;
    padding: 0;
    background: transparent;
  }
  .qr-preview-panel {
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .qr-preview-toolbar {
    display: none !important;
  }
  .qr-grid {
    gap: 8px;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .qr-card {
    padding: 0;
    border: 0;
    background: transparent;
  }
  .qr-card > :not(.qr-image):not(.qr-box) {
    display: none !important;
  }
  .qr-card .qr-image,
  .qr-card .qr-box {
    margin: 0;
    border: 0;
    padding: 0;
    background: transparent;
  }
  .qr-box {
    font-size: 0;
  }
}

.scanner {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 340px;
  overflow: hidden;
  background: #17202a;
  border-radius: 8px;
}

.qr-scan-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.qr-scan-box {
  position: relative;
  width: min(720px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #17202a;
}

.qr-scan-box video {
  display: block;
  width: 100%;
}

.qr-scan-box .button {
  position: absolute;
  left: 16px;
  bottom: 16px;
}

video {
  width: 100%;
  max-height: 520px;
}

.scan-frame {
  position: absolute;
  width: min(76%, 520px);
  aspect-ratio: 1.58;
  border: 3px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

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

.upload-fallback {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.chip {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--brand-dark);
  background: linear-gradient(90deg, var(--brand-soft), var(--sky-soft), var(--accent-soft));
  font-size: 13px;
  font-weight: 700;
}

.permission-editor {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.smtp-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.smtp-toggle span {
  font-weight: 700;
}

.smtp-toggle input {
  width: auto;
  margin: 0;
}

.template-help {
  display: grid;
  gap: 10px;
}

.template-help h3 {
  margin: 0;
}

.smtp-body-switch {
  display: flex;
  gap: 8px;
}

.smtp-body-switch .button.active {
  color: #fff;
  border-color: var(--brand);
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
}

.smtp-body-switch .button.pending {
  color: var(--brand-dark);
  border-color: rgba(111, 76, 245, 0.42);
  background: var(--brand-soft);
}

.smtp-body-panel.hidden {
  display: none;
}

.smtp-body-panel label {
  margin-bottom: 6px;
}

.template-var-table {
  overflow-x: auto;
}

.template-var-table-inner {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.template-var-table-inner th,
.template-var-table-inner td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.template-var-table-inner th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.template-var-table-inner code {
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 999px;
  white-space: nowrap;
}

.template-link-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.template-link-list code {
  color: var(--brand-dark);
  background: var(--brand-soft);
  padding: 2px 6px;
  border-radius: 999px;
}

.security-shell {
  align-items: start;
}

.security-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.security-card {
  display: grid;
  gap: 12px;
  width: 100%;
  min-height: 170px;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.security-card:hover {
  transform: translateY(-1px);
  border-color: #c9d4e1;
  box-shadow: 0 10px 26px rgba(23, 32, 42, 0.08);
}

.security-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.security-card .hint {
  margin: 0;
}

.danger-chip {
  color: var(--danger);
  background: #fde8e8;
}

.permission-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.permission-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.permission-item input {
  margin-top: 3px;
}

.card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.status {
  font-weight: 800;
  color: var(--accent);
}

.ok {
  color: var(--ok);
}

.error {
  color: var(--danger);
  font-weight: 700;
}

.error-block {
  padding: 12px;
  color: var(--danger);
  border: 1px solid #f3c7c7;
  border-radius: 6px;
  background: #fff1f1;
  line-height: 1.5;
}

pre {
  white-space: pre-wrap;
  padding: 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

@media (max-width: 780px) {
  html.activate-route main,
  body.activate-mode main {
    padding: 0;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 14px 12px 40px;
  }

  .hero,
  .customer-hero {
    min-height: 360px;
    padding: 32px 22px;
  }

  .customer-shell {
    padding: 12px;
  }

  .language-picker,
  .doc-type-switch {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .customer-capture-card {
    width: min(100%, 760px);
  }

  .hero h1,
  .customer-hero h1 {
    font-size: 34px;
  }

  .grid.two,
  .admin-shell,
  .admin-kpis,
  .wizard-stepper,
  .ocr-summary-grid,
  .ocr-output-grid,
  .report-grid,
  .report-home-grid,
  .report-filters,
  .role-picker,
  .form-grid.two-up,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .wizard-stepper {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .wizard-stepper-item {
    min-width: 210px;
    flex: 0 0 auto;
  }

  .wizard-step-head,
  .wizard-actions,
  .review-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

  .report-subnav {
    gap: 8px;
  }

  .admin-sidebar {
    position: fixed;
    inset: 72px 12px auto 12px;
    z-index: 30;
    max-height: calc(100vh - 92px);
    overflow: auto;
    display: none;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.2);
  }

  body.admin-sidebar-open .admin-sidebar {
    display: block;
  }

  .admin-head {
    flex-direction: column;
  }

  .admin-menu-toggle {
    display: inline-flex;
  }

  .admin-head-actions {
    width: 100%;
    justify-content: flex-start;
  }

  main.admin {
    padding: 0;
  }

  main.admin .admin-shell {
    min-height: auto;
  }

  .admin-content {
    width: 100%;
  }

  .panel.narrow {
    max-width: none;
  }

  .auditor-modal-card {
    width: min(100%, 100%);
    padding: 18px;
  }

  .auditor-modal-grid,
  .auditor-doc-grid,
  .auditor-request-meta {
    grid-template-columns: 1fr;
  }

  .auditor-field-name,
  .auditor-field-original,
  .auditor-field-editable,
  .auditor-field-action {
    width: auto;
    display: block;
  }

  .auditor-edit-table,
  .auditor-edit-table thead,
  .auditor-edit-table tbody,
  .auditor-edit-table tr,
  .auditor-edit-table td,
  .auditor-edit-table th {
    display: block;
  }

  .auditor-edit-table thead {
    display: none;
  }

  .auditor-edit-table tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .auditor-edit-table td {
    padding: 6px 0;
    border: 0;
  }

  .auditor-field-action {
    margin-top: 8px;
  }
}

@media print {
  .topbar,
  .page-head,
  .panel,
  .button {
    display: none !important;
  }

  .qr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}
