/*
  workspace-bento-aktionsplan.css — Gestaltung des Bereichs „Aktionsplan" in der Bento-Ansicht (Logik: workspace-bento-aktionsplan.js).

  Kurzbeschreibung (für Laien): je Aktion eine Kachel im selben Raster wie die Bento-Startseite
  (workspace-bento.css .wb-raster: 6 Spalten, Reihen 168 px, 16 px Luft; Tablet 4/3 Spalten; Handy 1 Spalte, Reihen 132 px).
  Grundgröße 1×1; wichtige Aktionen sind 2×1 (.ba-g) oder 2×2 (.ba-gg) und zeigen mehr (Notiz/Mail-Betreff, Verkaufschance,
  letzter Verlaufs-Eintrag). grid-auto-flow: dense füllt Lücken mit kleineren Kacheln, damit keine Löcher bleiben.
  Vorn eine blaue Kopf-Kachel (2×1, Stil .bs-kopfkarte aus workspace-bento-seite.css), am Ende die „+"-Kachel.
  Lädt NACH workspace-bento-seite.css (nutzt deren Werte --bs-*). Bis 24.10.2026 stand dieser Teil am Ende der Vorlagen-CSS.
  „Neue Aktion" und „Bearbeiten" (.ba-e) sind EINE ruhige Karte: großes Feld, eine Zeile kleiner Pillen, Auswahl klappt in
  der Karte auf (schwarz = gewählt), „Mehr …" für Erinnerung/Wiederholung/Wichtig/Notiz.
  Kleine Symbole auf den Aktions-Kacheln (.ba-sym): Stern = wichtig, Glocke = Erinnerung, Pfeile = Wiederholung.
*/

/* marke-ausnahme: Bento-Ansicht wie im AIOS (Ralph 23.10.2026) — große Rundungen und Raster-Maße der Bento-Startseite (workspace-bento.css), Kopf-Kachel wie .bs-kopfkarte */
:root.bs-offen #bsBereich[data-bereich="aktionsplan"] { grid-template-rows: minmax(0, 1fr); }
#bsBereich[data-bereich="aktionsplan"] .bs-kopf, #bsBereich[data-bereich="aktionsplan"] .bs-werkzeug, #bsBereich[data-bereich="aktionsplan"] .bs-liste-karte > .bs-pillen { display: none; }
#bsBereich[data-bereich="aktionsplan"] .bs-liste-karte { background: transparent; box-shadow: none; padding: 0; }

/* Raster wie die Startseite. Platz über der ersten Reihe, damit Anheben und Schatten beim Überfahren nicht abgeschnitten werden */
.ba-raster { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 168px; grid-auto-flow: dense; gap: 16px; }   /* Hover-Luft kommt aus der Liste der Vorlage */
#bsBereich .ba-raster .ba-k { min-height: 0; gap: 0; padding: 20px 22px; border-radius: var(--bs-r); box-shadow: var(--wb-rand, none); overflow: hidden;
  container-type: inline-size; user-select: none; -webkit-user-select: none; }
#bsBereich .ba-raster .ba-k:hover { box-shadow: var(--wb-schatten-hover, 0 10px 26px rgba(15, 23, 42, .10)); transform: translateY(-3px); }
#bsBereich .ba-raster .ba-k:focus-visible { box-shadow: 0 0 0 2px var(--bs-grund), 0 0 0 4px var(--marke-akzent); }
/* Größen: 2×1 und 2×2 (Regel in workspace-bento-aktionsplan.js#wichtigkeit) */
.ba-raster .ba-g { grid-column: span 2; }
.ba-raster .ba-gg { grid-column: span 2; grid-row: span 2; }

/* Kopf-Kachel: Farbe/Schrift aus .bs-kopfkarte, hier nur Platz im Raster */
.ba-raster .ba-kopfkarte { grid-column: span 2; min-height: 0; }

.ba-kopf { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; min-width: 0; }
.ba-etiketten { display: flex; gap: 4px; min-width: 0; overflow: hidden; justify-content: flex-end; }
.ba-etikett { white-space: nowrap; height: 22px; padding: 0 8px; font-size: 11px; }
.ba-kreis { width: 26px; height: 26px; flex: none; padding: 0; border: 2px solid var(--marke-linie-stark); border-radius: 50%; background: transparent;
  color: var(--marke-ok); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, background .15s; }
