/* Nebenkosten-Rechner — ergaenzt ratgeber.css (Nav, Header, Footer, Boxen) */

/* Nur fuer Screenreader: Spaltenueberschriften, die visuell leer bleiben.
   display:none waere falsch — dann liest der Screenreader sie auch nicht. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.calc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 22px;
}
.calc h2 {
  font-size: 17px;
  color: #1a3a5c;
  margin: 0 0 4px;
}
.calc .hint {
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 16px;
}

/* ---------- Tabellen mit Eingabefeldern ---------- */

.calc-table-wrap {
  overflow-x: auto;
  margin-bottom: 12px;
}
table.calc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  min-width: 560px;
  background: transparent;
  border: none;
}
table.calc-table thead {
  background: transparent;
}
table.calc-table th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 8px 8px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
table.calc-table td {
  padding: 6px 8px;
  border-bottom: none;
  vertical-align: middle;
}
table.calc-table tbody tr:last-child td {
  border-bottom: none;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14.5px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input:focus,
select:focus {
  border-color: #2d5f8b;
  box-shadow: 0 0 0 3px rgba(45, 95, 139, 0.12);
}
input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
input.invalid {
  border-color: #d97706;
  background: #fffbf3;
}

.col-num {
  width: 118px;
}
.col-schluessel {
  width: 168px;
}
.col-aktion {
  width: 44px;
}

.btn-del {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 19px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
}
.btn-del:hover {
  color: #b91c1c;
  background: #fef2f2;
}
.btn-del:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-add {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1a3a5c;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-add:hover {
  background: #e2e8f0;
}

.leer-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #64748b;
  white-space: nowrap;
  cursor: pointer;
}
.leer-label input {
  width: auto;
  margin: 0;
  cursor: pointer;
}

/* ---------- Ergebnis ---------- */

.ergebnis {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d5f8b 100%);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 22px;
}
.ergebnis h2 {
  color: #fff;
  font-size: 18px;
  margin: 0 0 16px;
}
.ergebnis-leer {
  opacity: 0.8;
  font-size: 14.5px;
  margin: 0;
}

.erg-karte {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.erg-karte:last-of-type {
  margin-bottom: 0;
}
.erg-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.erg-name {
  font-weight: 700;
  font-size: 15.5px;
}
.erg-saldo {
  font-weight: 800;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.erg-saldo.nach {
  color: #fecaca;
}
.erg-saldo.gut {
  color: #bbf7d0;
}
.erg-zeile {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  opacity: 0.85;
  margin-top: 5px;
  gap: 12px;
}
.erg-zeile span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.erg-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.erg-detail-zeile {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 3px;
  gap: 12px;
}
.erg-detail-zeile span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.erg-vermieter {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 10px;
  font-size: 14px;
}
.erg-vermieter strong {
  color: #fff;
}

.erg-summe {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  font-size: 14.5px;
  font-weight: 700;
  gap: 12px;
}
.erg-summe span:last-child {
  font-variant-numeric: tabular-nums;
}

.warnung {
  background: #fef6e7;
  border: 1px solid #f5d9a0;
  color: #6b4e16;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  margin-bottom: 16px;
}
.warnung strong {
  color: #8a5a00;
}

.toggle-detail {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
}
.toggle-detail:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 600px) {
  .calc {
    padding: 16px;
  }
  .ergebnis {
    padding: 18px;
  }
  .erg-saldo {
    font-size: 16px;
  }
}
