/* Erscheinungsbild von Faber Forge und BBShop: dieselben Farben, dieselbe Schrift, dieselbe
   Seitenleiste. Der Farbstreifen oben links unterscheidet die drei Anwendungen voneinander –
   im CRM sandfarben, im Shop grün, hier blau. */
:root {
  --primaer: #4c474e;
  --grund: #f4f3f1;
  --flaeche: #ffffff;
  --linie: #e7e5e3;
  --gruen: #9eb28f;
  --blau: #96d3dd;
  --sand: #cdb499;
  --gelb: #d3a13a;
  --rot: #c65a4b;
  --erfolg: #4b9b5f;
  --leise: #8b858c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--grund);
  color: var(--primaer);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

h1 { font-size: 1.35rem; margin: 0; font-weight: 600; }
h2 { font-size: 0.95rem; margin: 0 0 0.75rem; font-weight: 600; }
a { color: inherit; }

.leise { color: var(--leise); font-size: 0.8125rem; }
[hidden] { display: none !important; }

/* --- Anmeldung ------------------------------------------------------------------------------- */
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.anmeldekarte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  padding: 2rem; width: min(360px, 100%); display: flex; flex-direction: column; gap: 0.5rem;
}
.anmeldekarte label { font-size: 0.8125rem; font-weight: 500; margin-top: 0.75rem; }

/* --- Grundgerüst ----------------------------------------------------------------------------- */
#app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.seitenleiste {
  background: var(--flaeche); border-right: 1px solid var(--linie);
  padding: 1.25rem 0.875rem; display: flex; flex-direction: column; gap: 1.25rem;
  position: sticky; top: 0; height: 100vh;
}
.marke { display: flex; align-items: center; gap: 0.625rem; font-weight: 600; font-size: 1rem; }
.streifen { width: 6px; height: 22px; border-radius: 3px; background: var(--blau); display: inline-block; }

