/* ZAVET SIPES Aufgabenmanager - Gestaltung
   Ruhige Grundflaeche, starke Farbe nur fuer das, was jetzt Handeln verlangt. */
:root {
  --grund: #f4f6f8; --flaeche: #ffffff; --flaeche2: #f9fafb; --linie: #e3e7ec; --linie2: #d4dae1;
  --text: #17202b; --leise: #66717f; --sehrleise: #9aa4b1;
  --marke: #0f5f5a; --marke2: #127a73; --markehell: #e3f2f0; --akzent: #f59e0b;
  --gut: #15803d; --guthell: #e7f6ec; --warn: #b45309; --schlecht: #c62828; --schlechthell: #fdecec;
  --p1: #d32f2f; --p2: #ef6c00; --p3: #f59e0b; --p4: #c8a400; --p5: #2f6fde; --p6: #6b7a8c; --p7: #a4afbd;
  --gelb: #fff1a8; --rot: #ffd0d0; --gruen: #c9f2d0;
  --schatten: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --schatten2: 0 12px 32px rgba(16,24,40,.18);
  --rund: 10px; --rund2: 14px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1418; --flaeche: #161d23; --flaeche2: #1b232a; --linie: #26313a; --linie2: #33414c;
    --text: #e6ebf0; --leise: #9aa7b4; --sehrleise: #6c7a87;
    --marke: #2bb3a6; --marke2: #3cc7ba; --markehell: #12302d; --guthell: #12301d; --schlechthell: #3a1a1a;
    --gelb: #5b5016; --rot: #5c2525; --gruen: #1f4b2a;
    --schatten: 0 1px 2px rgba(0,0,0,.4); --schatten2: 0 12px 32px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--schrift); color: var(--text); background: var(--grund);
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--marke); }
.versteckt { display: none !important; }
:focus-visible { outline: 2px solid var(--marke2); outline-offset: 2px; }

/* ---------- Start und Anmeldung */
.startbild { height: 100vh; display: grid; place-items: center; }
.startbild img { animation: puls 1.4s ease-in-out infinite; }
.anmeldung { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--markehell), transparent),
              radial-gradient(900px 500px at 110% 110%, rgba(245,158,11,.12), transparent), var(--grund); }
.anmeldekarte { width: 100%; max-width: 380px; background: var(--flaeche); border-radius: 18px;
  box-shadow: var(--schatten2); padding: 32px 28px; animation: hoch .35s ease-out; }
.anmeldekarte .kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.anmeldekarte h1 { font-size: 20px; margin: 0; }
.anmeldekarte .unter { color: var(--leise); font-size: 13px; }
.anmeldekarte label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; }
.anmeldekarte input { width: 100%; }
.anmeldekarte .knopf { width: 100%; margin-top: 22px; padding: 11px; font-size: 15px; }
.fehlertext { color: var(--schlecht); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- Bedienelemente */
input[type=text], input[type=password], input[type=number], input[type=date], input[type=month],
input[type=search], select, textarea {
  border: 1px solid var(--linie2); background: var(--flaeche); border-radius: 8px; padding: 8px 10px;
  min-height: 38px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--marke2);
  box-shadow: 0 0 0 3px var(--markehell); }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0;
  border-radius: 8px; padding: 8px 14px; min-height: 36px; background: var(--marke); color: #fff;
  font-weight: 600; cursor: pointer; transition: background .15s, transform .08s, box-shadow .15s;
  white-space: nowrap; text-decoration: none; }
.knopf:hover { background: var(--marke2); }
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .5; cursor: default; }
.knopf.zweit { background: var(--flaeche); color: var(--text); border: 1px solid var(--linie2); }
.knopf.zweit:hover { background: var(--flaeche2); border-color: var(--sehrleise); }
.knopf.flach { background: transparent; color: var(--leise); padding: 6px 8px; }
.knopf.flach:hover { background: var(--flaeche2); color: var(--text); }
.knopf.klein { min-height: 28px; padding: 4px 10px; font-size: 13px; }
.knopf.gefahr { background: var(--schlecht); }
.knopf.akzent { background: var(--akzent); color: #3b2500; }
.symbol { width: 18px; height: 18px; flex: none; }

/* ---------- Grundaufbau */
.oben { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 20; }
.oben .marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px;
  color: var(--text); text-decoration: none; }
