/* Tickets – Stylesheet für beide Serviceportale. Diese Datei liegt BYTEGLEICH in service/ und kalkulation-369/.
   Bewusst ohne eine einzige feste Farbe: Alles kommt aus den gemeinsamen Farbnamen (design-tokens.css bzw. design-tokens-369.css),
   deshalb stimmen Firmenfarbe und dunkle Ansicht in beiden Portalen von selbst. Knöpfe und Filter nutzen .btn, .btn.sec und .chip des Portals.
   Eigene Klassen beginnen mit „tk-“.
   Farben der Stände (fest, in beiden Portalen gleich): Neu grau · In Bearbeitung gelb (liegt bei uns) · Wartet und Wiedervorlage blau (liegt bei anderen
   bzw. später) · fällige Wiedervorlage rot · Erledigt grün. */
.tk { display: grid; gap: 14px; color: var(--text); }
.tk-nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tk-leise { color: var(--text-leise); font-weight: 400; }
.tk .hinweis { color: var(--text-leise); }
.tk .fehler { color: var(--bad-text); background: var(--bad-bg); padding: 8px 12px; border-radius: 8px; }
.tk .link, .tk-karte .link { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }
/* Tastatur-Markierung in der Hauptfarbe: gemessen in beiden Portalen hell und dunkel mindestens 4,5 zu 1 gegen Seite und Karte (Orange lag hell bei 2,5) */
.tk :focus-visible, .tk-karte :focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
/* Das Dunkel-Stylesheet des 369-Portals gibt Eingabefeldern einen Fokusring fast in Kartenfarbe (gemessen 1,29:1 im echten Edge, 18.11.2026);
   seine Regel (:root[data-theme="dark"] input:focus) ist spezifischer als die obere – in den Tickets bleibt der Ring deshalb hier ausdrücklich in der Hauptfarbe */
:root[data-theme="dark"] .tk :is(input, textarea, select):focus-visible, :root[data-theme="dark"] .tk-karte :is(input, textarea, select):focus-visible { outline: 2px solid var(--primaer); outline-offset: 2px; }
.tk input[type="text"], .tk input[type="search"], .tk input[type="tel"], .tk input[type="email"], .tk input[type="date"], .tk input[type="time"], .tk input:not([type]), .tk select, .tk textarea {
  box-sizing: border-box; width: 100%; min-height: var(--ziel); font: inherit; color: var(--text); background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; padding: 8px 10px; }
.tk textarea { min-height: 84px; resize: vertical; }

