/* =============================================================================
   tickets.css  –  Hilfe & Feedback und Ticket-Desk (js/tickets.js)
   Nur Variablen aus style.css, damit Hell/Dunkel ohne Zusatzregeln passt.
   ============================================================================= */

/* ── Badges im Menue ─────────────────────────────────────────────────────── */
.nav-badge.tk-badge { background: var(--accent); color: #fff; box-shadow: 0 0 10px rgba(232,66,10,.45); }
.nav-badge.tk-badge[hidden], .tk-menu-dot[hidden] { display: none !important; }
.nav-badge.tk-badge:not([hidden]) { animation: tk-pop .35s ease-out; }
@keyframes tk-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.tk-menu-dot {
  position: absolute; top: 2px; right: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg-base);
}

/* ── Grundgeruest ────────────────────────────────────────────────────────── */
.tk-wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.tk-wrap.tk-wide { max-width: 1280px; }
.tk-card .card-head { gap: 12px; }
.tk-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tk-loading { padding: 28px; text-align: center; color: var(--text-2); }
.tk-hint { font-size: 12px; color: var(--text-2); }
.tk-hint i { color: var(--accent2); margin-right: 3px; }
.tk-hint-box { padding: 10px 12px; border-radius: 10px; background: var(--accent2-dim); border: 1px solid var(--border); color: var(--text-1); }
.tk-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tk-actions-right { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.tk-textarea { resize: vertical; min-height: 80px; line-height: 1.5; font-family: inherit; }
.tk-back {
  background: none; border: none; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
}
.tk-back:hover { color: var(--accent); }
.tk-link { background: none; border: none; padding: 0; color: var(--accent2); cursor: pointer; font-size: inherit; }
.tk-full { width: 100%; justify-content: center; }
.tk-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-1); cursor: pointer; }
.tk-check small { color: var(--text-3); }

/* ── Kopf "Hilfe & Feedback" ─────────────────────────────────────────────── */
.tk-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px;
  background: linear-gradient(135deg, var(--accent-dim), var(--accent2-dim)), var(--bg-card2);
}
.tk-h1 { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.tk-h1 i { color: var(--accent); }
.tk-hero p { margin: 6px 0 0; color: var(--text-2); font-size: 13px; max-width: 560px; }

/* ── Listen ──────────────────────────────────────────────────────────────── */
.tk-list { display: flex; flex-direction: column; }
.tk-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 20px; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text-1); cursor: pointer;
  font: inherit; transition: background .15s;
}
.tk-row:last-child { border-bottom: none; }
.tk-row:hover { background: var(--bg-hover); }
.tk-row.tk-unread { box-shadow: inset 3px 0 0 var(--accent); }
.tk-row.tk-unread .tk-row-title { font-weight: 800; }
.tk-cat { font-size: 20px; line-height: 1; flex-shrink: 0; }
.tk-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tk-row-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-row-meta { font-size: 12px; color: var(--text-2); }
.tk-row-meta b { color: var(--text-1); font-weight: 600; }
.tk-warn { color: var(--warning); font-weight: 600; }
.tk-new-pill {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent); color: #fff;
}
.tk-lang {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: 2px;
  background: var(--accent2-dim); color: var(--accent2); letter-spacing: .3px;
}
.tk-empty { padding: 36px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text-2); text-align: center; }
.tk-empty i { font-size: 30px; color: var(--accent2); }
.tk-empty b { color: var(--text-1); }

/* ── Status-Chips ────────────────────────────────────────────────────────── */
.tk-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; border: 1px solid transparent; }
.tk-st-open     { background: var(--accent-dim);  color: var(--accent); border-color: rgba(232,66,10,.35); }
.tk-st-progress { background: var(--accent2-dim); color: var(--accent2); }
.tk-st-waiting  { background: rgba(255,167,38,.13); color: var(--warning); }
.tk-st-resolved { background: rgba(0,230,118,.12); color: var(--success); }
.tk-st-closed   { background: var(--bg-hover); color: var(--text-2); }
.tk-head-chips { display: flex; gap: 6px; }

/* ── Neues Ticket ────────────────────────────────────────────────────────── */
.tk-cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tk-cat-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; text-align: left;
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-1);
  cursor: pointer; font: inherit; transition: border-color .15s, background .15s, transform .15s;
}
.tk-cat-card:hover { border-color: var(--border-md); transform: translateY(-1px); }
.tk-cat-card.active { border-color: var(--accent); background: var(--accent-dim); box-shadow: var(--glow-accent); }
.tk-cat-ico { font-size: 22px; }
.tk-cat-card b { font-size: 13px; }
.tk-cat-card small { font-size: 11px; color: var(--text-2); line-height: 1.35; }

