/* FSG Status-Farbschema v2 "Halo" (14.07.2026) — injiziert via nginx sub_filter, update-sicher */
:root {
  --fs-new: #2563EB;
  --fs-open: #F59E0B;
  --fs-progress: #16A34A;
  --fs-wait-customer: #0D9488;
  --fs-wait-reminder: #38BDF8;
  --fs-postponed: #64748B;
  --fs-closed: #B7BCC4;
  --fs-escalated: #DC2626;
}

/* Bucket-Fallback für Stellen ohne Statustext (z.B. Taskbar-Tabs) */
.icon-task-state.closed { fill: var(--fs-closed); }
.icon-task-state.pending { fill: var(--fs-postponed); }
.icon-task-state.escalating { fill: var(--fs-escalated); }

/* Halo-Icon: Punkt in Statusfarbe + weicher Farbschein (custom.js ersetzt das SVG) */
.fs-halo {
  display: inline-flex;
  width: 16px; height: 16px;
  align-items: center; justify-content: center;
  vertical-align: middle;
}
.fs-halo > span {
  width: 9px; height: 9px;
  border-radius: 50%;
}
.fs-halo[data-fs="neu"] > span { background: var(--fs-new); box-shadow: 0 0 0 3.5px rgba(37,99,235,.22); }
.fs-halo[data-fs="offen"] > span { background: var(--fs-open); box-shadow: 0 0 0 3.5px rgba(245,158,11,.22); }
.fs-halo[data-fs="in-bearbeitung"] > span { background: var(--fs-progress); box-shadow: 0 0 0 3.5px rgba(22,163,74,.25); }
.fs-halo[data-fs="warten-kunde"] > span { background: var(--fs-wait-customer); box-shadow: 0 0 0 3.5px rgba(13,148,136,.22); }
.fs-halo[data-fs="warten-erinnerung"] > span { background: var(--fs-wait-reminder); box-shadow: 0 0 0 3.5px rgba(56,189,248,.22); }
.fs-halo[data-fs="zurueckgestellt"] > span { background: var(--fs-postponed); box-shadow: 0 0 0 3.5px rgba(100,116,139,.22); }
.fs-halo[data-fs="geschlossen"] > span { background: var(--fs-closed); box-shadow: 0 0 0 3.5px rgba(183,188,196,.25); }

/* Eskaliert/erreicht: roter Halo pulsiert (mittlere Stärke), Punkt behält Statusfarbe */
@keyframes fsPulse {
  0% { box-shadow: 0 0 0 3.5px rgba(220,38,38,.55); }
  70% { box-shadow: 0 0 0 7px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 3.5px rgba(220,38,38,0); }
}
.fs-halo.fs-esc > span { animation: fsPulse 2s ease-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .fs-halo.fs-esc > span { animation: none; box-shadow: 0 0 0 3.5px rgba(220,38,38,.55); }
}

/* Status-Texte in Listen */
[data-fs-state="neu"] { color: var(--fs-new) !important; font-weight: 500; }
[data-fs-state="offen"] { color: var(--fs-open) !important; font-weight: 500; }
[data-fs-state="in-bearbeitung"] { color: var(--fs-progress) !important; font-weight: 500; }
[data-fs-state="warten-kunde"] { color: var(--fs-wait-customer) !important; font-weight: 500; }
[data-fs-state="warten-erinnerung"] { color: var(--fs-wait-reminder) !important; font-weight: 500; }
[data-fs-state="zurueckgestellt"] { color: var(--fs-postponed) !important; font-weight: 500; }
[data-fs-state="geschlossen"] { color: var(--fs-closed) !important; }

