/* Oberfläche 14.11.2026 (GS): Menü-Zähler, Bereichs-Einträge, Schnellsuche (Strg+K), Neu-Knopf, Handyleiste,
   Benachrichtigungs-Panel, Pfadzeile, Ladeplatzhalter. */

/* ── Menü ───────────────────────────────────────────────── */
.dax-nav-zaehler {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.dax-nav-item--bereich .dax-nav-pfeil { margin-left: auto; font-size: 16px; line-height: 1; color: var(--ink-faint); }
.dax-nav-item--bereich:hover .dax-nav-pfeil { color: var(--accent); }

/* Als App installieren: kleine Karte mit Symbolkachel statt gestricheltem Rahmen. GS 14.11.2026 */
.dax-app-installieren {
  display: none; align-items: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid var(--border-soft); border-radius: 10px; background: var(--bg-soft); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; transition: border-color 160ms ease, background 160ms ease;
}
.dax-app-installieren:hover { border-color: var(--accent); }
.dax-app-installieren:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dax-app-installieren-symbol {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px;
  border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent);
}
.dax-app-installieren-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.dax-app-installieren-titel { font-size: 13px; font-weight: 700; }
.dax-app-installieren-hinweis { font-size: 11.5px; color: var(--ink-faint); }
html.dax-installierbar .dax-app-installieren { display: flex; }

/* ── Topbar: Suchknopf und Neu-Knopf ────────────────────── */
.dax-suchknopf {
  display: flex; align-items: center; gap: 8px; min-width: 220px; padding: 6px 8px 6px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill, 999px); background: var(--bg-soft);
  color: var(--ink-subtle); font: inherit; font-size: 13px; cursor: pointer; transition: border-color 160ms ease;
}
.dax-suchknopf:hover { border-color: var(--accent); color: var(--ink); }
.dax-suchknopf-text { flex: 1; text-align: left; }
.dax-suchknopf-taste, .ss-fenster kbd {
  padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  background: var(--surface); color: var(--ink-muted); font-family: inherit; font-size: 11px; font-weight: 600;
}
.dax-neu-knopf {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-pill, 999px);
  background: var(--accent); color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none !important; white-space: nowrap;
}
.dax-neu-knopf:hover { filter: brightness(.93); }
/* GS 15.11.2026: Die sichtbare Seitenleiste trägt den Portalnamen; den Platz oben nutzt die Suche. */
@media (min-width: 1024px) {
  .dax-topbar--haupt .dax-topbar-title { display: none; }
  .dax-topbar--haupt .dax-topbar-actions { flex: 1; min-width: 0; justify-content: flex-end; }
  .dax-topbar--haupt .dax-suchknopf {
    flex: 0 1 36rem;
    min-width: 0;
    margin-inline-end: auto;
  }
  .dax-suchknopf svg, .dax-suchknopf-taste { flex-shrink: 0; }
  .dax-suchknopf-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}
@media (max-width: 1023px) {
  .dax-suchknopf { min-width: 0; padding: 8px; }
  .dax-suchknopf-text, .dax-suchknopf-taste { display: none; }
}
@media (max-width: 767px) { .dax-neu-knopf { display: none; } }

