:root{
  --maroon:#800000;
  --maroon-10: rgba(128,0,0,.10);
  --maroon-18: rgba(128,0,0,.18);
  --maroon-25: rgba(128,0,0,.25);
  --text:#111;
  --muted:#666;
  --bg:#fff;
  --panel:#f7f7f7;
  --line:#e7e7e7;
  --ok:#1b7f3a;
  --warn:#b36b00;
  --bad:#b00020;
  --shadow: 0 10px 30px rgba(0,0,0,.06);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background: #fff;
  color: var(--text);
  font-family: Mulish, Arial, sans-serif;
  line-height: 1.8em;
}

h1,h2,h3{
  font-family: Poppins, Arial, sans-serif;
  line-height: 1.25em;
  margin:0 0 10px 0;
}

a{ color: var(--maroon); text-decoration: underline; }

.app{
  max-width: 1200px;
  margin: 18px auto 40px;
  padding: 0 14px;
}

.app__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.app__subtitle{
  margin: 8px 0 0 0;
  color: var(--muted);
}

.app__meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  border:1px solid var(--maroon-25);
  background:#fff;
  padding: 10px 12px;
  border-radius: 999px;
  font-size: 13px;
  color:#333;
  white-space:normal;
  max-width:100%;
}
.pill--maroon{
  background: var(--maroon-10);
  color: var(--maroon);
  border-color: var(--maroon-25);
  font-weight:700;
}

.card{
  border: 1px solid var(--maroon-18);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.layout{
  display:grid;
  grid-template-columns: 1fr 360px;
  gap: 14px;
  margin-top: 10px;
}

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

.panel{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 520px;
}

.sidebar{
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.sidebar__block{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fff;
}

.muted{ color: var(--muted); }
.tiny{ font-size: 12px; line-height: 1.55em; }
hr{ border:none; border-top:1px solid var(--line); margin: 14px 0; }

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

.step{
  display:flex;
  gap: 10px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  cursor:pointer;
  user-select:none;
  background:#fff;
}
.step--active{
  border-color: var(--maroon-25);
  background: var(--maroon-10);
}
.step--done{
  border-color: rgba(27,127,58,.25);
  background: rgba(27,127,58,.08);
}
.step__num{
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--line);
  font-weight:700;
  color:#333;
  background:#fff;
}

.form{ display:flex; flex-direction:column; gap: 12px; }
.field{
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.field label{ display:block; font-weight:700; margin-bottom: 8px; }
.field .help{ color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.55em; }
.field input[type="number"], .field select{
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid #d8d8d8;
  font-size: 14px;
}
.field input[type="checkbox"]{ transform: translateY(1px); }

.rangegrid{
  display:grid;
  grid-template-columns: 1fr 140px;
  gap: 10px;
  align-items:center;
}
.rangegrid input[type="range"]{ width: 100%; }
.kpi{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.kpi__item{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}
.kpi__item strong{ display:block; margin-bottom:6px; }
.badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  background:#fff;
}
.badge--ok{ border-color: rgba(27,127,58,.25); background: rgba(27,127,58,.08); color: var(--ok); font-weight:700; }
.badge--warn{ border-color: rgba(179,107,0,.30); background: rgba(179,107,0,.10); color: var(--warn); font-weight:700; }
.badge--bad{ border-color: rgba(176,0,32,.30); background: rgba(176,0,32,.10); color: var(--bad); font-weight:700; }

.actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  margin-top: 14px;
  flex-wrap:wrap;
}
.btnrow{ display:flex; gap: 10px; flex-wrap:wrap; }

.btn{
  appearance:none;
  border: 1px solid var(--maroon-25);
  background: var(--maroon);
  color:#fff;
  padding: 10px 12px;
  border-radius: 12px;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{ filter: brightness(1.04); }
.btn:disabled{ background:#bbb; border-color:#bbb; cursor:not-allowed; }

.btn--ghost{
  background:#fff;
  color: var(--maroon);
}
.btn--danger{
  background: var(--bad);
  border-color: rgba(176,0,32,.30);
}

.table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td{
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align:left;
  vertical-align:top;
}
.table th{
  background: #fafafa;
  border-bottom: 2px solid var(--maroon);
  font-family: Poppins, Arial, sans-serif;
}

.nudge{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
  margin-bottom: 10px;
}
.nudge__title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 6px;
}
.nudge__body{ color:#222; }
.nudge__src{ margin-top: 8px; font-size: 12px; color: var(--muted); }

.source{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background:#fff;
  margin-bottom: 10px;
}
.source__top{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.source__name{ font-weight:700; }
.source__date{ color: var(--muted); font-size: 12px; }

.routecard{
  display:flex;
  flex-direction:column;
  gap: 10px;
}
.route__row{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:#fff;
}
.route__label{ color: var(--muted); font-size: 12px; }
.route__value{ font-weight:700; }

.calcbox{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 14px;
  overflow:hidden;
}
.calcbox summary{
  cursor:pointer;
  padding: 12px 12px;
  background: #0b0f0c;
  color: #00ff66;
  font-family: Poppins, Arial, sans-serif;
  font-weight:700;
  outline:none;
}
.calcbox__inner{
  background: #0b0f0c;
  color: #00ff66;
  padding: 12px 12px;
  font-size: 12px;
  line-height: 1.6em;
  border-top: 1px solid rgba(0,255,102,.20);
  white-space: pre-wrap;
}

@media print{
  .app__meta, .stepper, .sidebar, .actions, .btnrow, .calcbox{ display:none !important; }
  .card{ box-shadow:none; border:none; }
  .panel{ border:none; }
}

/* V0.4.1: gebruiksverbeteringen */
[hidden]{ display:none !important; }
.app__meta{ max-width:100%; }
.table-wrap{ width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.table-wrap .table{ min-width:560px; }
.field label:has(> input[type="checkbox"]){ min-height:44px; display:flex; align-items:center; gap:10px; cursor:pointer; }
.field label > input[type="checkbox"], .field label > input[type="radio"]{ width:24px; height:24px; flex:0 0 24px; margin:0; }
.field input[type="number"], .field select{ min-height:44px; }
.field input[type="range"]{ width:100%; height:44px; margin:0; }
.btn{ min-height:44px; padding:10px 16px; }
.source a, .nudge__src a{ display:inline-block; padding:12px 4px; min-height:44px; }
.step{ min-height:44px; }
@media (max-width: 480px){
  .app{ overflow-x:hidden; }
  .actions .btn{ flex:1 1 auto; }
}
