/* Gestaltung der Veranstaltungsplanung.
   Werte als Custom Properties, keine Farbe direkt im Bauteil.
   Alle Text-auf-Fläche-Kombinationen halten 4,5:1 (WCAG 2.1 AA) ein —
   die Anwendung gehört einem Verein, wird aber von öffentlichen Stellen
   benutzt, und Barrierefreiheit hinterher einzubauen ist teurer. */

:root {
  --grund: #ffffff;
  --grund-gedaempft: #f4f6f8;
  --grund-vertieft: #e8ecf0;
  --linie: #c8d0d8;
  --text: #16202a;
  --text-leise: #56626e;

  --akzent: #1f5f8b;          /* Kontrast auf Weiß: 6,4:1 */
  --akzent-flaeche: #e3eef6;
  --warnung: #9a3412;         /* Kontrast auf Weiß: 6,3:1 */
  --warnung-flaeche: #fdeae2;
  --gut: #1a6a4a;

  --kat-impuls: #6b4fa8;
  --kat-arbeit: #1f5f8b;
  --kat-austausch: #1a6a4a;
  --kat-pause: #7a6a2f;
  --kat-orga: #56626e;

  --rund: 8px;
  --schatten: 0 1px 2px rgba(20, 30, 40, .12);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--grund-gedaempft);
}

.sprungmarke {
  position: absolute; left: -999px;
  background: var(--akzent); color: #fff; padding: .5rem 1rem;
}
.sprungmarke:focus { left: .5rem; top: .5rem; z-index: 50; }

a { color: var(--akzent); }

.kopf {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: var(--grund);
  border-bottom: 1px solid var(--linie);
}
.kopf__name { font-weight: 600; text-decoration: none; color: var(--text); }
.kopf__nav { display: flex; gap: 1rem; align-items: center; }
.kopf__nav form { margin: 0; }
.kopf__gast { color: var(--text-leise); }

main { padding: 1rem; max-width: 100%; }
.eng { max-width: 44rem; margin: 0 auto; }

h1 { font-size: 1.5rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .3rem; }

.karte {
  background: var(--grund); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: 1rem; margin-bottom: 1rem;
}