.ba-kreis svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.ba-kreis:hover { border-color: var(--marke-ok); }
.ba-kreis:hover svg { opacity: .6; }
.ba-kreis:focus-visible { outline: 2px solid var(--marke-akzent); outline-offset: 2px; }
.ba-k.ba-fertig .ba-kreis { background: var(--marke-ok); border-color: var(--marke-ok); color: #fff; }
.ba-k.ba-fertig .ba-kreis svg { opacity: 1; }
.ba-k.ba-fertig .ba-titel { text-decoration: line-through; color: var(--bs-leise); }

.ba-titel { margin-top: 12px; font-size: 14px; font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; flex: none; }
.ba-g .ba-titel, .ba-gg .ba-titel { font-size: 15px; }
.ba-gg .ba-titel { -webkit-line-clamp: 3; }
.ba-her { margin-top: 4px; font-size: 12px; color: var(--bs-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.ba-text { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--bs-text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow-wrap: anywhere; white-space: pre-line; }
.ba-gg .ba-text { -webkit-line-clamp: 4; }
.ba-zusatz { margin-top: 8px; font-size: 12px; color: var(--bs-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.ba-zusatz span { color: var(--bs-leise); }
.ba-verlauf { margin-top: 12px; padding: 8px 12px; border-radius: var(--bs-r-k); background: var(--bs-weich); font-size: 12px; line-height: 1.4; color: var(--bs-text);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow-wrap: anywhere; flex: none; }
.ba-verlauf small { display: block; font-size: 11px; color: var(--bs-leise); }
.ba-fuss { display: flex; align-items: baseline; gap: 12px; min-width: 0; margin-top: auto; padding-top: 6px; flex: none; }
.ba-faellig { font-size: 12px; color: var(--bs-leise); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 100%; }
.ba-faellig.rot { color: var(--marke-gefahr); font-weight: 600; }
.ba-faellig.heute { color: var(--bs-text); font-weight: 700; }
.ba-wer { min-width: 0; margin-left: auto; font-size: 12px; color: var(--bs-leise); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* frisch angelegt: leuchtet einmal auf */
.ba-k.ba-frisch { animation: baFrisch 1.6s ease both; }
@keyframes baFrisch { 0%, 40% { box-shadow: 0 0 0 2px var(--bs-grund), 0 0 0 4px var(--bs-dunkel); } 100% { box-shadow: var(--wb-rand, 0 0 0 0 transparent); } }
/* „+"-Kachel wie „+ Kachel hinzufügen" auf der Startseite */
.ba-plus { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 20px 22px; box-sizing: border-box;
  border: 2px dashed var(--marke-linie-stark); border-radius: var(--bs-r); background: transparent; color: var(--bs-leise); font: 600 13px var(--marke-schrift);
  cursor: pointer; transition: background .2s, color .2s; }
.ba-plus:hover { background: var(--bs-karte); color: var(--bs-text); }
.ba-plus:focus-visible { outline: 2px solid var(--marke-akzent); outline-offset: 2px; }
.ba-plus svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Detail und Formular (groß über dem Raster) */
.ba-detail { display: flex; flex-direction: column; flex: 1 0 auto; }
.ba-zeile { display: flex; gap: 8px; align-items: center; margin: 0 0 16px; flex-wrap: wrap; }
.ba-zeile .a4h-field { width: auto; flex: 0 1 200px; min-width: 0; }
.ba-detail > .a4h-field-label { display: block; margin: 12px 0 6px; }
.ba-termin-zeile { align-items: flex-start; }
.ba-termin-zeile .ba-pillen { flex: 0 1 auto; }
.ba-termin-zeile .ba-wahl { flex-basis: 100%; }

/* Symbole auf den Aktions-Kacheln: Stern (wichtig), Glocke (Erinnerung), Pfeile (Wiederholung) */
.ba-sym { flex: none; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--marke-r-pill); background: var(--bs-weich); color: var(--bs-leise); }
.ba-sym svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ba-sym-stern { color: var(--marke-warn); }
.ba-sym-stern svg { fill: currentColor; }

/* ── „Neue Aktion" / „Bearbeiten": EINE ruhige Karte mittig auf dem grauen Grund (Ralph, 24.10.2026 abends) ── */
#bsBereich[data-bereich="aktionsplan"][data-ansicht="raster"].bs-detail-auf .bs-detail:has(> .ba-e) { background: transparent; box-shadow: none; padding: 10px 2px 20px; }
#bsBereich[data-bereich="aktionsplan"] .bs-detail:has(> .ba-e) > .bs-zurueck { align-self: flex-start; margin: 0 0 12px; }
.ba-e { width: 100%; max-width: 760px; margin: 0 auto; box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; padding: 24px;
  border-radius: var(--bs-r); background: var(--bs-karte); color: var(--bs-text); box-shadow: var(--wb-rand, var(--wbs-schatten)); font-family: var(--marke-schrift); transition: box-shadow .25s; }
.ba-e:hover { box-shadow: var(--wb-schatten-hover, 0 10px 26px rgba(15, 23, 42, .10)), var(--wb-rand, var(--wbs-schatten)); }
.ba-e-titel { margin: 0; font: 700 15px/1.3 var(--marke-schrift); color: var(--bs-text); }
/* Das große Feld: ohne Rahmen, nur die Schrift — die Karte ist die Fläche */
.ba-e-was { width: 100%; box-sizing: border-box; min-height: 56px; margin: 0; padding: 0; border: 0; outline: 0; resize: none; background: transparent;
  color: var(--bs-text); font: 600 20px/1.35 var(--marke-schrift); }
.ba-e-was::placeholder { color: var(--bs-leise); font-weight: 500; }
.ba-e-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding-top: 12px; border-top: 1px solid var(--bs-linie); }
.ba-e-chip { max-width: 100%; border: 0; border-radius: var(--marke-r-pill); padding: 6px 12px; background: var(--bs-weich); color: var(--bs-text);
  font: 600 12px var(--marke-schrift); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; transition: background .2s, color .2s; }
.ba-e-chip[hidden] { display: none; }
.ba-e-chip:hover { background: var(--marke-feld); }
.ba-e-chip.offen { background: var(--bs-dunkel); color: #fff; }
.ba-e-mehrknopf, .ba-e-link { border: 0; background: transparent; padding: 6px 8px; border-radius: var(--marke-r-pill); color: var(--bs-leise); font: 600 12px var(--marke-schrift); cursor: pointer; transition: background .2s, color .2s; }
.ba-e-mehrknopf:hover, .ba-e-link:hover { background: var(--bs-weich); color: var(--bs-text); }
.ba-e-chip:focus-visible, .ba-e-mehrknopf:focus-visible, .ba-e-link:focus-visible { outline: 2px solid var(--marke-akzent); outline-offset: 1px; }
.ba-e-wahl, .ba-e-gruppe { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ba-e-wahl[hidden], .ba-e-mehr[hidden] { display: none; }
.ba-e-wahl { padding: 12px; border-radius: var(--bs-r-k); background: var(--bs-weich); }
.ba-e-wahl .ba-pillen button { background: var(--bs-karte); }
.ba-e-wahl .ba-pillen button.an { background: var(--bs-dunkel); }
.ba-e-mehr { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.ba-e-klein { font: 600 12px var(--marke-schrift); color: var(--bs-text); }
.ba-e .a4h-field { width: 100%; box-sizing: border-box; min-width: 0; max-width: 360px; }
.ba-e textarea.a4h-field { max-width: none; resize: vertical; }
.ba-e .a4h-field[hidden] { display: none; }
.ba-e-hinweis { margin: 0; font-size: 12px; }
.ba-e-hinweis:empty { display: none; }
.ba-wahl { margin: 0; font-size: 12px; color: var(--bs-leise); font-variant-numeric: tabular-nums; }
.ba-wahl:empty { display: none; }
.ba-e .bs-meldung:empty { display: none; }
.ba-e .bs-meldung .bs-box { margin: 0; }
.ba-e-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ba-e-luecke { flex: 1 1 auto; }

/* Auswahl als Pillen statt Aufklapp-Liste — Form wie im Planer, schwarz = gewählt */
.ba-pillen { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.ba-pillen button { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 0; background: var(--bs-weich); border-radius: var(--marke-r-pill); padding: 7px 12px;
  font: 600 12px var(--marke-schrift); color: var(--bs-leise); cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.ba-pillen button > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ba-pillen button svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ba-pillen button:hover { background: var(--marke-feld); color: var(--bs-text); }
.ba-pillen button.an { background: var(--bs-dunkel); color: #fff; }
.ba-pillen button:focus-visible, .ba-wichtig:focus-visible { outline: 2px solid var(--marke-akzent); outline-offset: 1px; }
/* Initialen vor dem Namen */
.ba-ini { width: 20px; height: 20px; margin-left: -6px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--marke-akzent-zart); color: var(--marke-akzent); font: 700 11px var(--marke-schrift); letter-spacing: 0; }
.ba-pillen button.an .ba-ini { background: rgba(255, 255, 255, .22); color: #fff; }
/* Wichtig: ein Schalter in Pillenform */
.ba-wichtig { border: 0; border-radius: var(--marke-r-pill); padding: 7px 12px; background: var(--bs-weich); color: var(--bs-leise); font: 600 12px var(--marke-schrift); cursor: pointer; transition: background .2s, color .2s; }
.ba-wichtig:hover { background: var(--marke-feld); color: var(--bs-text); }
.ba-wichtig.an { background: var(--bs-dunkel); color: #fff; }
/* Kurze Meldung unten rechts („Erledigt · Rückgängig") — hell, grüner Rand links */
.ba-meldung { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; align-items: center; gap: 12px; max-width: min(420px, calc(100vw - 32px));
  box-sizing: border-box; padding: 10px 10px 10px 16px; border-radius: var(--bs-r-k, 14px); border: 1px solid color-mix(in srgb, var(--marke-ok) 40%, var(--marke-linie)); background: var(--marke-flaeche);
  color: var(--marke-text); box-shadow: var(--marke-schatten); font: 500 13px var(--marke-schrift); animation: wbsRein .3s cubic-bezier(.2, .8, .2, 1) both; }
.ba-meldung span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ba-meldung.fehler { border-color: color-mix(in srgb, var(--marke-gefahr) 45%, var(--marke-linie)); }
.ba-meldung .bs-knopf { height: 30px; padding: 0 12px; font-size: 12px; flex: none; }

@media (max-width: 1100px) { .ba-raster { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 899px) {
  .ba-raster { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .ba-raster .ba-kopfkarte { padding: 16px 18px; border-radius: var(--bs-r); }
  .ba-e { padding: 18px; }
}
/* Handy: eine Spalte — breite Kacheln bleiben eine Spalte breit, 2×2 behält zwei Reihen Höhe */
@media (max-width: 699px) {
  .ba-raster { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 132px; }
  .ba-raster .ba-g, .ba-raster .ba-gg, .ba-raster .ba-kopfkarte { grid-column: auto; }
  #bsBereich .ba-raster .ba-k, .ba-plus { padding: 16px 18px; border-radius: var(--bs-r); }
  .ba-titel { margin-top: 8px; -webkit-line-clamp: 1; }
  .ba-gg .ba-titel { -webkit-line-clamp: 2; }
  .ba-g .ba-text { display: none; }
  .ba-raster .ba-kopfkarte h2 { font-size: 24px; }
  .ba-e-was { font-size: 15px; }
  .ba-e .a4h-field { max-width: none; }
  .ba-meldung { right: 16px; left: 16px; bottom: 16px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  #bsBereich .ba-raster .ba-k:hover { transform: none; }
  .ba-k.ba-frisch, .ba-meldung { animation: none; }
}

/* „@" im Verlaufs-Feld: Namensliste direkt über dem Feld (unten sitzt die feste Knopfleiste) (Stil-Basis: Hover-Karte, Pillen-Zeilen) */
.ba-at-wrap { position: relative; }
.ba-at-liste { position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 20; min-width: 220px; max-width: 100%; max-height: 220px; overflow-y: auto; padding: 6px;
  background: var(--bs-karte, var(--marke-flaeche)); border: 1px solid var(--bs-linie, var(--marke-linie)); border-radius: var(--bs-r-k, 14px); box-shadow: var(--marke-schatten); }
.ba-at-n { display: block; width: 100%; text-align: left; border: 0; background: transparent; color: var(--bs-text, var(--marke-text)); padding: 8px 12px; border-radius: 10px; font: 500 13px var(--marke-schrift); cursor: pointer; }
.ba-at-n:hover, .ba-at-n.an { background: var(--bs-weich, var(--marke-flaeche-2)); }
