:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #172026;
  --muted: #68727a;
  --line: #d9dfdc;
  --teal: #0a6b72;
  --teal-2: #0f8a8f;
  --green: #2f7d46;
  --orange: #c77716;
  --red: #b53b39;
  --blue: #315f92;
  --soft-teal: #e7f3f2;
  --soft-green: #eaf5ec;
  --soft-orange: #fff2df;
  --soft-red: #fdecec;
  --shadow: 0 12px 30px rgba(24, 35, 44, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.auth-loading .app-shell,
body.auth-locked .app-shell {
  display: none;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background: #eef2f0;
}

body.auth-ready .auth-gate {
  display: none;
}

.auth-shell {
  width: min(520px, 100%);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-brand img {
  width: 68px;
  height: 46px;
  object-fit: contain;
  background: white;
  border-radius: 6px;
  padding: 5px;
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font-size: 22px;
}

.auth-brand span,
.auth-foot {
  color: var(--muted);
}

.auth-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #eef2f0;
  border-radius: 7px;
  margin-bottom: 22px;
}

.auth-tab {
  border: 0;
  border-radius: 5px;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.active {
  background: white;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(24, 35, 44, 0.1);
}

.auth-form {
  display: grid;
  gap: 15px;
}

.auth-form[hidden] {
  display: none;
}

.auth-form h1 {
  font-size: 25px;
  margin-bottom: 5px;
}

.auth-form p {
  color: var(--muted);
  margin-bottom: 0;
}

.auth-form label {
  display: grid;
  gap: 6px;
}

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

.auth-check {
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: start;
  font-weight: 500;
}

.auth-check input {
  width: auto;
  margin: 3px 0 0;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
  font-weight: 800;
}

.auth-link {
  border: 0;
  background: transparent;
  color: var(--teal);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 4px;
  text-align: center;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-weight: 700;
}

.auth-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.auth-foot {
  text-align: center;
  margin: 14px 0 0;
  font-size: 12px;
}

.saas-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  border-right: 1px solid var(--line);
  padding-right: 12px;
}

.saas-identity strong,
.saas-identity span {
  display: block;
}

.saas-identity span {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-sync {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.sidebar-sync.sync-ok {
  border-color: rgba(101, 196, 128, 0.5);
  color: #bce8c8;
}

.sidebar-sync.sync-error {
  border-color: rgba(235, 139, 124, 0.5);
  color: #ffd0c7;
}

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

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

.plan-option {
  min-height: 78px;
  display: grid;
  gap: 4px;
  align-content: center;
  border: 1px solid var(--teal);
  border-radius: 7px;
  background: var(--soft-teal);
  color: var(--ink);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.plan-option strong,
.plan-option span {
  display: block;
}

.plan-option span {
  color: var(--muted);
}

.plan-option:hover {
  border-color: var(--teal-2);
  background: #d9eeec;
}

.notice.warning {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #edc98d;
  border-radius: 7px;
  background: var(--soft-orange);
  color: #67420f;
}

.team-list,
.server-files {
  display: grid;
  gap: 8px;
}

.team-member,
.server-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fbfcfb;
}

.team-member span,
.server-file span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.readonly-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #d4e4ee;
  background: #f1f7fb;
  color: #294e65;
  border-radius: 7px;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #18252a;
  color: white;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand img {
  width: 56px;
  height: 38px;
  object-fit: contain;
  background: white;
  border-radius: 6px;
  padding: 4px;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span,
.sidebar-footer {
  color: rgba(255, 255, 255, 0.72);
}

.mobile-menu-btn {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: transparent;
  color: white;
  font-size: 23px;
  cursor: pointer;
}

.nav {
  display: grid;
  gap: 6px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.main {
  min-width: 0;
  padding: 26px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 30px;
  margin-bottom: 0;
}

h2 {
  font-size: 20px;
  margin-bottom: 14px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.topbar-actions,
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.text-btn,
.icon-btn {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.primary-btn {
  background: var(--teal);
  color: white;
  padding: 10px 14px;
}

.ghost-btn {
  background: #eef2f0;
  color: var(--ink);
  padding: 10px 14px;
  text-align: center;
}

.sidebar .ghost-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.text-btn {
  color: var(--teal);
  background: transparent;
  padding: 10px 8px;
}

.icon-btn {
  background: #edf0ee;
  width: 32px;
  height: 32px;
  font-size: 22px;
}

.file-label input {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

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

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

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

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

.panel.flat {
  box-shadow: none;
}

.metric {
  min-height: 118px;
}

.metric-link {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  appearance: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.metric-link:hover {
  border-color: var(--teal);
  box-shadow: 0 6px 18px rgba(10, 107, 114, 0.12);
  transform: translateY(-1px);
}

.metric-link:focus-visible {
  outline: 3px solid rgba(10, 107, 114, 0.28);
  outline-offset: 2px;
}

.metric strong {
  display: block;
  font-size: 34px;
  margin-bottom: 6px;
}

.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-left: 6px solid var(--teal);
}

.step-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
}

.step-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.wizard-panel {
  max-width: 980px;
}

.wizard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

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

.wizard-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.wizard-steps button {
  border: 1px solid var(--line);
  background: #f8faf9;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
  text-align: center;
  cursor: pointer;
  min-height: 74px;
}

.wizard-steps button span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
  background: #e4e9e7;
  color: var(--ink);
  font-weight: 800;
}

.wizard-steps button b {
  font-size: 11px;
  line-height: 1.25;
}

.wizard-steps button.active {
  border-color: var(--teal);
  background: var(--soft-teal);
  color: var(--ink);
}

.wizard-steps button.done span {
  background: var(--green);
  color: white;
}

.wizard-steps button.skipped span {
  background: var(--orange);
  color: white;
}

.wizard-body {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.notice-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #eef8f6;
  border: 1px solid #cfe5e0;
  color: #21464a;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.notice-box strong {
  white-space: nowrap;
}

.wizard-field {
  display: grid;
  gap: 7px;
}

.wizard-field span {
  font-weight: 800;
  color: #27343a;
}

.wizard-field small {
  color: var(--muted);
  line-height: 1.4;
}

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

.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px 11px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--teal);
  background: var(--soft-teal);
}

.choice-card input {
  width: auto;
  margin-top: 2px;
}

.choice-card span {
  font-weight: 700;
}

.wizard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

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

.wizard-summary {
  margin-top: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.wizard-next-box {
  margin-top: 14px;
  border-radius: 8px;
  background: #f1f7fb;
  border: 1px solid #d4e4ee;
  padding: 14px;
}

.wizard-next-box h3,
.wizard-next-box p {
  margin-bottom: 6px;
}

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

.task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfb;
}

.task-row h3,
.task-row p {
  margin-bottom: 6px;
}

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

.intake-card {
  border-left: 5px solid var(--teal-2);
  box-shadow: none;
}

.risk-card {
  border-left: 5px solid var(--orange);
}

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

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.status-row:last-child {
  border-bottom: 0;
}

.report-block {
  white-space: pre-wrap;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.kpi-line {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

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

.status-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

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

.status-oranje {
  color: var(--orange);
  background: var(--soft-orange);
}

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

.status-blauw {
  color: var(--blue);
  background: #e9f0f8;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

th {
  background: #edf4f3;
  color: #1c3c40;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:last-child td {
  border-bottom: 0;
}

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

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

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

label {
  font-weight: 700;
  font-size: 12px;
  color: #334047;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.question-card {
  display: grid;
  gap: 10px;
  border-left: 5px solid var(--teal);
}

.question-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.audit-answer {
  white-space: pre-wrap;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.progress {
  height: 12px;
  background: #e2e8e6;
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--green));
}

.split {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
}

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

.list-select button {
  text-align: left;
  border: 1px solid var(--line);
  background: white;
  border-radius: 6px;
  padding: 12px;
  cursor: pointer;
}

.list-select button.active {
  border-color: var(--teal);
  background: var(--soft-teal);
}

dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  max-width: 760px;
  width: calc(100vw - 40px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

dialog::backdrop {
  background: rgba(12, 18, 22, 0.42);
}

.dialog-card {
  padding: 0;
}

.dialog-head,
.dialog-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-actions {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}

.dialog-body {
  padding: 18px;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfb;
}

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

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
    padding: 14px 16px;
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
  }

  .sidebar:not(.mobile-open) .nav,
  .sidebar:not(.mobile-open) .sidebar-footer {
    display: none;
  }

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

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .wizard-steps,
  .split,
  .form-grid,
  .guide-grid,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    display: grid;
  }

  .saas-account-grid,
  .plan-grid,
  .auth-form-grid {
    grid-template-columns: 1fr;
  }

  .saas-identity {
    border-right: 0;
    padding-right: 0;
  }

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

  .main {
    padding: 18px 16px;
  }

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

  .topbar-actions {
    width: 100%;
    align-items: center;
  }
}

.danger-zone {
  border-color: #d9a0a0;
  background: #fffafa;
}

.danger-btn {
  min-height: 44px;
  border: 1px solid #a32929;
  border-radius: 6px;
  background: #a32929;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 10px 16px;
}

.danger-btn:hover {
  background: #7f1f1f;
}

.danger-btn:disabled {
  cursor: wait;
  opacity: .55;
}

.readiness-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-left: 6px solid var(--red);
}

.readiness-banner.ready {
  border-left-color: var(--green);
  background: #f4fbf6;
}

.readiness-banner.blocked {
  border-left-color: var(--red);
  background: #fff8f6;
}

.readiness-group {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
}

.readiness-card {
  border-left: 5px solid var(--red);
}

.readiness-card.complete {
  border-left-color: var(--green);
}

.readiness-missing {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.readiness-missing span {
  display: block;
  padding: 8px 10px;
  color: #7a271a;
  background: #fff1ee;
  border: 1px solid #f1c2b8;
  border-radius: 6px;
  font-weight: 700;
}

.outside-boundary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-left: 6px solid #b65d13;
  background: #fffaf2;
}

.outside-card {
  border-left: 5px solid var(--red);
}

.outside-card.complete {
  border-left-color: var(--green);
}

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

.outside-sections > div,
.standard-status {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8faf9;
}

.outside-sections h3,
.standard-status h3 {
  margin: 0 0 6px;
}

.outside-sections p,
.standard-status p {
  margin: 0 0 8px;
}

.outside-sections .can {
  border-color: #b7dbc3;
  background: #f3faf5;
}

.outside-sections .cannot {
  border-color: #efc3b9;
  background: #fff5f2;
}

.source-link {
  display: inline-block;
  margin-top: 6px;
}

@media (max-width: 760px) {
  .readiness-banner,
  .outside-boundary {
    align-items: stretch;
    flex-direction: column;
  }

  .outside-sections {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .actions,
  .text-btn,
  .ghost-btn,
  .primary-btn {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  .panel {
    box-shadow: none;
    break-inside: avoid;
  }
}
.export-locked {
  position: relative;
  border-color: #c97a16 !important;
}

.export-locked::after {
  content: "Na betaling";
  margin-left: 8px;
  padding: 2px 6px;
  background: #fff2dd;
  color: #8a4b00;
  font-size: 11px;
  font-weight: 800;
}

.coupon-entry {
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.coupon-entry > label { display: block; margin-bottom: 8px; }
.coupon-entry input { min-width: 190px; flex: 1; }
.coupon-entry select { min-width: 150px; }

@media print {
  body:not(.paid-export) .app-shell { display: none !important; }
  body:not(.paid-export)::before {
    content: "Definitieve PDF- en documentexports zijn beschikbaar na betaling in AuditKlaar.";
    display: block;
    padding: 32px;
    font: 18px Arial, sans-serif;
  }
}