.oben .marke small { font-weight: 500; color: var(--leise); font-size: 12px; display: block; }
.oben .suche { flex: 1; max-width: 560px; position: relative; }
.oben .suche input { width: 100%; padding-left: 36px; background: var(--flaeche2); }
.oben .suche .symbol { position: absolute; left: 10px; top: 10px; color: var(--sehrleise); }
.oben .rechts { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menuknopf { display: none; }
.kopfbild { width: 34px; height: 34px; border-radius: 50%; background: var(--markehell); color: var(--marke);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; border: 0; cursor: pointer; }
.haupt { display: grid; grid-template-columns: 236px minmax(340px, 440px) 1fr; height: calc(100vh - 56px); }
.seite { border-right: 1px solid var(--linie); background: var(--flaeche); overflow-y: auto; padding: 12px 8px 24px; }
.seite h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--sehrleise);
  margin: 18px 10px 6px; }
.ansicht { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); }
.ansicht:hover { background: var(--flaeche2); }
.ansicht.aktiv { background: var(--markehell); color: var(--marke); font-weight: 600; }
.ansicht .zahl { margin-left: auto; font-size: 12px; color: var(--leise); font-weight: 600; }
.ansicht .zahl.heiss { background: var(--p1); color: #fff; border-radius: 10px; padding: 0 7px; }
.liste { display: flex; flex-direction: column; border-right: 1px solid var(--linie); min-width: 0;
  background: var(--flaeche2); }
.detail { overflow: hidden; display: flex; min-width: 0; background: var(--grund); }

/* ---------- Filter */
.filter { padding: 10px 12px; border-bottom: 1px solid var(--linie); background: var(--flaeche);
  display: flex; flex-direction: column; gap: 8px; }
.filter .reihe { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.filter .titel { display: flex; align-items: center; gap: 8px; }
.filter .titel h2 { font-size: 17px; margin: 0; }
.filter .titel .anzahl { color: var(--leise); font-size: 13px; }
.filter select { min-height: 30px; padding: 3px 8px; font-size: 13px; }
.chip { border: 1px solid var(--linie2); background: var(--flaeche); border-radius: 16px; padding: 3px 10px;
  font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--leise);
  min-height: 28px; transition: all .15s; }
.chip:hover { border-color: var(--sehrleise); color: var(--text); }
.chip.an { background: var(--markehell); border-color: var(--marke2); color: var(--marke); font-weight: 600; }
.prio-chip { width: 30px; justify-content: center; font-weight: 700; padding: 3px 0; }
.prio-chip.an { color: #fff; border-color: transparent; }
.filter .mehrfilter { display: none; }
.filter .mehrfilter.offen { display: flex; }

/* ---------- Ticketzeilen */
.zeilen { overflow-y: auto; flex: 1; padding: 8px; }
.jetztdran { margin: 2px 0 10px; }
.jetztdran h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--p1); margin: 4px 6px 6px;
  display: flex; align-items: center; gap: 6px; }
.zeile { position: relative; display: grid; grid-template-columns: 5px 1fr; background: var(--flaeche);
  border-radius: var(--rund); box-shadow: var(--schatten); margin-bottom: 6px; cursor: pointer; overflow: hidden;
  transition: transform .12s, box-shadow .15s, background .15s; animation: einblenden .25s ease-out; }
.zeile:hover { box-shadow: 0 4px 14px rgba(16,24,40,.12); }
.zeile.gewaehlt { outline: 2px solid var(--marke2); }
.zeile.fertig { opacity: .6; }
.zeile.neu-markiert { animation: aufleuchten 1.6s ease-out; }
.zeile .balken { background: var(--p5); }
.zeile .inhalt { padding: 9px 12px 9px 11px; min-width: 0; }
.zeile .z1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.zeile .betreff { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; }
.zeile.ungelesen .betreff { font-weight: 750; }
.zeile.ungelesen::after { content: ""; position: absolute; right: 8px; top: 8px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--marke2); }
.zeile:hover .betreff.lang, .zeile.gewaehlt .betreff.lang { text-overflow: clip; }
.zeile:hover .betreff.lang span, .zeile.gewaehlt .betreff.lang span { display: inline-block; animation: laufen 9s linear infinite; }
.zeile .rest { font-size: 12px; font-weight: 600; color: var(--leise); white-space: nowrap; padding-right: 10px; }
.zeile .rest.knapp { color: var(--warn); }
.zeile .rest.ueber { color: var(--schlecht); }
.zeile .z2 { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--leise);
  flex-wrap: wrap; }
