/* Design angelehnt an Duolingo: runde Karten, kräftige Ränder, "3D"-Knöpfe */
:root {
  --blau: #1cb0f6;
  --blau-dunkel: #1899d6;
  --blau-hell: #ddf4ff;
  --blau-rand: #84d8ff;
  --gruen: #58a700;
  --gruen-knopf: #58cc02;
  --gruen-schatten: #58a700;
  --text: #3c3c3c;
  --leise: #777777;
  --linie: #e5e5e5;
  --flaeche: #ffffff;
  --karte: #ffffff;
  --rot: #ea2b2b;
  --rot-schatten: #c41f1f;
  --gelb: #cd7900;
  --radius: 16px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 15px/1.5 Nunito, "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  color: var(--text);
  background: var(--flaeche);
}
a { color: var(--blau); text-decoration: none; font-weight: 700; }
a:hover { color: var(--blau-dunkel); }
h1 { font-size: 1.7rem; font-weight: 800; margin: 0 0 1.25rem; display: flex; gap: .6rem; align-items: center; }
h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 .75rem; }

/* Seitenleiste */
.rahmen { display: flex; min-height: 100vh; }
.seitenleiste {
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
  width: 270px; flex-shrink: 0; padding: 1.5rem 1rem; border-right: 2px solid var(--linie); background: #fff;
}
.marke { display: flex; align-items: center; gap: .5rem; padding: 0 .75rem 1.5rem; font-size: 1.3rem; font-weight: 800; color: var(--blau); }
.marke img { height: 34px; }
.seitenleiste nav { display: flex; flex-direction: column; gap: .4rem; }
.seitenleiste nav a {
  display: flex; align-items: center; gap: 1rem; padding: .55rem .9rem;
  border: 2px solid transparent; border-radius: 12px;
  color: var(--leise); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap;
}
.seitenleiste nav a:hover { background: #f7f7f7; color: var(--text); }
.seitenleiste nav a.aktiv { background: var(--blau-hell); border-color: var(--blau-rand); color: var(--blau); }
.symbol { font-size: 1.5rem; line-height: 1; width: 2rem; text-align: center; }
.abmelden { margin-top: 1.5rem; padding-top: 1rem; border-top: 2px solid var(--linie); }
.abmelden button {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: .55rem .9rem; cursor: pointer;
  background: none; border: 2px solid transparent; border-radius: 12px; font: inherit;
  color: var(--leise); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.abmelden button:hover { background: #f7f7f7; color: var(--text); }

/* Anmeldeseite */
.anmeldeseite { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.anmeldeseite .karte { width: 100%; max-width: 380px; text-align: center; }
.anmeldeseite img { height: 46px; margin: .5rem 0 1rem; }
.anmeldeseite form { display: flex; flex-direction: column; gap: .8rem; text-align: left; }
.anmeldeseite input { width: 100%; box-sizing: border-box; }
.anmeldeseite input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; }

main { flex: 1; min-width: 0; max-width: 1180px; margin: 0 auto; padding: 2rem 2.5rem; }

.meldung { padding: .8rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem; background: #d7ffb8; color: var(--gruen); border: 2px solid #a5ed6e; font-weight: 700; }
.meldung.fehler { background: #ffdfe0; color: var(--rot); border-color: #ffb2b2; }

.karte { background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); padding: 1.4rem; margin-bottom: 1.25rem; }
.titelzeile { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.titelzeile h1, .titelzeile h2 { margin: 0; }
.zwei-spalten { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 1.25rem; align-items: start; }
.raster { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
.raster .breit, .raster h2 { grid-column: 1 / -1; }
.raster h2 { margin-top: .5rem; }

/* Formulare */
label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 700; color: var(--leise); }
label.haken { flex-direction: row; align-items: center; gap: .5rem; margin-top: .75rem; color: var(--text); }
label.haken.klein { margin: 0; font-size: .8rem; color: var(--leise); }
input, select, textarea {
  font: inherit; font-weight: 600; color: var(--text); padding: .55rem .75rem;
  border: 2px solid var(--linie); border-radius: 12px; background: #f7f7f7; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blau-rand); background: #fff; }
input[type=checkbox] { width: 1.15rem; height: 1.15rem; accent-color: var(--blau); }
input.r { text-align: right; }
input.kurz { max-width: 5.5rem; }
input.mittel { max-width: 8rem; }

/* Knöpfe mit Unterkante */
.knopf {
  display: inline-block; font: inherit; font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: .65rem 1.2rem; border-radius: 14px; cursor: pointer; text-align: center;
  border: 2px solid var(--linie); border-bottom-width: 4px; background: #fff; color: var(--blau);
  transition: transform .05s;
}
.knopf:hover { background: #f7f7f7; color: var(--blau); }
.knopf:active { transform: translateY(2px); border-bottom-width: 2px; margin-bottom: 2px; }
.knopf.primaer { background: var(--blau); border-color: var(--blau-dunkel); color: #fff; }
.knopf.primaer:hover { background: #20bcff; color: #fff; }
.knopf.warnung { background: var(--rot); border-color: var(--rot-schatten); color: #fff; }
.knopf.warnung:hover { background: #ff4b4b; color: #fff; }
.link { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--blau); cursor: pointer; }
.link:hover { color: var(--blau-dunkel); }
.gefahr, .link.gefahr { color: var(--rot); }
.aktionen { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin: 1.25rem 0; }
.aktionen label { flex-direction: row; align-items: center; gap: .4rem; }
.aktionen label input { width: auto; }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .75rem; }
.inline-form .lang { flex: 1 1 14rem; }
.inline-form select { width: auto; }

/* Tabellen */
table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); overflow: hidden; margin-bottom: 1.25rem; }
.karte table { border: 0; border-radius: 0; }
th, td { padding: .65rem .85rem; text-align: left; border-bottom: 2px solid var(--linie); vertical-align: middle; }
th { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); background: #fff; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafafa; }
.r { text-align: right; }
td.r, th.r { white-space: nowrap; }
tr.inaktiv td { color: #afafaf; }

.positionen td { padding: .4rem .5rem; }
.positionen td.nr { color: var(--leise); width: 2.5rem; }
.positionen td:nth-child(2) { width: 50%; }
.positionen tr.entfernt td { opacity: .45; text-decoration: line-through; }
.positionen .katalog { margin-top: .3rem; font-size: .85rem; }
.aktionen.links { margin-top: 0; }
.positionen-plus select { width: auto; min-width: 20rem; max-width: 100%; }
.positionen .symbolknopf { width: 2.3rem; height: 2.3rem; }
.suche { max-width: 24rem; margin-bottom: 1rem; }
.rabatt-block { border-top: 2px solid var(--linie); padding-top: .5rem; }
.rabatt-block .hinweis { margin: .3rem 0 0; font-size: .85rem; }
label.rabatt-feld { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); margin-top: .4rem; }
.rabatt-eingabe { display: flex; align-items: center; gap: .35rem; }
input[readonly] { background: #fff; border-style: dashed; }

.summen { max-width: 30rem; margin-left: auto; padding: 1.1rem 1.4rem; }
.summen > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .3rem 0; }
.summen label { flex-direction: row; color: var(--text); font-size: inherit; }
.summen .gesamt { border-top: 2px solid var(--linie); margin-top: .5rem; padding-top: .7rem; font-weight: 800; font-size: 1.2rem; }
.summen .rc-hinweis { display: block; font-size: .85rem; color: var(--blau-dunkel); background: var(--blau-hell); border: 2px solid var(--blau-rand); border-radius: 12px; padding: .45rem .7rem; margin: .3rem 0; }

.empfaenger { max-width: 26rem; }

/* Etiketten */
.status { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: .2rem .65rem; border-radius: 999px; white-space: nowrap; }
.status.entwurf { background: #fff4d6; color: var(--gelb); }
.status.offen { background: var(--blau-hell); color: var(--blau-dunkel); }
.status.bezahlt { background: #d7ffb8; color: var(--gruen); }
.status.storniert { background: #eee; color: var(--leise); text-decoration: line-through; }
.status.gutschrift { background: #f3e1ff; color: #9b46d6; }
.etikett { font-size: .72rem; font-weight: 800; color: var(--leise); border: 2px solid var(--linie); border-radius: 8px; padding: 0 .35rem; }

.testband { background: #ffc800; color: #3c3c3c; font-weight: 800; text-align: center; padding: .45rem 1rem; }
.meldung.hinweisbox { background: var(--blau-hell); color: var(--text); border-color: var(--blau-rand); }
.storno { border-color: #ffb2b2; margin-top: 1.5rem; }
.storno label { margin-bottom: .5rem; }

/* Kacheln wie die Statistik-Kästen */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kachel {
  display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; align-items: center;
  background: var(--karte); border: 2px solid var(--linie); border-radius: var(--radius); padding: 1rem 1.2rem;
  color: var(--leise); font-weight: 600;
}
.kachel .symbol { grid-row: span 2; font-size: 1.8rem; }
a.kachel:hover { background: #f7f7f7; color: var(--leise); }
.kachel .zahl { font-size: 1.35rem; font-weight: 800; color: var(--text); }

.erfassung-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem 1rem; }
.erfassung-form .breit { grid-column: 1 / -1; }
.erfassung-form .aktionen { grid-column: 1 / -1; margin: 0; }

.katalog-zeile { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) 12rem; gap: .5rem; align-items: center; margin-bottom: .5rem; }
.tabelle-kopf { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--leise); }
.knoepfe { display: flex; gap: .5rem; align-items: center; }
.symbolknopf {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2.6rem; height: 2.6rem;
  border: 2px solid var(--linie); border-bottom-width: 4px; border-radius: 12px; background: #fff; color: #afafaf; cursor: pointer;
}
.symbolknopf:hover { color: var(--rot); border-color: #ffb2b2; background: #fff5f5; }
.symbolknopf:active { transform: translateY(2px); border-bottom-width: 2px; }

.hinweis { color: var(--leise); margin: 0 0 1rem; }
.leer, .leise { color: var(--leise); }
td .leise { white-space: nowrap; }

/* Nettoumsatz pro Jahr */
.jahresumsatz { display: flex; flex-direction: column; gap: .25rem; }
.jahr-zeile {
  display: grid; grid-template-columns: 9rem minmax(0, 1fr) 8rem 9rem; gap: 1rem; align-items: center;
  padding: .5rem .75rem; border-radius: 12px; color: var(--text); font-weight: 600;
}
a.jahr-zeile:hover { background: #f7f7f7; color: var(--text); }
.jahr-zeile .jahr { font-weight: 800; font-size: 1.05rem; }
.jahr-zeile .jahr .leise { font-size: .75rem; font-weight: 700; }
.jahr-zeile .betrag { text-align: right; font-weight: 800; white-space: nowrap; }
.jahr-zeile > .leise { text-align: right; font-size: .85rem; white-space: nowrap; }
.balken { height: 14px; background: var(--linie); border-radius: 999px; overflow: hidden; }
.balken span { display: block; height: 100%; background: var(--gruen-knopf); border-radius: 999px; }

/* Filter-Reiter (Rechnungen) wie FOLLOWING/FOLLOWERS */
.filter { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter a { padding: .45rem .9rem; border-radius: 12px; border: 2px solid transparent; color: var(--leise); font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.filter a:hover { background: #f7f7f7; }
.filter a.aktiv { background: var(--blau-hell); border-color: var(--blau-rand); color: var(--blau); }

/* Schmale Fenster: Seitenleiste nur mit Symbolen */
@media (max-width: 1100px) {
  .seitenleiste { width: 84px; padding: 1.25rem .6rem; }
  .marke span, .seitenleiste nav a { font-size: 0; }
  .marke { justify-content: center; padding: 0 0 1.25rem; }
  .marke img { height: 26px; }
  .seitenleiste nav a { justify-content: center; padding: .55rem; gap: 0; }
  .abmelden button { font-size: 0; justify-content: center; padding: .55rem; gap: 0; }
}
@media (max-width: 860px) {
  .zwei-spalten, .raster, .erfassung-form, .katalog-zeile { grid-template-columns: 1fr; }
  .jahr-zeile { grid-template-columns: 5rem minmax(0, 1fr) 7rem; }
  .jahr-zeile > .leise { display: none; }
  main { padding: 1rem; }
  table { display: block; overflow-x: auto; }
}
