/* Ticketsystem - duenne Eigenschicht ueber dem Tool-Kit.
   Regel: nur Kit-Tokens, kein Hex, keine harten Groessen (REGELN.md §4).
   Alles, was das Kit schon kann (Shell, Tabelle, Chip, Button, Typo), kommt von dort. */

/* ---- Formularfelder: das Kit hat nur die Suchzeile ---------------------- */
.feld,
.auswahl,
textarea.feld {
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: .55em .7em;
  transition: box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
textarea.feld { min-height: 7em; resize: vertical; line-height: 1.55; }
.feld:focus, .auswahl:focus, textarea.feld:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.feld::placeholder { color: var(--subtle); }

/* ---- Filterleiste ------------------------------------------------------- */
.filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}
.filter .wachst { flex: 1 1 14rem; min-width: 0; }
.filter .auswahl { width: auto; }

/* Projektwahl als Reiter-Reihe: waagerecht scrollbar, nichts verschwindet (§4b). */
.projektleiste {
  display: flex;
  gap: .35rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: .15rem;
  margin-bottom: .85rem;
  border-bottom: 1px solid var(--border);
}
.projektleiste::-webkit-scrollbar { display: none; }
.pw {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  padding: .5em .8em;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.pw:hover { color: var(--text); background: var(--sunken); }
.pw[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.pw .zahl {
  min-width: 1.5em;
  padding: 0 .4em;
  border-radius: var(--radius-pill);
  background: var(--neutral-bg);
  color: var(--muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.pw[aria-selected="true"] .zahl { background: var(--accent-soft); color: var(--accent-strong); }

/* ---- Tabelle: Zeilen sind anklickbar ------------------------------------ */
tbody tr.klick { cursor: pointer; }
tbody tr.klick:hover { background: var(--sunken); }
td .vorschau { display: block; max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeitspalte { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Leerzustand -------------------------------------------------------- */
.leer { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.leer svg { width: 2.5rem; height: 2.5rem; stroke: var(--subtle); margin-bottom: .75rem; }

/* ---- Detailansicht ------------------------------------------------------ */
.zweispalt { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: 1rem; align-items: start; }
@media (max-width: 880px) { .zweispalt { grid-template-columns: minmax(0, 1fr); } }

.tickettext {
  font-size: var(--text-md);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.daten { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem .9rem; font-size: var(--text-sm); }
.daten dt { color: var(--muted); }
.daten dd { margin: 0; overflow-wrap: anywhere; }
.daten a { color: var(--accent-strong); }

.verlauf { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.verlauf li { font-size: var(--text-sm); line-height: 1.5; }
.verlauf .zeit { display: block; color: var(--subtle); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.verlauf .wer { color: var(--muted); }

.antwortkasten { display: grid; gap: .6rem; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.knopfreihe .rechts { margin-left: auto; }

.hinweis { font-size: var(--text-sm); color: var(--muted); }
.hinweis.warnung { color: var(--warn); }

/* ---- Anmeldung ---------------------------------------------------------- */
.tor { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: var(--bg); }
.torkasten { width: min(23rem, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 1.75rem; display: grid; gap: .9rem; }
.torkopf { display: flex; align-items: center; gap: .6rem; }
.torkopf .logo { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent-strong); color: var(--on-accent); }
.torkopf .logo svg { width: 1.15rem; height: 1.15rem; }
.fehler { font-size: var(--text-sm); color: var(--bad); }

/* ---- Bauteile der Detailansicht (statt Inline-Stilen) ------------------- */
.stapel { display: grid; gap: 1rem; align-content: start; }
.panel.gepolstert { padding: 1.1rem; }
.panelhd.nackt { padding: 0 0 .8rem; }