.zeile .z3 { margin-top: 3px; font-size: 12px; color: var(--sehrleise); overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; }
.zaehler { display: inline-flex; align-items: center; gap: 3px; }
.zaehler .symbol { width: 13px; height: 13px; }
.marke-zustand { border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600; background: var(--flaeche2);
  border: 1px solid var(--linie); color: var(--leise); }
.marke-zustand.z-neu { background: #e8f0fe; color: #1e4fb8; border-color: #c9dbfb; }
.marke-zustand.z-in_arbeit { background: #fff4e0; color: #8a4b00; border-color: #fbdca8; }
.marke-zustand.z-wartet { background: #f3eaff; color: #6b34b8; border-color: #e0cdfb; }
.marke-zustand.z-erledigt, .marke-zustand.z-geschlossen { background: var(--guthell); color: var(--gut); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  .marke-zustand.z-neu { background: #1a2a44; color: #9fc0ff; border-color: transparent; }
  .marke-zustand.z-in_arbeit { background: #3a2a10; color: #ffcf85; border-color: transparent; }
  .marke-zustand.z-wartet { background: #2d1f44; color: #d1b3ff; border-color: transparent; }
}
.kuerzel { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 10px;
  font-weight: 700; background: var(--markehell); color: var(--marke); margin-left: -4px; border: 2px solid var(--flaeche); }
.kuerzel:first-child { margin-left: 0; }
.uebernehmen { position: absolute; right: 10px; bottom: 8px; opacity: 0; transition: opacity .15s; }
.zeile:hover .uebernehmen, .zeile.gewaehlt .uebernehmen { opacity: 1; }
.baumknopf { border: 0; background: var(--flaeche2); border-radius: 6px; font-size: 11px; padding: 1px 6px; cursor: pointer;
  color: var(--leise); font-weight: 600; }
.kinder { margin: -2px 0 8px 18px; border-left: 2px solid var(--linie2); padding-left: 8px; }
.fortschritt { display: inline-block; width: 36px; height: 5px; background: var(--linie); border-radius: 3px; overflow: hidden;
  vertical-align: middle; }
.fortschritt i { display: block; height: 100%; background: var(--gut); }
.leer { text-align: center; padding: 48px 20px; color: var(--leise); }
.leer > svg { width: 120px; height: 120px; margin-bottom: 10px; }
.leer h3 { color: var(--text); margin: 6px 0; font-size: 18px; }
.p1 { --p: var(--p1); } .p2 { --p: var(--p2); } .p3 { --p: var(--p3); } .p4 { --p: var(--p4); }
.p5 { --p: var(--p5); } .p6 { --p: var(--p6); } .p7 { --p: var(--p7); }
.zeile .balken { background: var(--p); }
.zeile.p1:not(.fertig) .balken { animation: pulsbalken 1.8s ease-in-out infinite; }
.prio-chip.an { background: var(--p); }
.prio-punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--p); }

/* ---------- Ticketansicht */
.ticket { flex: 1; overflow-y: auto; min-width: 0; }
.ticket-kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); padding: 16px 22px 12px; position: sticky; top: 0; z-index: 5; }
.ticket-kopf .z1 { display: flex; gap: 10px; align-items: flex-start; }
.ticket-kopf h1 { font-size: 21px; margin: 0; flex: 1; line-height: 1.25; cursor: text; border-radius: 6px; padding: 2px 4px; margin-left: -4px; }
.ticket-kopf h1:hover { background: var(--flaeche2); }
.ticket-kopf .titelfeld { flex: 1; font-size: 19px; font-weight: 700; }
.ticket-kopf .nummer { font-size: 12px; color: var(--sehrleise); margin-top: 2px; }
.zurueck { display: none; }
.leiste { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.feld { display: flex; flex-direction: column; gap: 2px; background: var(--flaeche2); border: 1px solid var(--linie);
  border-radius: 9px; padding: 5px 9px; min-width: 0; }
.feld > span { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--sehrleise); font-weight: 600; }
.feld select { border: 0; background: transparent; padding: 0; min-height: 22px; font-weight: 600; box-shadow: none; }
.feld .wert { font-weight: 600; font-size: 13px; white-space: nowrap; }
.feld.prio { border-left: 4px solid var(--p); }
.feld .chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.minichip { display: inline-flex; align-items: center; gap: 4px; background: var(--flaeche); border: 1px solid var(--linie2);
  border-radius: 12px; padding: 1px 4px 1px 8px; font-size: 12px; font-weight: 600; }
.minichip button { border: 0; background: transparent; cursor: pointer; color: var(--sehrleise); padding: 0 3px; font-size: 14px; line-height: 1; }
.minichip button:hover { color: var(--schlecht); }
.plus { border: 1px dashed var(--linie2); background: transparent; border-radius: 12px; font-size: 12px; padding: 1px 8px;
  cursor: pointer; color: var(--leise); }
.plus:hover { border-color: var(--marke2); color: var(--marke); }
.zustaende { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.aktionen { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.reiter { display: flex; gap: 2px; padding: 0 18px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
  overflow-x: auto; position: sticky; z-index: 4; }
.reiter button { border: 0; background: transparent; padding: 11px 12px; cursor: pointer; color: var(--leise); font-weight: 600;
  border-bottom: 2px solid transparent; white-space: nowrap; }
.reiter button.an { color: var(--marke); border-bottom-color: var(--marke); }
.reiter .anz { background: var(--flaeche2); border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
.bereich { padding: 18px 22px 40px; max-width: 980px; }
.eltern-hinweis { font-size: 13px; color: var(--leise); margin-top: 8px; }
.eltern-hinweis a { cursor: pointer; font-weight: 600; }

/* Notizen */
.notiz { background: var(--flaeche); border-radius: var(--rund2); box-shadow: var(--schatten); padding: 12px 16px; margin-bottom: 12px;
  animation: einblenden .25s ease-out; }
.notiz.privat { border: 1px dashed var(--akzent); }
.notiz .kopf { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--leise); margin-bottom: 6px; }
.notiz .kopf b { color: var(--text); font-size: 13px; }
.notiz .kopf .rechts { margin-left: auto; display: flex; gap: 4px; }
.notiz .text { overflow-wrap: anywhere; }
.notiz .text p { margin: 0 0 8px; } .notiz .text p:last-child { margin-bottom: 0; }
.fassungen { margin-top: 10px; border-top: 1px dashed var(--linie2); padding-top: 8px; font-size: 13px; }
.fassungen .alt { color: var(--leise); margin-bottom: 8px; }
.marke-klein { font-size: 11px; border-radius: 8px; padding: 0 6px; background: var(--flaeche2); border: 1px solid var(--linie); }
.marke-klein.privat { background: #fff7e6; border-color: #f7d48c; color: #8a5a00; }
mark { border-radius: 3px; padding: 0 2px; color: inherit; background: var(--gelb); }
mark[data-farbe="rot"] { background: var(--rot); } mark[data-farbe="gruen"] { background: var(--gruen); }

/* Editor */
.editor { background: var(--flaeche); border: 1px solid var(--linie2); border-radius: var(--rund2); overflow: hidden;
  transition: box-shadow .15s, border-color .15s; }
.editor:focus-within { border-color: var(--marke2); box-shadow: 0 0 0 3px var(--markehell); }
.werkzeuge { display: flex; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--linie); background: var(--flaeche2); flex-wrap: wrap; }
.werkzeuge button { border: 0; background: transparent; border-radius: 6px; min-width: 30px; height: 30px; cursor: pointer;
  font-weight: 700; color: var(--leise); }
.werkzeuge button:hover { background: var(--flaeche); color: var(--text); }
.werkzeuge .farbe { width: 22px; min-width: 22px; height: 22px; border-radius: 50%; margin: 4px 2px; border: 2px solid var(--flaeche); box-shadow: 0 0 0 1px var(--linie2); }
.werkzeuge select { min-height: 30px; height: 30px; padding: 2px 6px; font-size: 13px; border-radius: 6px; margin-right: 4px; }
.werkzeuge .pfeil { min-width: 18px; padding: 0 2px; font-size: 11px; }
.werkzeuge .farbe:hover { transform: scale(1.15); }
.schriftknopf { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; font-weight: 800; }
.farbbalken { display: block; width: 16px; height: 4px; border-radius: 2px; margin-top: 2px; }
.farbwahl { position: fixed; z-index: 60; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  box-shadow: var(--schatten2); padding: 10px; animation: blende .1s; }
.farbwahl .farbtitel { font-size: 11px; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.matrix { display: grid; grid-template-columns: repeat(10, 22px); gap: 3px; }
.matrix button { width: 22px; height: 22px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); cursor: pointer; padding: 0; }
.matrix button:hover { transform: scale(1.25); box-shadow: 0 2px 6px rgba(0,0,0,.3); position: relative; z-index: 1; }
.farbwahl .ohne { margin-top: 8px; width: 100%; border: 1px solid var(--linie2); background: var(--flaeche); border-radius: 6px; padding: 4px; cursor: pointer; font-size: 12px; }
/* eingefuegte Inhalte: Layout wie im Original, aber nie breiter als die Spalte */
.notiz .text, .schreibfeld { overflow-x: auto; }
.notiz .text img, .schreibfeld img { max-width: 100%; height: auto; }
.notiz .text table, .schreibfeld table { max-width: 100%; }
.notiz .text h1, .schreibfeld h1 { font-size: 1.7em; margin: .4em 0; } .notiz .text h2, .schreibfeld h2 { font-size: 1.45em; margin: .4em 0; }
.notiz .text h3, .schreibfeld h3 { font-size: 1.25em; margin: .4em 0; } .notiz .text h4, .schreibfeld h4 { font-size: 1.1em; margin: .4em 0; }
.notiz .text h5, .schreibfeld h5 { font-size: 1em; margin: .4em 0; }
.notiz .text blockquote, .schreibfeld blockquote { border-left: 3px solid var(--linie2); margin: .5em 0; padding-left: 12px; color: var(--leise); }
.notiz .text pre, .schreibfeld pre { background: var(--flaeche2); padding: 8px 10px; border-radius: 6px; white-space: pre-wrap; }
.werkzeuge .trenner { width: 1px; background: var(--linie2); margin: 4px 4px; }
.schreibfeld { min-height: 90px; max-height: 50vh; overflow-y: auto; padding: 10px 14px; outline: none; overflow-wrap: anywhere; }
.schreibfeld:empty::before { content: attr(data-platzhalter); color: var(--sehrleise); }
.schreibfeld p { margin: 0 0 6px; }
.editor .fuss { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--linie); font-size: 13px; }
.editor .fuss .rechts { margin-left: auto; display: flex; gap: 6px; }
.schalter { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--leise); user-select: none; }

/* Chat */
.chatspalte { width: 340px; flex: none; border-left: 1px solid var(--linie); background: var(--flaeche); display: flex; flex-direction: column; }
.chatspalte h3 { margin: 0; padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--linie); display: flex; align-items: center; gap: 8px; }
.chatverlauf { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.blase { max-width: 85%; background: var(--flaeche2); border: 1px solid var(--linie); border-radius: 14px 14px 14px 4px;
  padding: 7px 11px; animation: einblenden .2s ease-out; overflow-wrap: anywhere; }
.blase.ich { align-self: flex-end; background: var(--markehell); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.blase .wer { font-size: 11px; color: var(--leise); font-weight: 600; margin-bottom: 2px; }
.chateingabe { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--linie); }
.chateingabe input { flex: 1; }

/* Anhaenge */
.ablage { border: 2px dashed var(--linie2); border-radius: var(--rund2); padding: 20px; text-align: center; color: var(--leise);
  margin-bottom: 16px; transition: all .15s; cursor: pointer; }
.ablage.drueber { border-color: var(--marke2); background: var(--markehell); color: var(--marke); }
.anhaenge { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.anhang { background: var(--flaeche); border-radius: var(--rund); box-shadow: var(--schatten); overflow: hidden; text-decoration: none;
  color: var(--text); display: flex; flex-direction: column; }
.anhang .vorschau { height: 110px; background: var(--flaeche2); display: grid; place-items: center; overflow: hidden; color: var(--sehrleise); }
.anhang .vorschau img { width: 100%; height: 100%; object-fit: cover; }
.anhang .vorschau .typ { font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.anhang .info { padding: 8px 10px; font-size: 12px; }
.anhang .info b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anhang .info span { color: var(--leise); }

/* Listen in Bereichen */
.tabelle { width: 100%; border-collapse: collapse; background: var(--flaeche); border-radius: var(--rund); overflow: hidden; box-shadow: var(--schatten); }
.tabelle th, .tabelle td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--linie); font-size: 13px; vertical-align: top; }
.tabelle th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--sehrleise); background: var(--flaeche2); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tr.klickbar { cursor: pointer; } .tabelle tr.klickbar:hover td { background: var(--flaeche2); }
.verlauf li { margin-bottom: 8px; font-size: 13px; } .verlauf li span { color: var(--leise); }
.formular { display: grid; gap: 12px; }
.formular label { font-weight: 600; font-size: 13px; display: flex; flex-direction: column; gap: 5px; }
.formular .zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kasten { background: var(--flaeche); border-radius: var(--rund2); box-shadow: var(--schatten); padding: 16px 18px; margin-bottom: 16px; }
.kasten h3 { margin: 0 0 12px; font-size: 15px; }
.seitenkopf { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seitenkopf h2 { margin: 0; font-size: 20px; }
.summe { font-size: 28px; font-weight: 800; color: var(--marke); }

/* Prioritaetswahl im Dialog */
.prioritaeten { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.prioritaeten button { border: 2px solid var(--linie); background: var(--flaeche); border-radius: 10px; padding: 8px 2px 6px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--leise); }
.prioritaeten button b { font-size: 17px; color: var(--p); }
.prioritaeten button.an { border-color: var(--p); background: var(--p); color: #fff; }
.prioritaeten button.an b { color: #fff; }

/* Dialoge, Schubladen, Meldungen */
.schleier { position: fixed; inset: 0; background: rgba(15,20,25,.45); z-index: 50; display: grid; place-items: center; padding: 16px;
  animation: blende .15s ease-out; }
.dialog { background: var(--flaeche); border-radius: 16px; box-shadow: var(--schatten2); width: 100%; max-width: 640px;
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; animation: hoch .2s ease-out; }
.dialog.schmal { max-width: 420px; }
.dialog .dkopf { padding: 16px 20px; border-bottom: 1px solid var(--linie); display: flex; align-items: center; }
.dialog .dkopf h2 { margin: 0; font-size: 17px; flex: 1; }
.dialog .dinhalt { padding: 18px 20px; overflow-y: auto; }
.dialog .dfuss { padding: 12px 20px; border-top: 1px solid var(--linie); display: flex; gap: 8px; justify-content: flex-end; }
.auswahl { position: fixed; z-index: 60; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 10px;
  box-shadow: var(--schatten2); min-width: 220px; max-height: 320px; overflow-y: auto; padding: 4px; animation: blende .1s; }
.auswahl input { width: calc(100% - 8px); margin: 4px; }
.auswahl button { display: flex; width: 100%; border: 0; background: transparent; padding: 7px 10px; text-align: left; cursor: pointer;
  border-radius: 6px; gap: 8px; align-items: center; }
.auswahl button:hover, .auswahl button.fokus { background: var(--flaeche2); }
.schublade { position: fixed; top: 56px; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--flaeche);
  box-shadow: var(--schatten2); z-index: 40; display: flex; flex-direction: column; animation: rein .2s ease-out; }
.schublade h3 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--linie); display: flex; align-items: center; }
.schublade h3 .knopf { margin-left: auto; }
.feed { overflow-y: auto; flex: 1; padding: 8px; }
.ereignis { display: flex; gap: 10px; padding: 9px 8px; border-radius: 8px; cursor: pointer; }
.ereignis:hover { background: var(--flaeche2); }
.ereignis .was { font-size: 13px; min-width: 0; }
.ereignis .was b { font-weight: 600; }
.ereignis .was div { color: var(--leise); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ereignis .wann { font-size: 11px; color: var(--sehrleise); white-space: nowrap; margin-left: auto; }
#meldungen { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column;
  gap: 8px; align-items: center; pointer-events: none; }
.meldung { background: #1d2733; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--schatten2); font-weight: 500;
  animation: hoch .2s ease-out; display: flex; gap: 8px; align-items: center; }
.meldung.fehler { background: var(--schlecht); }
.meldung.gut::before { content: "✓"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gut); font-weight: 800; animation: knall .35s ease-out; }
.menue { position: absolute; right: 12px; top: 52px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 12px;
  box-shadow: var(--schatten2); min-width: 220px; padding: 6px; z-index: 45; animation: blende .12s; }
