/* Mini Notendurchschnitt-Rechner */
.ndb-mini * { box-sizing: border-box; }
.ndb-mini   { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-size: 16px; }

.ndb-box {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.05);
}

/* Toolbar */
.ndb-toolbar { margin: 4px 0 10px; }
.ndb-weight-toggle { cursor: pointer; font-size: 14px; color:#222; user-select:none; }
.ndb-weight-toggle input { margin-right: 8px; }

.gewichtung-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  position: relative;
}



/* Rows */
.ndb-row {
  display: grid;
  /* Standard: 2 Spalten + Actions → Fach (0.5fr) + Note (0.25fr) + actions */
  grid-template-columns: .5fr .5fr auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0;
}

/* Head row */
.ndb-head {
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

/* Gewicht-Spalten-Header initial verstecken */
.ndb-head .ndb-col-weight { display:none; }

/* Inputs / Buttons */
.ndb-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  color: #111;
}
.ndb-input:focus {
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74,144,226,.15);
  outline: none;
}

.ndb-btn {
  border: 1px solid #d9d9d9;
  background: #fafafa;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.ndb-btn:hover { background: #f0f0f0; }
.ndb-btn:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74,144,226,.15);
}

.ndb-remove {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff5f5;
  border-color: #f3c1c1;
  color: #b00020;
}
.ndb-remove:hover { background: #ffe9e9; }

.ndb-bar {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #eee;
  margin-top: 6px;
  flex-wrap: wrap;
  align-items: center
}

.ndb-result {
  margin-top: 12px;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Badge */
.ndb-val { font-weight: 700; font-size: 18px; }
.ndb-badge{
  display:inline-block;
  padding:6px 12px;
  border-radius:9999px;
  line-height:1;
  border:1px solid #dfe5ef;
  background:#eef2f7;
  color:#111;
  font-weight:700;
  font-size:18px;
  min-width:72px;
  text-align:center;
}
.ndb-badge--good{ background:#e8f8ef; border-color:#bfe8d2; color:#0f7b4d; }
.ndb-badge--ok  { background:#eaf3ff; border-color:#c9dcff; color:#1b54b8; }
.ndb-badge--warn{ background:#fff6e5; border-color:#ffe0a6; color:#8a5a00; }
.ndb-badge--bad { background:#ffe9e9; border-color:#f3c1c1; color:#b00020; }
.ndb-badge--muted{ background:#eef2f7; border-color:#dfe5ef; color:#556; }

/* Gewichtung: standardmäßig verstecken (2-Spalten-Modus) */
.ndb-weight { display:none; }

/* Wenn Gewichtung aktiv → 3 Spalten: Fach (.5fr) + Note (.25fr) + Gewicht (.25fr) + Actions */
.ndb-wrap.weights-on .ndb-row { grid-template-columns: .5fr .25fr .25fr auto; }
.ndb-wrap.weights-on .ndb-weight { display:block; }
.ndb-wrap.weights-on .ndb-head .ndb-col-weight { display:block; }

/* Mobile */
@media (max-width: 680px) {
  .ndb-row { grid-template-columns: 1fr 1fr auto; }
  .ndb-wrap.weights-on .ndb-row { grid-template-columns: 1fr 1fr 1fr auto; }
}