/* ── Überpunkte Übersichten-Leiste ── */
.fs-ov-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 6px;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: .05em;
  font-weight: 600;
  color: #8f8f96;
  list-style: none;
}
.fs-ov-header:hover .fs-ov-name { color: #555; }
.fs-ov-chev { font-size: 11px; transition: transform .15s; }
.fs-ov-header.fs-ov-open .fs-ov-chev { transform: rotate(90deg); }
.fs-ov-count { margin-left: auto; font-weight: 400; font-size: 13px; color: #aaa; }

/* ── Docs-Suche (TEST-Feature) — Rollback: Block entfernen ── */
.fs-docs-trigger { color: #999; cursor: pointer; }
.fs-docs-trigger:hover { color: #444; }
#fs-docs-panel {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 380px;
  max-height: 480px;
  background: #fff;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  overflow: hidden;
}
#fs-docs-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #e5e5e5;
  font-size: 13px;
  outline: none;
}
#fs-docs-results { max-height: 424px; overflow-y: auto; }
.fs-docs-snip { font-size: 11px; color: #777; line-height: 1.35; white-space: normal; }
.fs-docs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.fs-docs-row:hover { background: #f8f8f8; }
.fs-docs-link { flex: 1; display: flex; flex-direction: column; gap: 1px; text-decoration: none; min-width: 0; }
.fs-docs-title { font-size: 13px; color: #2563EB; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-docs-crumb { font-size: 11px; color: #999; text-transform: capitalize; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-docs-copy {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #666;
  cursor: pointer;
}
.fs-docs-copy:hover { background: #f0f0f0; }
.fs-docs-empty { padding: 14px; font-size: 12px; color: #999; text-align: center; }

/* Status-Punkt vor dem Text in Listen */
td[data-fs-state]::before, span[data-fs-state]::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: currentColor;
  vertical-align: 1px;
}

/* ── Inline-Audio-Player (Voicemails etc.) ── */
.fs-audio, .fs-audio-desktop {
  display: block;
  width: 300px;
  height: 40px;
  margin: 6px 0 4px;
}

/* ── "In Bearbeitung" Pin-Block in der Taskbar ── */
#fs-pin {
  padding: 2px 0 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.fs-pin-head {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fs-progress);
}
.fs-pin-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  color: hsl(210, 14%, 91%);
  text-decoration: none;
  font-size: 13px;
}
.fs-pin-item:hover {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  text-decoration: none;
}
.fs-pin-dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--fs-progress);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .3);
}
.fs-pin-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ── Blitz-Marker für dringende Tickets (Prio hoch) ── */
.fs-flash {
  color: var(--fs-escalated);
  font-weight: 600;
}

/* ── "Puls" — hängt am nativen Zammad-Dashboard (#dashboard). Nutzt die
      nativen .stat-widget-Klassen → Dark/Light-Mode automatisch. ── */
#fs-puls.stat-widgets { margin-bottom: 4px; }
#fs-puls .fs-puls-loading {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 13px;
}
.fs-puls-tile.stat-widget {
  text-decoration: none;
  color: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
}
.fs-puls-tile.stat-widget:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
  text-decoration: none;
}
.fs-puls-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.fs-puls-icon { font-size: 30px; line-height: 1; }
.fs-puls-num {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Dringend-Kachel: roter Rahmen + Akzent — funktioniert Dark + Light durch
   Farbmischung mit dem jeweiligen Hintergrund */
.fs-puls-tile.stat-widget[data-fs-alert="1"] {
  border-color: color-mix(in srgb, var(--fs-escalated) 60%, var(--border));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--fs-escalated) 45%, transparent) inset,
    0 4px 12px color-mix(in srgb, var(--fs-escalated) 20%, transparent);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--fs-escalated) 10%, transparent),
      transparent 50%),
    var(--background-secondary);
}
.fs-puls-tile.stat-widget[data-fs-alert="1"] .stat-title { color: var(--fs-escalated); font-weight: 600; }
.fs-puls-tile.stat-widget[data-fs-alert="1"] .fs-puls-num { color: var(--fs-escalated); }
.fs-puls-tile.stat-widget[data-fs-alert="1"]:hover {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--fs-escalated) 60%, transparent) inset,
    0 6px 16px color-mix(in srgb, var(--fs-escalated) 28%, transparent);
}