/* Kopf der Liste: Filter links, Suche und „Neues Ticket“ rechts */
.tk-kopf { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.tk-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-werkzeug { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-suche { display: block; min-width: min(320px, 70vw); }
.tk-zahl { display: inline-block; min-width: 1.4em; padding: 0 .45em; border-radius: 999px; background: var(--neutral-bg); color: var(--neutral-text); font-size: .82em; font-weight: 600; text-align: center; }
.tk-zahl-rot { background: var(--bad-bg); color: var(--bad-text); }

/* Zeilen der Liste */
.tk-liste { display: grid; gap: 8px; }
.tk-zeile { display: grid; gap: 4px; padding: 10px 14px; background: var(--karte); border: 1px solid var(--linie); border-left: 4px solid var(--linie); border-radius: var(--radius); cursor: pointer; }
.tk-zeile:hover { border-color: var(--text-leise); }
.tk-zeile > * { min-width: 0; }
.tk-z-kunde { overflow-wrap: anywhere; }   /* lange Absenderadressen ohne Trennstelle sprengen sonst am Handy die Zeile */
.tk-dringend { border-left-color: var(--bad-text); }
.tk-z-kopf { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .86rem; }
.tk-nr { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-leise); }
.tk-typ { color: var(--text-leise); }
.tk-z-betreff { appearance: none; background: none; border: 0; padding: 0; margin: 0; min-height: 24px; font: inherit; font-size: 1.02rem; color: var(--text); text-align: left; cursor: pointer; }
.tk-z-betreff:hover { text-decoration: underline; }
.tk-ungelesen .tk-z-betreff { font-weight: 700; }
.tk-z-fuss { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .86rem; color: var(--text-leise); }
.tk-z-wer { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-wer { font-weight: 600; color: var(--text); }
.tk-frei { font-weight: 400; color: var(--text-leise); }
.tk-da, .tk-hinweis-da { background: var(--warn-bg); color: var(--warn-text); font-weight: 600; }
.tk-da { padding: 1px 9px; border-radius: 999px; }
.tk-leer { margin: 0; padding: 24px; text-align: center; color: var(--text-leise); background: var(--karte); border: 1px dashed var(--linie); border-radius: var(--radius); }

/* Schilder: Stand, Dringlichkeit, neue Antwort */
.tk-st, .tk-prio, .tk-antwort { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.tk-st-neu { background: var(--neutral-bg); color: var(--neutral-text); }
.tk-st-offen { background: var(--warn-bg); color: var(--warn-text); }
.tk-st-wartet, .tk-st-wv, .tk-antwort { background: var(--info-bg); color: var(--info-text); }
.tk-st-faellig, .tk-prio-1 { background: var(--bad-bg); color: var(--bad-text); }
.tk-st-erledigt { background: var(--ok-bg); color: var(--ok-text); }
.tk-prio-2 { background: var(--warn-bg); color: var(--warn-text); }

/* Papierkorb: gleiche Karten wie die Liste, aber nicht anklickbar – dort gibt es nur „Zurückholen“ */
.tk-korb-link { margin: 12px 0 0; text-align: right; }
.tk-korb-titel { margin: 12px 0 4px; font-size: 1.15rem; }
.tk-korbzeile { cursor: default; }
.tk-korbzeile:hover { border-color: var(--linie); }
.tk-korb-betreff { font-size: 1.02rem; color: var(--text); }

/* Ticket */
.tk-ticket, .tk-neu { max-width: 860px; }
.tk-zurueck, .tk-t-wer { margin: 0; }
.tk-t-betreff { margin: 4px 0; font-size: 1.3rem; line-height: 1.25; }
.tk-t-wer { color: var(--text-leise); font-size: .92rem; }
.tk-t-wer b { color: var(--text); }
.tk-hinweis-da, .tk-hinweis-neu { margin: 0; padding: 8px 12px; border-radius: var(--radius); }
.tk-hinweis-neu { background: var(--info-bg); color: var(--info-text); font-weight: 600; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tk-stand, .tk-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; }
.tk-knoepfe { margin: 8px 0 0; }
.tk-kasten, .tk-wv { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; }
.tk-kasten h3 { margin: 0 0 6px; font-size: 1rem; }
.tk-kasten p { margin: 0 0 6px; }
.tk-kasten > summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.tk-wv { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.tk-wv[hidden] { display: none; }
.tk-wv label, .tk-mehr label, .tk-feld { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.tk-feld small { font-weight: 400; }
.tk-anliegen { white-space: normal; overflow-wrap: anywhere; }
/* Interne Notiz: gelblich abgesetzt, damit niemand sie mit der Antwort an den Kunden verwechselt */
.tk-notiz, .tk-v-notiz { background: var(--warn-bg); border-color: var(--warn-bg); }
.tk-notiz .tk-leise, .tk-v-notiz .tk-v-kopf { color: var(--warn-text); }

/* Verlauf */
.tk-verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tk-v { padding: 8px 10px; border: 1px solid var(--linie); border-radius: 10px; overflow-wrap: anywhere; }
.tk-v-klein { padding: 2px 0; border: 0; font-size: .88rem; color: var(--text-leise); }
.tk-v-kopf, .tk-v-betreff { font-size: .86rem; color: var(--text-leise); }
.tk-v-marke { font-weight: 700; color: var(--text); }
.tk-v-notiz .tk-v-marke { color: var(--warn-text); }
.tk-v-ein { border-left: 4px solid var(--info-text); }

/* Abhak-Liste */
.tk-cl { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 2px; }
.tk-c { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: var(--ziel); }
.tk-c label { display: flex; flex: 1; gap: 10px; align-items: center; cursor: pointer; min-height: var(--ziel); }
.tk-c input[type="checkbox"] { width: 24px; height: 24px; flex: none; }
.tk-kunde a { display: inline-block; min-height: 24px; line-height: 24px; color: inherit; }
.tk-c-ok span { text-decoration: line-through; color: var(--text-leise); }
.tk-c small { color: var(--text-leise); }
.tk-c-weg { appearance: none; border: 0; background: none; color: var(--text-leise); min-width: 36px; min-height: 36px; border-radius: 8px; font: inherit; cursor: pointer; }
.tk-c-weg:hover { color: var(--bad-text); background: var(--bad-bg); }
.tk-c-neu { display: flex; gap: 8px; align-items: center; }
.tk-mehr { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 8px; }
.tk-mehr-rk { flex: 1 1 100%; display: grid; gap: 6px; }   /* Stufe 3i: Reklamationsfall hinter „Mehr“ in eigener Zeile */
.tk-mehr-rk .tk-knoepfe { margin: 0; }
.tk-vg, .tk-k-liste { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }

/* Neues Ticket */
.tk-neu form { display: grid; gap: 14px; }
.tk-neu h2 { margin: 0; }
.tk-zweispalt { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tk-wahl { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tk-wahl legend { padding: 0; margin-bottom: 6px; font-size: .9rem; font-weight: 600; }
.tk-wahl label { cursor: pointer; }
.tk-wahl input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tk-wahl label:focus-within { outline: 2px solid var(--primaer); outline-offset: 2px; }
.tk-vorschlaege { display: grid; gap: 4px; margin-top: 4px; }
.tk-vorschlag { appearance: none; min-height: var(--ziel); padding: 8px 10px; font: inherit; text-align: left; color: var(--text); background: var(--karte); border: 1px solid var(--linie); border-radius: 8px; cursor: pointer; }
.tk-vorschlag:hover { border-color: var(--text); }

/* Stufe 2 – Antwort an den Kunden: blau abgesetzt (wie „E-Mail vom Kunden“ im Verlauf), die interne Notiz bleibt gelb. Umschalten über zwei Reiter. */
.tk-reiter { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-antwortform { display: grid; gap: 8px; border-left: 4px solid var(--info-text); }
.tk-antwortform[hidden] { display: none; }
.tk-antwortform h3, .tk-antwortform p { margin: 0; }
.tk-haken { display: flex; gap: 10px; align-items: center; min-height: var(--ziel); font-weight: 400; cursor: pointer; }
.tk-haken input[type="checkbox"] { width: 24px; height: 24px; flex: none; margin: 0; }
/* Vorschläge „Neue Mails ohne Ticket“ und ihre Einstellung */
.tk-mailzeile { cursor: default; border-left-color: var(--info-text); }
.tk-mailzeile:hover { border-color: var(--linie); border-left-color: var(--info-text); }
.tk-vorschau { margin: 0; font-size: .9rem; color: var(--text-leise); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tk-mail-fertig { background: var(--ok-bg); border-color: var(--ok-bg); border-left-color: var(--ok-text); }
.tk-mail-fertig:hover { border-color: var(--ok-bg); border-left-color: var(--ok-text); }
.tk-mail-fertig .tk-z-kunde { color: var(--ok-text); }
.tk-einst { display: grid; gap: 8px; }
.tk-einst p { margin: 0; }
.tk-postfaecher { margin: 0; padding: 8px 12px; border: 1px solid var(--linie); border-radius: 8px; }
.tk-postfaecher legend { padding: 0 4px; font-size: .9rem; font-weight: 600; }

@media (max-width: 700px) {
  .tk-zweispalt { grid-template-columns: 1fr; }
  .tk-werkzeug, .tk-suche { width: 100%; min-width: 0; }
  .tk-werkzeug .btn { flex: 1; }
  .tk-z-wer { margin-left: 0; width: 100%; }
  .tk-stand .btn { flex: 1 1 46%; }
  .tk-c-neu { flex-wrap: wrap; }
  .tk-reiter .chip { flex: 1; }
}