/* ── Schnellsuche ───────────────────────────────────────── */
.ss-hintergrund { position: fixed; inset: 0; z-index: 2000; background: rgba(15, 20, 25, .45); backdrop-filter: blur(2px); }
.ss-fenster {
  position: fixed; z-index: 2001; top: 12vh; left: 50%; transform: translateX(-50%);
  width: min(640px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column;
  border-radius: 14px; background: var(--surface); box-shadow: 0 24px 64px rgba(15, 20, 25, .3); overflow: hidden;
  animation: ss-auf 140ms ease-out;
}
@keyframes ss-auf { from { opacity: 0; transform: translate(-50%, -6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ss-eingabe { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--ink-subtle); }
.ss-eingabe input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--ink); font: inherit; font-size: 16px; }
.ss-esc { cursor: pointer; }
.ss-liste { overflow-y: auto; padding: 6px 0; }
.ss-gruppe { padding: 10px 16px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.ss-treffer { display: flex; align-items: center; gap: 12px; margin: 0 6px; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.ss-treffer.aktiv { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.ss-treffer-symbol { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--bg-soft); color: var(--ink-muted); }
.ss-treffer.aktiv .ss-treffer-symbol { color: var(--accent); }
.ss-treffer-symbol svg { width: 16px; height: 16px; }
.ss-treffer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ss-treffer-titel { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-treffer-unter { font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-treffer-enter { font-size: 11px; color: var(--ink-faint); }
.ss-leer { padding: 28px 16px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }
.ss-fuss { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--ink-faint); }
.ss-fuss kbd { margin-right: 3px; }
@media (max-width: 767px) { .ss-fenster { top: 8px; max-height: calc(100vh - 16px); } .ss-fuss { display: none; } }

/* ── Handyleiste ────────────────────────────────────────── */
.hl-leiste { display: none; }
@media (max-width: 767px) {
  .hl-leiste {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: grid; grid-template-columns: repeat(5, 1fr);
    align-items: end; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
    border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(15, 20, 25, .06);
  }
  .dax-content { padding-bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .hl-leiste .benachrichtigung-glocke { display: contents; }
}
.hl-knopf {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none;
  color: var(--ink-muted); font: inherit; text-decoration: none; cursor: pointer;
}
.hl-knopf.aktiv { color: var(--accent); }
.hl-symbol { position: relative; width: 24px; height: 24px; }
.hl-symbol svg { width: 24px; height: 24px; }
.hl-text { font-size: 10.5px; font-weight: 700; }
.hl-zaehler {
  position: absolute; top: -4px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; display: grid; place-items: center;
}
.hl-knopf--neu { align-self: center; }
.hl-plus {
  width: 48px; height: 48px; margin-top: -18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 40%, transparent);
}
.hl-plus svg { width: 24px; height: 24px; }

/* ── Benachrichtigungen ─────────────────────────────────── */
.glocke-btn { position: relative; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); cursor: pointer; }
.glocke-btn:hover { background: var(--bg-soft); color: var(--ink); }
.bn-umschalter { display: flex; gap: 8px; margin-bottom: 12px; }
.bn-liste { list-style: none; margin: 0 -8px; padding: 0; }
.bn-eintrag {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; width: 100%;
  padding: 10px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.bn-eintrag:hover { background: var(--bg-soft); }
.bn-eintrag.ungelesen .bn-titel { font-weight: 800; }
.bn-eintrag.ungelesen .bn-symbol::after {
  content: ""; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
}
.bn-symbol { position: relative; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #e8f0fe; color: #1a56c4; }
.bn-symbol svg { width: 17px; height: 17px; }
.bn-symbol--danger { background: #fdecec; color: #b3261e; }
.bn-symbol--warn { background: #fff4e0; color: #9a5b00; }
.bn-symbol--akzent { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); }
.bn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bn-titel { font-size: 13.5px; font-weight: 600; }
.bn-nachricht { font-size: 12.5px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bn-mehr { font-size: 11.5px; color: var(--ink-faint); }
.bn-zeit { font-size: 11.5px; color: var(--ink-faint); white-space: nowrap; }
.bn-leer { display: flex; gap: 10px; align-items: center; padding: 24px 4px; color: var(--ink-muted); font-size: 13.5px; }
.bn-leer svg { width: 20px; height: 20px; color: #2e7d32; }

/* ── Pfadzeile ──────────────────────────────────────────── */
.dax-pfad { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-faint); }
.dax-pfad a { color: var(--ink-muted); text-decoration: none; font-weight: 600; }
.dax-pfad a:hover { color: var(--accent); }
.dax-pfad li + li::before { content: "›"; margin: 0 6px 0 2px; color: var(--ink-faint); }
.dax-pfad [aria-current] { color: var(--ink); font-weight: 700; }

/* ── Ladeplatzhalter ────────────────────────────────────── */
.dax-platzhalter { display: flex; flex-direction: column; gap: 12px; }
.dax-platzhalter-zeile {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--bg-soft) 0%, color-mix(in srgb, var(--border) 70%, var(--bg-soft)) 50%, var(--bg-soft) 100%);
  background-size: 200% 100%; animation: dax-schimmer 1.2s ease-in-out infinite;
}
.dax-platzhalter-zeile--breit { height: 64px; border-radius: 10px; }
@keyframes dax-schimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .dax-platzhalter-zeile, .ss-fenster { animation: none; } }

/* ── Tickets: Ansicht Liste/Kanban, Vorschau ────────────── */
.tl-ansicht { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.tl-ansicht-knopf { padding: 6px 16px; border-radius: 7px; color: var(--ink-muted); font-size: 13px; font-weight: 700; text-decoration: none !important; }
.tl-ansicht-knopf:hover { color: var(--ink); }
.tl-ansicht-knopf.aktiv { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 20, 25, .1); }
.ticket-grid .dxbl-grid-table > tbody > tr:not(.dxbl-grid-group-row) { cursor: pointer; }

.tv-eckdaten { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.tv-wert { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 13.5px; }
.tv-label { font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.tv-link { margin-left: 8px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.tv-link:hover { text-decoration: underline; }
.tv-ueber { color: #b3261e; font-weight: 700; }
.tv-abschnitt { margin: 20px 0 8px; font-size: 13px; font-weight: 800; color: var(--ink); }
.tv-text { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-muted); white-space: pre-line; }
.tv-text--leer { color: var(--ink-faint); }
.tv-antworten { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tv-antworten li { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.tv-antworten li.kunde { border-left: 3px solid #1f6feb; }
.tv-antworten li.dateex { border-left: 3px solid var(--accent); }
.tv-antworten li.intern { border-left: 3px solid #e0a100; background: #fffbea; }
.tv-antwort-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; }
.tv-antwort-zeit { margin-left: auto; font-size: 11.5px; color: var(--ink-faint); }
.tv-antwort-text { font-size: 13px; line-height: 1.55; color: var(--ink-muted); white-space: pre-line; }
@media (max-width: 600px) { .tv-eckdaten { grid-template-columns: 1fr; } }

/* ── Ticketansicht zweispaltig ──────────────────────────── */
.td-raster { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.td-raster--kunde { grid-template-columns: minmax(0, 1fr) 300px; }
.td-haupt { min-width: 0; }
.td-seite {
  position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; min-width: 0;
  display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin;
}
.td-seite .ticket-optional-section, .td-seite .ticket-section { margin: 0; }
.td-seite .aktionen-felder-row { flex-direction: column; align-items: stretch !important; }
.td-seite .aktionen-feld, .td-seite .aktionen-feld--kunde, .td-seite .aktionen-feld--full { min-width: 0 !important; width: 100%; flex: 1 1 auto !important; }
.td-seite .aktionen-feld > .dxbl-combobox, .td-seite .aktionen-feld > .dxbl-text-edit, .td-seite .aktionen-feld .dxbl-date-edit { width: 100%; }
.td-seite .ticket-arbeit-layout { grid-template-columns: minmax(0, 1fr); }
.td-seite .ticket-arbeit-section .ticket-section-label-row { flex-wrap: wrap; gap: 8px; }
.td-antwortleiste {
  position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 16px; padding: 10px 12px 10px 16px; border: 1px solid var(--border); border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(15, 20, 25, .1);
}
.td-antwortleiste-text { font-size: 13px; color: var(--ink-muted); }
@media (max-width: 1200px) {
  .td-raster, .td-raster--kunde { grid-template-columns: minmax(0, 1fr); }
  .td-seite { position: static; max-height: none; overflow: visible; order: -1; }
}
@media (max-width: 767px) {
  /* Handy: erst der Inhalt mit den Einzelpunkten, dann der Block „Bearbeitung“. GS 14.11.2026 */
  .td-seite { order: 0; }
  .td-antwortleiste { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .td-antwortleiste-text { display: none; }
  .td-antwortleiste .dxbl-btn { flex: 1; }
}
.td-seite .ticket-optional-hint { display: none; }
.dax-platzhalter-kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 767px) { .dax-platzhalter-kacheln { grid-template-columns: 1fr 1fr; } }

/* ── Dunkelmodus: helle Signalfarben gedämpft ───────────── */
html[data-theme="dark"] .st-grund--danger, html[data-theme="dark"] .bn-symbol--danger { background: rgba(229, 72, 77, .18); color: #ff8a8f; }
html[data-theme="dark"] .st-grund--warn, html[data-theme="dark"] .bn-symbol--warn { background: rgba(240, 160, 40, .18); color: #ffc46b; }
html[data-theme="dark"] .st-grund--info, html[data-theme="dark"] .bn-symbol { background: rgba(80, 140, 255, .18); color: #8db4ff; }
html[data-theme="dark"] .tv-antworten li.intern { background: rgba(240, 180, 40, .08); }
html[data-theme="dark"] .tv-ueber, html[data-theme="dark"] .st-frist.ueber { color: #ff8a8f; }
html[data-theme="dark"] .st-frist { color: #ffc46b; }
html[data-theme="dark"] .st-mir { color: #8db4ff; }
html[data-theme="dark"] .ss-hintergrund { background: rgba(0, 0, 0, .6); }
/* Handyleiste nicht über der aufgeklappten Seitenleiste (Herbert H2, 14.11.2026). GS */
.dax-shell--sidebar-open .hl-leiste { display: none; }
/* Ticketkopf am Handy: Titel volle Breite, Knöpfe darunter. GS 14.11.2026 */
@media (max-width: 767px) {
  .ticket-kopf-zeile { flex-wrap: wrap; gap: 10px; }
  .ticket-kopf-links { flex: 1 1 100%; min-width: 0; }
  .ticket-detail-betreff { word-break: normal; overflow-wrap: anywhere; }
}

/* modulex-Protokoll und modulex-Benutzer (14.11.2026). GS */
.mp-filter { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 14px; }
.mp-filter .dax-chips { margin: 0; }
.mp-kunde { width: 320px; max-width: 100%; }
.mp-inhalt { margin: 16px 0 0; padding: 12px; border-radius: 8px; background: var(--bg-soft); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; }
/* Buchhaltung prüfen (modulex-Bereich). GS 14.11.2026 */
.bp-alt { color: var(--warn-fg); font-weight: 600; }
.bp-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.bp-kopf .dax-btn { margin-left: auto; }
.bp-titel { font-size: 13px; font-weight: 700; margin: 20px 0 8px; }
.bp-titel small { font-weight: 400; color: var(--ink-subtle); }
.bp-tabelle { width: 100%; border-collapse: collapse; font-size: 13px; }
.bp-tabelle th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-subtle); padding: 4px 8px; border-bottom: 1px solid var(--border); }
.bp-tabelle td { padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.bp-tabelle tbody tr { cursor: pointer; }
.bp-tabelle tbody tr:hover, .bp-tabelle tr.bp-aktiv { background: var(--bg-soft); }
.bp-zahl { text-align: right; width: 60px; font-variant-numeric: tabular-nums; }
.bp-fehler { color: var(--danger-fg); font-size: 12px; margin-top: 2px; }
/* Pruefungen: Bereichsauswahl (GS 14.11.2026) */
.bp-bereiche { margin: -4px 0 12px; }
.bp-anzahl { margin-left: 6px; font-size: 11px; color: var(--danger-fg); font-weight: 700; }
.bp-zeitraum { font-size: 12px; color: var(--ink-subtle); margin-top: 6px; }
.mb-bereich { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