nav { display: flex; flex-direction: column; gap: 2px; }
.menuepunkt {
  text-align: left; background: none; border: 0; padding: 0.5rem 0.625rem; border-radius: 8px;
  font: inherit; color: var(--primaer); cursor: pointer;
}
.menuepunkt:hover { background: var(--grund); }
.menuepunkt.aktiv { background: #eef7f9; font-weight: 600; }

.seitenfuss { margin-top: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.dienste { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--leise); }
.dienste span { display: flex; align-items: center; gap: 0.375rem; }
.punkt { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--leise); flex: none; }
.punkt.an { background: var(--erfolg); }
.punkt.aus { background: var(--rot); }
.punkt.entwurf { background: #b9b5ba; }
.punkt.review { background: var(--gelb); }
.punkt.freigegeben { background: var(--gruen); }
.punkt.veroeffentlicht { background: var(--erfolg); }

main { padding: 1.5rem 1.75rem 3rem; max-width: 1180px; }
.kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.kopfaktionen { display: flex; align-items: center; gap: 0.5rem; }

/* --- Bausteine ------------------------------------------------------------------------------- */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  padding: 1.125rem; margin-bottom: 1rem;
}
.spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  .seitenleiste { position: static; height: auto; }
  .spalten { grid-template-columns: 1fr; }
}

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 0.875rem 1rem; }
.kachel .zahl { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.kachel .bezeichnung { font-size: 0.75rem; color: var(--leise); }

.knopf {
  background: var(--primaer); color: #fff; border: 0; border-radius: 8px;
  padding: 0.5rem 0.875rem; font: inherit; font-weight: 500; cursor: pointer;
}
.knopf:hover { opacity: 0.9; }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopf.leise { background: var(--flaeche); color: var(--primaer); border: 1px solid var(--linie); }
.knopf.gruen { background: var(--erfolg); }
.knopf.klein { padding: 0.3125rem 0.625rem; font-size: 0.8125rem; }
.knopf.voll { width: 100%; margin-top: 1rem; }

.feld {
  border: 1px solid var(--linie); border-radius: 8px; padding: 0.5rem 0.625rem;
  font: inherit; background: var(--flaeche); color: var(--primaer); width: 100%;
}
.feld:focus { outline: 2px solid var(--blau); outline-offset: -1px; }
.feld.schmal { width: auto; }

.fehler { color: var(--rot); font-size: 0.8125rem; }

/* --- Listen ---------------------------------------------------------------------------------- */
.liste { display: flex; flex-direction: column; gap: 0.625rem; }
.eintrag {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  padding: 0.875rem 1rem; display: flex; gap: 1rem; align-items: flex-start;
}
.eintrag .haupt { flex: 1; min-width: 0; }
.eintrag .titelzeile { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.eintrag h3 { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.eintrag p { margin: 0.375rem 0 0; color: var(--leise); font-size: 0.8125rem; }
.eintrag .aktionen { display: flex; gap: 0.375rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.marke-etikett {
  font-size: 0.6875rem; padding: 0.125rem 0.5rem; border-radius: 999px;
  background: var(--grund); border: 1px solid var(--linie); color: var(--leise); white-space: nowrap;
}
.marke-etikett.entwurf { background: #f2f1f2; }
.marke-etikett.review { background: #fbf3e0; border-color: #efdfb8; color: #8a6a1f; }
.marke-etikett.freigegeben { background: #eef3ea; border-color: #d5e2cb; color: #4f6b40; }
.marke-etikett.veroeffentlicht { background: #e8f4ec; border-color: #c6e2cf; color: #2f6a44; }
.marke-etikett.dringend { background: #fbeceb; border-color: #f0cdc8; color: #a2382b; }

.merkmale { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; font-size: 0.75rem; color: var(--leise); }
.merkmale b { color: var(--primaer); font-weight: 500; }

/* --- Kanäle ---------------------------------------------------------------------------------- */
.kanalkarte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px; padding: 1.125rem; margin-bottom: 1rem; }
.kanalkopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.kanalwerte { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; }
.kanalwert { border: 1px solid var(--linie); border-radius: 8px; padding: 0.625rem 0.75rem; }
.kanalwert .zahl { font-size: 1.125rem; font-weight: 600; }
.kanalwert .bezeichnung { font-size: 0.6875rem; color: var(--leise); }
.kanalwert input { border: 0; border-bottom: 1px dashed var(--linie); width: 100%; font: inherit;
  font-size: 1.125rem; font-weight: 600; padding: 0; background: none; color: var(--primaer); }
.kanalwert input:focus { outline: none; border-bottom-color: var(--blau); }
.nichtangebunden { font-size: 0.75rem; color: var(--gelb); }

/* --- Kalender -------------------------------------------------------------------------------- */
.legende { display: flex; gap: 1rem; margin-bottom: 0.75rem; font-size: 0.75rem; color: var(--leise); }
.legende span { display: flex; align-items: center; gap: 0.375rem; }
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--linie);
  border: 1px solid var(--linie); border-radius: 12px; overflow: hidden; }
.kalender .wochentag { background: var(--flaeche); padding: 0.5rem; font-size: 0.75rem; color: var(--leise); text-align: center; font-weight: 500; }
.kalender .tag { background: var(--flaeche); min-height: 96px; padding: 0.375rem; display: flex; flex-direction: column; gap: 2px; }
.kalender .tag.fremd { background: #fafafa; color: var(--leise); }
.kalender .tag.heute { background: rgba(150, 211, 221, 0.14); }
.kalender .tagzahl { font-size: 0.75rem; color: var(--leise); }
.kalender .marke-eintrag {
  font-size: 0.6875rem; border-radius: 5px; padding: 0.125rem 0.3125rem; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--leise);
  background: var(--grund);
}
.kalender .marke-eintrag.entwurf { border-left-color: #b9b5ba; }
.kalender .marke-eintrag.review { border-left-color: var(--gelb); }
.kalender .marke-eintrag.freigegeben { border-left-color: var(--gruen); }
.kalender .marke-eintrag.veroeffentlicht { border-left-color: var(--erfolg); }
.kalender .marke-eintrag.geplant { border-left-color: var(--blau); }

/* --- Editor ---------------------------------------------------------------------------------- */
.ueberlagerung { position: fixed; inset: 0; background: rgba(76, 71, 78, 0.35); display: grid; place-items: center; padding: 1.5rem; z-index: 20; }
.editorkarte { background: var(--flaeche); border-radius: 14px; width: min(1080px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.editorkopf { display: flex; gap: 0.75rem; align-items: center; padding: 1rem 1.125rem; border-bottom: 1px solid var(--linie); }
.titelfeld { font-size: 1.0625rem; font-weight: 600; border: 0; }
.titelfeld:focus { outline: none; }
.editorkoerper { display: grid; grid-template-columns: 1fr 300px; gap: 1.125rem; padding: 1.125rem; overflow: auto; flex: 1; }
.editorhaupt { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.schreibflaeche { min-height: 420px; resize: vertical; line-height: 1.6; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8125rem; }
.editorseite { display: flex; flex-direction: column; gap: 0.375rem; }
.editorseite label { font-size: 0.75rem; font-weight: 500; margin-top: 0.5rem; }
.bildhinweis { font-size: 0.75rem; color: var(--leise); background: var(--grund); border-radius: 8px; padding: 0.5rem; }
.kommentare { display: flex; flex-direction: column; gap: 0.375rem; max-height: 140px; overflow: auto; }
.kommentar { background: var(--grund); border-radius: 8px; padding: 0.375rem 0.5rem; font-size: 0.75rem; }
.zeile { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; }
.editorfuss { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.875rem 1.125rem; border-top: 1px solid var(--linie); flex-wrap: wrap; }
.fussaktionen { display: flex; gap: 0.5rem; margin-left: auto; }
.fussfehler { color: var(--rot); font-size: 0.8125rem; }
@media (max-width: 860px) { .editorkoerper { grid-template-columns: 1fr; } }

/* --- Kurzmeldung ----------------------------------------------------------------------------- */
.hinweis {
  position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%);
  background: var(--primaer); color: #fff; padding: 0.625rem 1.125rem; border-radius: 10px;
  font-size: 0.8125rem; z-index: 40; max-width: 90vw;
}
.hinweis.fehler { background: var(--rot); }

/* --- Zeitraum-Auswahl der Themen-Destillation --------------------------------------------------- */
.destillierleiste { padding: 0.875rem 1rem; }
.zeitraum { display: flex; align-items: flex-end; gap: 0.75rem; flex-wrap: wrap; }
.feldgruppe { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.75rem; color: var(--leise); }
.destillierleiste .leise { margin: 0.625rem 0 0; }

/* --- Aufklappbare Themen ------------------------------------------------------------------------
   Natives <details>/<summary>: der Titel steht immer da, die Einzelheiten erscheinen auf Klick.
   Bei fünf Themen pro Woche ist die Liste sonst laenger als der Bildschirm. */
/* display:block überschreibt das display:flex von .eintrag – sonst legt der Flex-Container die
   Kopfzeile und den aufgeklappten Inhalt nebeneinander statt untereinander. */
.thema { padding: 0; overflow: hidden; display: block; }
.thema > summary {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.875rem 1rem; cursor: pointer; list-style: none;
}
.thema > summary::-webkit-details-marker { display: none; }
.thema > summary:hover { background: #fafafa; }
.thema .pfeil { color: var(--leise); font-size: 0.75rem; transition: transform 0.15s; flex: none; }
.thema[open] .pfeil { transform: rotate(90deg); }
.thema .thementitel { font-size: 0.9375rem; font-weight: 600; margin: 0; flex: 1; min-width: 12rem; }
.thema .aktionen { margin-left: auto; }
.thema .inhalt { padding: 0 1rem 1rem 2rem; border-top: 1px solid var(--linie); padding-top: 0.75rem; }
.thema .inhalt p { margin: 0 0 0.5rem; }
.thema .merkmale { flex-direction: column; gap: 0.25rem; align-items: flex-start; }

/* --- Quellen ------------------------------------------------------------------------------------ */
.quellenformular { display: grid; grid-template-columns: 1fr 1.4fr 0.7fr 1.4fr auto; gap: 0.75rem; align-items: end; }
@media (max-width: 1000px) { .quellenformular { grid-template-columns: 1fr 1fr; } }
.quelle-art { font-size: 0.6875rem; padding: 0.125rem 0.5rem; border-radius: 999px; background: var(--grund);
  border: 1px solid var(--linie); color: var(--leise); white-space: nowrap; }
.quelle-aus { opacity: 0.5; }
.termin { display: flex; align-items: baseline; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--linie); }
.termin:last-child { border-bottom: 0; }
.termin .wann { font-weight: 600; white-space: nowrap; min-width: 8.5rem; }
.termin .bald { color: var(--rot); }
.termin .woher { color: var(--leise); font-size: 0.75rem; }