/* ── Verlauf ─────────────────────────────────────────────────────────────── */
.tk-subject { font-size: 17px; font-weight: 800; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.tk-thread { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.tk-msg {
  max-width: 82%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-hover); overflow-wrap: anywhere;
}
.tk-msg-own   { align-self: flex-end; background: var(--accent-dim); border-color: rgba(232,66,10,.25); border-bottom-right-radius: 4px; }
.tk-msg-staff { align-self: flex-start; background: var(--accent2-dim); border-color: rgba(0,200,240,.22); border-bottom-left-radius: 4px; }
.tk-msg-note  { align-self: stretch; max-width: none; background: rgba(255,167,38,.10); border: 1px dashed rgba(255,167,38,.5); }
.tk-msg-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.tk-msg-head span { margin-left: auto; padding-left: 12px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.tk-msg-staff .tk-msg-head i { color: var(--accent2); }
.tk-msg-note .tk-msg-head i { color: var(--warning); }
.tk-msg-body { font-size: 14px; line-height: 1.55; color: var(--text-1); }
.tk-tr-toggle {
  margin-top: 6px; background: none; border: none; padding: 0; cursor: pointer;
  font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px;
}
.tk-tr-toggle:hover { color: var(--accent2); }

/* ── Antworten ───────────────────────────────────────────────────────────── */
.tk-compose { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.tk-compose-note .tk-textarea { border-color: rgba(255,167,38,.5); background: rgba(255,167,38,.06); }
.tk-compose-opts { display: flex; flex-direction: column; gap: 6px; }
.tk-preview { padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--accent2); background: var(--accent2-dim); }
.tk-preview .tk-hint { margin-bottom: 4px; font-weight: 600; }
.tk-after { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.tk-after .form-control { width: auto; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }

/* ── Ticket-Desk ─────────────────────────────────────────────────────────── */
.tk-desk-bar { display: flex; flex-direction: column; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.tk-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-filter {
  background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-2); border-radius: 18px;
  padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.tk-filter span { opacity: .75; margin-left: 2px; }
.tk-filter:hover { color: var(--text-1); border-color: var(--border-md); }
.tk-filter.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.tk-desk-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tk-search { flex: 1; min-width: 200px; }
.tk-desk-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.tk-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; }
.tk-side-body { gap: 8px; }
.tk-side-body .form-label { margin: 4px 0 0; }
.tk-facts > div { display: flex; flex-direction: column; gap: 1px; }
.tk-facts span { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); font-weight: 700; }
.tk-facts b { font-size: 13px; overflow-wrap: anywhere; }
.tk-facts small { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.tk-facts-title { font-size: 12px; font-weight: 800; color: var(--text-2); }

@media (max-width: 1000px) {
  .tk-desk-grid { grid-template-columns: minmax(0, 1fr); }
  .tk-side { position: static; }
}
@media (max-width: 700px) {
  .tk-hero { flex-direction: column; align-items: stretch; }
  .tk-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tk-row { padding: 12px 14px; flex-wrap: wrap; }
  .tk-row-main { flex-basis: calc(100% - 40px); }
  .tk-row .tk-chip, .tk-row .tk-new-pill { margin-left: 32px; }
  .tk-row .tk-new-pill + .tk-chip { margin-left: 0; }
  .tk-body { padding: 14px; }
  .tk-msg { max-width: 92%; }
  .tk-actions-right { width: 100%; }
  .tk-actions-right > button { flex: 1; justify-content: center; }
}

/* ── Emoji-Auswahl (js/emoji.js) ─────────────────────────────────────────── */
.kfz-emoji-wrap { position: relative; }
.kfz-emoji-wrap > textarea { padding-right: 44px; }
.kfz-emoji-toggle {
  position: absolute; right: 8px; bottom: 8px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 17px; line-height: 1;
  background: var(--bg-hover); border: 1px solid var(--border);
}
.kfz-emoji-toggle span { filter: grayscale(.4); transition: transform .15s ease, filter .15s ease; }
.kfz-emoji-toggle:hover span, .kfz-emoji-toggle.active span { filter: none; transform: scale(1.15) rotate(-6deg); }
.kfz-emoji-toggle.active { border-color: var(--accent); background: var(--accent-dim); }
.kfz-emoji {
  position: fixed; z-index: 10050; width: 320px; max-width: calc(100vw - 16px); padding: 8px;
  border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border-md);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.8); display: flex; flex-direction: column;
}
.kfz-emoji-search { font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.kfz-emoji-tabs { display: flex; gap: 2px; margin: 6px 0 2px; overflow-x: auto; scrollbar-width: none; }
.kfz-emoji-tabs[hidden] { display: none; }
.kfz-emoji-tabs button {
  flex: 0 0 auto; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none;
  font-size: 16px; opacity: .55; cursor: pointer; padding: 0;
}
.kfz-emoji-tabs button:hover { opacity: 1; background: var(--bg-hover); }
.kfz-emoji-tabs button.active { opacity: 1; background: var(--accent-dim); }
.kfz-emoji-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); padding: 5px 3px; }
.kfz-emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; height: 220px; overflow-y: auto; align-content: start; scrollbar-width: thin; }
.kfz-emoji-btn {
  aspect-ratio: 1; border: 0; border-radius: 8px; background: none; font-size: 22px; line-height: 1;
  padding: 0; display: grid; place-items: center; cursor: pointer; transition: transform .1s;
}
.kfz-emoji-btn:hover { background: var(--bg-hover); transform: scale(1.12); }
.kfz-emoji-none { grid-column: 1 / -1; padding: 10px 4px; font-size: 12px; color: var(--text-2); }