.menue .wer { padding: 8px 10px 10px; border-bottom: 1px solid var(--linie); margin-bottom: 4px; font-size: 13px; }
.menue .wer small { color: var(--leise); display: block; }
.menue button { display: flex; width: 100%; gap: 10px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px;
  cursor: pointer; text-align: left; align-items: center; }
.menue button:hover { background: var(--flaeche2); }

/* ---------- Kleinigkeiten */
.leise { color: var(--leise); font-size: 13px; }
.abstand { flex: 1; }
.abstand-oben { height: 14px; }
.fuellen { flex: 1; min-width: 0; }
.reihe { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.knopf.an { color: var(--marke); }
.haupt.voll { grid-template-columns: 236px 1fr; }
.haupt.voll .liste { display: none; }
.rest.knapp { color: var(--warn); } .rest.ueber { color: var(--schlecht); }

/* ---------- Bewegung (sparsam, mit Zweck) */
@keyframes einblenden { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes hoch { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes blende { from { opacity: 0; } to { opacity: 1; } }
@keyframes rein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes puls { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .7; } }
@keyframes pulsbalken { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes aufleuchten { 0% { background: var(--markehell); } 100% { background: var(--flaeche); } }
@keyframes knall { 0% { transform: scale(.3); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes laufen { 0%, 15% { transform: translateX(0); } 85%, 100% { transform: translateX(var(--weite, -50%)); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Schmalere Bildschirme */
@media (max-width: 1500px) { .chatspalte { display: none; } }
@media (max-width: 1100px) {
  .haupt { grid-template-columns: minmax(300px, 400px) 1fr; }
  .seite { position: fixed; top: 56px; left: 0; bottom: 0; width: 270px; z-index: 30; box-shadow: var(--schatten2);
    transform: translateX(-105%); transition: transform .2s; }
  .seite.offen { transform: none; }
  .menuknopf { display: inline-flex; }
  .haupt.voll { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .oben { gap: 6px; padding: 0 8px; }
  .oben .marke span { display: none; }
  .oben .neu-text { display: none; }
  .haupt { grid-template-columns: 1fr; }
  .liste { border-right: 0; }
  .detail { position: fixed; inset: 56px 0 0 0; z-index: 25; transform: translateX(100%); transition: transform .22s ease-out; }
  .detail.offen { transform: none; }
  .zurueck { display: inline-flex; }
  .ticket-kopf { padding: 12px 14px 10px; position: static; }
  .reiter { top: 0 !important; }
  .leiste .feld { flex: 1 1 calc(50% - 8px); }
  .leiste .feld.prio, .leiste .feld:nth-child(2) { flex-basis: 100%; }
  .ticket-kopf h1 { font-size: 18px; }
  .bereich { padding: 14px 12px 40px; }
  .reiter { padding: 0 6px; }
  .uebernehmen { opacity: 1; position: static; margin-top: 6px; }
  .formular .zwei { grid-template-columns: 1fr; }
  .prioritaeten { grid-template-columns: repeat(4, 1fr); }
  .dialog { max-height: calc(100vh - 16px); }
  .schleier { padding: 8px; align-items: end; }
  .tabelle th:nth-child(n+4), .tabelle td:nth-child(n+4) { display: none; }
}
