:root {
  --groen: #4bac33;
  --groen-zacht: #eef7ea;
  --oranje: #f39200;
  --oranje-zacht: #fff4e2;
  --blauw: #239ad6;
  --blauwbg: #eef7fc;
  --kop: #1a202c;
  --tekst: #2d3748;
  --subtekst: #718096;
  --kaderbg: #f7fafc;
  --rand: #ebe4d6;
  --achtergrond: #fdfaf4;
  --oppervlak: #ffffff;
}

* { box-sizing: border-box; }

body {
  font-family: Calibri, "Segoe UI", Arial, sans-serif;
  color: var(--tekst);
  background: var(--achtergrond);
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Header ---------- */
header.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: var(--oppervlak);
  border-bottom: 1px solid var(--rand);
}

header.app-header img { height: 40px; }

header.app-header h1 {
  font-size: 18px;
  color: var(--kop);
  margin: 0;
}

header.app-header p {
  margin: 1px 0 0;
  color: var(--subtekst);
  font-size: 12.5px;
}

/* ---------- Wizard shell ---------- */
.wizard-shell {
  display: flex;
  min-height: calc(100vh - 73px);
}

/* Step rail: sidebar on desktop */
.step-rail {
  width: 220px;
  flex-shrink: 0;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--subtekst);
}

.step-item.actief {
  background: var(--groen-zacht);
  color: var(--kop);
  font-weight: bold;
}

.step-item.gedaan { color: var(--groen); }

.step-bol {
  width: 24px; height: 24px; border-radius: 50%;
  background: #ece6d8; color: var(--subtekst);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: bold; flex-shrink: 0;
}
.step-item.actief .step-bol { background: var(--groen); color: white; }
.step-item.gedaan .step-bol { background: var(--groen); color: white; }
.step-label { font-size: 13.5px; }

/* Mobile top progress (hidden on desktop) */
.step-rail-mobiel { display: none; }

.wizard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.step-content {
  flex: 1;
  padding: 28px 36px 24px;
  max-width: 760px;
}

.step-titel {
  font-size: 23px;
  font-weight: bold;
  color: var(--kop);
  margin: 0 0 4px;
}
.step-subtitel {
  font-size: 13.5px;
  color: var(--subtekst);
  margin: 0 0 24px;
}

h2.section-title {
  font-size: 15.5px;
  font-weight: bold;
  color: var(--kop);
  margin: 26px 0 12px;
}
h2.section-title:first-child { margin-top: 0; }

/* ---------- AI intro-step ---------- */
.ai-intro-card {
  background: var(--oppervlak);
  border: 1px solid var(--rand);
  border-radius: 18px;
  padding: 24px;
}
.ai-intro-card textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px;
  border: 2px solid var(--rand);
  border-radius: 14px;
  font-family: inherit;
  font-size: 14.5px;
  resize: vertical;
}
.ai-intro-card textarea:focus { outline: none; border-color: var(--groen); }

/* ---------- Generic cards ---------- */
.card {
  background: var(--oppervlak);
  border: 1px solid var(--rand);
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card.warn { border-color: #f6d9ae; background: var(--oranje-zacht); }

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

label {
  display: block;
  font-size: 12px;
  font-weight: bold;
  color: var(--subtekst);
  margin-bottom: 5px;
}

input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--rand);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--tekst);
  background: white;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--groen); }

.field { margin-bottom: 12px; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
}
.checkbox-field input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; }
.checkbox-field label { margin: 0; }

/* ---------- Product-type tegels ---------- */
.type-tegels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.type-tegel {
  border: 2px solid var(--rand);
  background: var(--oppervlak);
  border-radius: 16px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: bold;
  color: var(--subtekst);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-height: 44px;
}
.type-tegel:hover { border-color: var(--groen); }
.type-tegel svg { width: 26px; height: 26px; }

/* ---------- Product cards ---------- */
.product-card {
  background: var(--oppervlak);
  border: 1px solid var(--rand);
  border-radius: 18px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}

.product-icoon {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: var(--groen-zacht);
  display: flex; align-items: center; justify-content: center;
}
.product-icoon svg { width: 20px; height: 20px; }

.product-header h3 { margin: 0; font-size: 15px; color: var(--kop); flex: 1; }

button, .btn-primary, .btn-secondary, .btn-danger, .btn-ai {
  cursor: pointer;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13.5px;
  font-weight: bold;
  display: inline-block;
  min-height: 44px;
}

.btn-primary { background: var(--groen); color: white; }
.btn-secondary { background: white; border: 1.5px solid var(--rand) !important; color: var(--tekst); }
.btn-danger { background: white; border: 1.5px solid #f0c4c4 !important; color: #c0392b; }
.btn-ai { background: var(--blauw); color: white; }

.subgrid-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  margin-bottom: 6px;
}

.hint { font-size: 12px; color: var(--subtekst); margin-top: 6px; line-height: 1.5; }

.missing-banner {
  background: var(--oranje-zacht);
  border: 1px solid #f6d9ae;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.missing-banner ul { margin: 6px 0 0 18px; padding: 0; }

/* ---------- Bottom action bar ---------- */
.actions-bar {
  position: sticky;
  bottom: 0;
  background: var(--oppervlak);
  border-top: 1px solid var(--rand);
  padding: 14px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.actions-bar .rechts { display: flex; align-items: center; gap: 10px; }

.status-msg { font-size: 13px; }
.status-msg.error { color: #c0392b; }
.status-msg.ok { color: var(--groen); }

[hidden] { display: none !important; }

/* ---------- Mobile ---------- */
@media (max-width: 780px) {
  header.app-header { padding: 12px 16px; }
  header.app-header img { height: 32px; }
  header.app-header h1 { font-size: 15.5px; }

  .wizard-shell { flex-direction: column; min-height: 0; }
  .step-rail { display: none; }

  .step-rail-mobiel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--oppervlak);
    border-bottom: 1px solid var(--rand);
  }
  .step-rail-mobiel .balk {
    flex: 1; height: 6px; background: var(--rand); border-radius: 100px; overflow: hidden;
  }
  .step-rail-mobiel .balk-vulling { height: 100%; background: var(--groen); }
  .step-rail-mobiel .label { font-size: 12px; font-weight: bold; color: var(--subtekst); white-space: nowrap; }

  .step-content { padding: 18px 16px 16px; max-width: 100%; }
  .step-titel { font-size: 19px; }

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

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

  .actions-bar { padding: 12px 16px; }
  .actions-bar .rechts { flex-wrap: wrap; justify-content: flex-end; }

  #pdf-preview { height: 60vh !important; }
}
