* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #14161c;
  color: #e8e8ec;
}

header {
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid #2a2e3a;
}

header h1 { margin: 0; font-size: 1.5rem; }
.subtitle { margin: 0.3rem 0 0 0; color: #9a9db0; font-size: 0.95rem; }

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.sidebar {
  background: #1d2029;
  border-radius: 12px;
  padding: 1rem;
  height: fit-content;
}

.sidebar h2 { margin: 0 0 0.8rem 0; font-size: 0.95rem; color: #9a9db0; }

.sidebar ul { list-style: none; padding: 0; margin: 0 0 1rem 0; display: flex; flex-direction: column; gap: 0.3rem; }

.sidebar li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  background: #12141b;
}
.sidebar li:hover { background: #2a2e3a; }
.sidebar li.active { background: #5865f2; }

.sidebar li span { flex: 1; }

.sidebar li button {
  background: #f45b69;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
}

.neu-btn {
  width: 100%;
  background: #5865f2;
  border: none;
  color: #fff;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.neu-btn:hover { background: #4752c4; }

.karte {
  background: #1d2029;
  border-radius: 12px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
}

.karte h2 { margin: 0 0 0.5rem 0; font-size: 1.05rem; }

.karte-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hint { color: #9a9db0; font-size: 0.85rem; margin: 0 0 1rem 0; }

.modus-auswahl {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
  padding: 0.7rem 0.9rem;
  background: #12141b;
  border-radius: 8px;
}

.modus-auswahl label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.modus-auswahl input[type="radio"] { cursor: pointer; }

.add-btn {
  background: #5865f2;
  border: none;
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
}
.add-btn:hover { background: #4752c4; }

.items-container {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.item-card {
  background: #12141b;
  border-radius: 10px;
  padding: 0.9rem 1rem;
}

.item-card-header {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.item-name {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #33374a;
  background: #1d2029;
  color: #fff;
  font-weight: 600;
}

.remove-btn {
  background: #f45b69;
  border: none;
  color: #fff;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}
.remove-btn:hover { background: #d94555; }

.item-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.feld { display: flex; flex-direction: column; gap: 0.3rem; }
.feld label { font-size: 0.78rem; color: #9a9db0; }
.feld input {
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #33374a;
  background: #1d2029;
  color: #fff;
  font-size: 0.9rem;
}

.item-info {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #9a9db0;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
}

.output-grid input {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #33374a;
  background: #12141b;
  color: #fff;
  width: 100%;
}
.output-grid label { font-size: 0.85rem; color: #9a9db0; }
.output-grid .feld { display: flex; flex-direction: column; gap: 0.3rem; }

.ergebnis-box {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ergebnis-row {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid #2a2e3a;
}
.ergebnis-row:last-child { border-bottom: none; }
.ergebnis-row span { color: #9a9db0; }
.ergebnis-row strong { font-size: 1.05rem; }

.ergebnis-row.highlight { margin-top: 0.4rem; border-top: 2px solid #2a2e3a; border-bottom: none; padding-top: 0.8rem; }
.ergebnis-row.highlight span { font-weight: 600; color: #e8e8ec; }
.ergebnis-row.highlight.gewinn strong { color: #3ba55c; font-size: 1.3rem; }
.ergebnis-row.highlight.verlust strong { color: #f45b69; font-size: 1.3rem; }

.save-row { display: flex; gap: 0.6rem; }
.save-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #33374a;
  background: #12141b;
  color: #fff;
}
.save-row button {
  background: #3ba55c;
  border: none;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.save-row button:hover { background: #2f8a4c; }

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