.meldungen { list-style: none; margin: 0; padding: .5rem 1rem 0; }
.meldung {
  padding: .6rem .8rem; border-radius: var(--rund); margin-bottom: .4rem;
  background: var(--akzent-flaeche); border: 1px solid var(--linie);
  word-break: break-word;
}
.meldung--error { background: var(--warnung-flaeche); color: var(--warnung); }
.meldung--success { background: #e6f4ee; }

label { display: block; font-weight: 500; margin-top: .6rem; }
input, select, textarea {
  font: inherit; width: 100%; padding: .45rem .55rem;
  border: 1px solid var(--linie); border-radius: 6px; background: var(--grund);
  color: var(--text);
}
input[type="checkbox"] { width: auto; }
.hilfe { color: var(--text-leise); font-size: .85rem; }
.fehler { color: var(--warnung); font-size: .9rem; }

.knopf {
  font: inherit; cursor: pointer; padding: .45rem .8rem;
  border: 1px solid var(--akzent); border-radius: 6px;
  background: var(--akzent); color: #fff;
}
.knopf:hover { filter: brightness(1.1); }
.knopf--schlicht { background: transparent; color: var(--akzent); }
.knopf--gefahr { background: transparent; color: var(--warnung); border-color: var(--warnung); }
.knopf--klein { padding: .2rem .45rem; font-size: .85rem; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* ---------------------------------------------------------- Das Brett

   Ein Tag, ein Zeitraster: Spalte 1 ist die Uhrzeit, danach je Raum eine
   Spalte. Eine Rasterzeile ist eine Minute (2 px) — dadurch steht jede
   Kachel an der Stelle, an der sie stattfindet, und eine Stunde sieht aus
   wie eine Stunde. Feste und gemeinsame Blöcke laufen quer über alle
   Räume; das ist der ganze Sinn der Sache und hier nur eine Zeile CSS
   (`grid-column: 2 / -1`).                                              */

.tagleiste { display: flex; gap: .25rem; flex-wrap: wrap; margin-bottom: .75rem; }
.tagleiste__tag {
  padding: .4rem .8rem; border: 1px solid var(--linie); border-bottom: none;
  border-radius: var(--rund) var(--rund) 0 0;
  background: var(--grund-vertieft); color: var(--text); text-decoration: none;
}
.tagleiste__tag--an { background: var(--grund); font-weight: 600; box-shadow: inset 0 3px 0 var(--akzent); }
.tagleiste__warnung { color: var(--warnung); font-weight: 700; }

.raumfilter {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center;
  background: var(--grund); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: .5rem .75rem; margin-bottom: .75rem;
}
.raumfilter__wort { font-weight: 600; }
.raumfilter__raum { display: inline-flex; align-items: center; gap: .3rem; margin: 0; font-weight: 400; }
.raumfilter input[type="checkbox"] { width: auto; }

.rasterrahmen { overflow-x: auto; background: var(--grund); border: 1px solid var(--linie); border-radius: var(--rund); }
.rasterwerk { min-width: min-content; }

.rasterkopf {
  display: grid; grid-template-columns: 4.5rem var(--spalten);
  position: sticky; top: 0; z-index: 5;
  background: var(--grund); border-bottom: 2px solid var(--linie);
}
.rasterkopf__zeit, .rasterkopf__raum { padding: .45rem .5rem; font-weight: 600; }
.rasterkopf__zeit { color: var(--text-leise); font-weight: 400; }
.rasterkopf__raum { border-left: 1px solid var(--linie); }
.rasterkopf__warnung { color: var(--warnung); font-weight: 400; font-size: .8rem; }

.raster {
  display: grid;
  grid-template-columns: 4.5rem var(--spalten);
  grid-template-rows: repeat(var(--minuten), 2px);
  position: relative;
}
.raster__marke {
  grid-column: 1; align-self: start; padding: 0 .5rem;
  font-size: .8rem; color: var(--text-leise); font-variant-numeric: tabular-nums;
  transform: translateY(-.6em); z-index: 2;
}
.raster__marke--voll { color: var(--text); font-weight: 600; }
.raster__linie { grid-column: 2 / -1; border-top: 1px solid var(--grund-vertieft); height: 0; }
.raster__linie--voll { border-top-color: var(--linie); }

.spurflaeche { border-left: 1px solid var(--linie); }

.quer {
  grid-column: 2 / -1; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .2rem .5rem; overflow: hidden;
  border-radius: 4px;
}
.quer--fest {
  background: repeating-linear-gradient(45deg,
    var(--grund-vertieft), var(--grund-vertieft) 8px,
    var(--grund-gedaempft) 8px, var(--grund-gedaempft) 16px);
  border: 1px solid var(--linie);
}
.quer--gemeinsam { background: var(--akzent-flaeche); border: 1px solid var(--akzent); }
.quer--rot { background: var(--warnung-flaeche); border-color: var(--warnung); }
.quer__zeit { font-size: .8rem; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.quer__titel { font-weight: 600; }
.quer__wort {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--akzent);
}
.quer form { margin: 0; }

.kachel {
  z-index: 3; margin: 1px 2px; padding: .25rem .4rem; overflow: hidden;
  background: var(--grund); border: 1px solid var(--linie);
  border-left: 5px solid var(--farbe, var(--akzent));
  border-radius: 6px; box-shadow: var(--schatten);
  display: flex; flex-direction: column; gap: .1rem;
}
.kachel--rot { border-color: var(--warnung); background: var(--warnung-flaeche); }
.kachel--kurz { padding: .1rem .4rem; font-size: .85rem; }
.kachel--zieht { opacity: .45; }
.kachel__zeile { display: flex; justify-content: space-between; gap: .4rem; }
.kachel__zeit { font-size: .78rem; color: var(--text-leise); font-variant-numeric: tabular-nums; }
.kachel__titel { font-weight: 600; color: var(--text); text-decoration: none; }
.kachel__titel:hover { text-decoration: underline; }
.kachel__wer { font-size: .8rem; color: var(--text-leise); }
.kachel__marken { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .15rem; }
.marke {
  font-size: .72rem; padding: .05rem .35rem; border-radius: 999px;
  background: var(--grund-vertieft); color: var(--text);
}
.marke--leise { color: var(--text-leise); }
.kachel__warnung { margin: .25rem 0 0; font-size: .78rem; color: var(--warnung); }
.kachel__warnung form { display: inline; margin: 0; }
.kachel__werkzeug { display: flex; gap: .15rem; margin-top: auto; }
.kachel__werkzeug form { margin: 0; }
.einzeiler { display: inline; }

.anlegen {
  background: var(--grund); border: 1px solid var(--linie);
  border-radius: var(--rund); padding: .75rem 1rem; margin-top: 1rem;
}
.anlegen h3 { margin-top: 0; }
.anlegen form + form { margin-top: 1rem; border-top: 1px solid var(--linie); padding-top: .75rem; }

.hinweisliste { margin: 0 0 1rem; padding: .6rem .9rem; border-radius: var(--rund);
  background: var(--warnung-flaeche); color: var(--warnung); }
.ablegeziel { outline: 2px dashed var(--akzent); outline-offset: -2px; }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--linie); }
.leise { color: var(--text-leise); }
.reihe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: flex-end; }
.reihe > * { flex: 1 1 8rem; }
.reihe form { margin: 0; }

.fuss { padding: 1rem; color: var(--text-leise); font-size: .85rem; }

@media print {
  .kopf, .fuss, .kachel__werkzeug, .meldungen, .knopf { display: none !important; }
  body { background: #fff; }
  
  
  .kachel { break-inside: avoid; box-shadow: none; }
}

.liste { list-style: none; margin: 0 0 .75rem; padding: 0; }
.liste > li { padding: .35rem 0; border-bottom: 1px solid var(--grund-vertieft); }
.liste > li:last-child { border-bottom: none; }
.erledigt { color: var(--text-leise); text-decoration: line-through; }

.rechts { text-align: right; }
.farbtupfer {
  display: inline-block; width: .85rem; height: .85rem; border-radius: 3px;
  border: 1px solid var(--linie); vertical-align: -1px; margin-right: .3rem;
}
.tagblock { border-top: 1px solid var(--linie); padding-top: .5rem; margin-top: 1rem; }
.tagblock:first-of-type { border-top: none; margin-top: 0; }