/* ── Orga-Schnellwechsel in Kunde-Sidebar (Ticket-Zoom) ── */
.fs-orgquick {
  margin: 14px 14px 18px;
  padding: 10px 12px 12px;
  background: var(--background-secondary, rgba(255,255,255,.03));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 6px;
  font-size: 12px;
}
.fs-orgquick-head {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted, rgba(255,255,255,.5));
  margin-bottom: 8px;
}
.fs-orgquick-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0;
  min-height: 22px;
}
.fs-orgquick-lbl {
  color: var(--text-muted, rgba(255,255,255,.55));
  flex-shrink: 0;
  width: 62px;
  padding-top: 2px;
}
.fs-orgquick-primary {
  color: var(--text, inherit);
  font-weight: 500;
  padding-top: 2px;
}
.fs-orgquick-primary[data-empty] { color: var(--text-muted, #999); font-weight: 400; }
.fs-orgquick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 1px;
}
.fs-orgquick-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px 2px 8px;
  background: rgba(37, 99, 235, .12);
  border: 1px solid rgba(37, 99, 235, .25);
  border-radius: 10px;
  color: var(--text, inherit);
  font-size: 11px;
  line-height: 1.4;
}
.fs-orgquick-x {
  cursor: pointer;
  color: var(--text-muted, #999);
  font-weight: 700;
  margin-left: 2px;
}
.fs-orgquick-x:hover { color: var(--fs-escalated); }
.fs-orgquick-empty { color: var(--text-muted, #999); font-size: 11px; }
.fs-orgquick-searchwrap {
  position: relative;
  margin-top: 10px;
}
.fs-orgquick-search {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  background: var(--background, rgba(0,0,0,.15));
  border: 1px solid var(--border, rgba(255,255,255,.1));
  border-radius: 4px;
  color: var(--text, inherit);
  font-size: 12px;
  outline: none;
}
.fs-orgquick-search:focus { border-color: rgba(37, 99, 235, .5); }
.fs-orgquick-results {
  margin-top: 4px;
  max-height: 200px;
  overflow-y: auto;
}
.fs-orgquick-results:empty { display: none; }
.fs-orgquick-hit {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,.06));
}
.fs-orgquick-hit:last-child { border-bottom: none; }
.fs-orgquick-hit-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text, inherit);
}
.fs-orgquick-btn {
  padding: 2px 6px;
  font-size: 10px;
  border: 1px solid var(--border, rgba(255,255,255,.15));
  background: transparent;
  color: var(--text-muted, rgba(255,255,255,.7));
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.fs-orgquick-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, .15);
  border-color: rgba(37, 99, 235, .4);
  color: var(--text, inherit);
}
.fs-orgquick-btn:disabled { opacity: .35; cursor: default; }

/* ── Volltextsuche im Link-Dialog (an Zammad-Dialog-Farben angepasst) ── */
.fs-linksearch {
  position: relative;
  margin: 8px 0 4px;
}
.fs-linksearch-results {
  max-height: 320px;
  overflow-y: auto;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
}
.fs-linksearch-results:empty { display: none; }
.fs-linksearch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  cursor: pointer;
  font-size: 13px;
  color: hsl(210, 14%, 88%);
}
.fs-linksearch-row:last-child { border-bottom: none; }
.fs-linksearch-row:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.fs-linksearch-nr {
  color: #7BB3FF;
  font-weight: 600;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.fs-linksearch-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fs-linksearch-meta {
  color: rgba(255, 255, 255, .45);
  font-size: 11px;
  flex-shrink: 0;
  text-transform: lowercase;
}
.fs-linksearch-empty {
  padding: 10px 12px;
  color: rgba(255, 255, 255, .45);
  font-size: 12px;
  text-align: center;
}
