/* ============================================================
   PMS — Riccardo CI
   Palette: Dunkelrot (Marke) · Anthrazit · warme Grautöne
   ============================================================ */
:root {
  --sl-breite: 240px;
  --rot: #e30613;            /* Riccardo-Rot (Flamme) */
  --rot-dunkel: #b00510;
  --rot-hell: #fdeaea;
  --anthrazit: #1c1719;
  --anthrazit-2: #2a2326;
  --tinte: #221d1f;          /* Fließtext */
  --grau: #6d6467;           /* Sekundärtext */
  --linie: #e4dedf;          /* Rahmen */
  --flaeche: #f5f3f2;        /* Seitenhintergrund */
  --weiss: #fff;
  --gruen: #2e6b34;
  --warnrot: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
       background: var(--flaeche); color: var(--tinte); font-size: 15px; }

/* ===== App-Gerüst: Seitenleiste + Kopfzeile ===== */
.seitenleiste { position: fixed; inset: 0 auto 0 0; width: var(--sl-breite);
  background: var(--anthrazit); color: #cfc6c8;
  display: flex; flex-direction: column; z-index: 120; transition: transform .25s ease; }
.marke { display: block; padding: 20px 18px 12px; color: #fff; text-decoration: none; }
.marke img { width: 100%; max-width: 178px; display: block; }
.marke small { display: block; font-weight: 500; font-size: 10.5px; opacity: .5;
  margin-top: 7px; letter-spacing: .12em; text-transform: uppercase; }
.marke-r { width: 36px; height: 36px; border-radius: 8px; background: var(--rot); color: #fff;
  font-weight: 800; font-size: 19px; display: flex; align-items: center; justify-content: center;
  flex: none; }
.sl-cta { display: block; margin: 4px 14px 12px; background: var(--rot); color: #fff;
  text-decoration: none; text-align: center; padding: 10px; border-radius: 8px; font-weight: 600; }
.sl-cta:hover { background: var(--rot-dunkel); }
.sl-cta.aktiv { outline: 2px solid rgba(255,255,255,.4); }
.sl-nav { flex: 1; overflow-y: auto; padding: 2px 10px 10px; }
.sl-gruppe { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: #8d8184; margin: 16px 10px 5px; font-weight: 600; }
.sl-punkt { display: flex; align-items: center; gap: 11px; color: #cfc6c8;
  text-decoration: none; padding: 8px 10px; border-radius: 7px; font-size: 14px; margin-bottom: 1px; }
.sl-punkt:hover { background: rgba(255,255,255,.06); color: #fff; }
.sl-punkt.aktiv { background: rgba(142,28,36,.32); color: #fff; font-weight: 600;
  box-shadow: inset 3px 0 0 var(--rot); }
.sl-symbol { width: 20px; height: 20px; flex: none; display: inline-flex;
  align-items: center; justify-content: center; opacity: .85; }
.sl-symbol svg { width: 17px; height: 17px; }
.sl-punkt.aktiv .sl-symbol, .sl-punkt:hover .sl-symbol { opacity: 1; }
.sl-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-fuss { border-top: 1px solid rgba(255,255,255,.1); padding: 12px 16px; display: flex;
  align-items: center; justify-content: space-between; gap: 8px; }
.sl-fuss a { color: #e9e2e3; text-decoration: none; font-weight: 600; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-fuss .leise { color: #8d8184; }

.inhalt-bereich { margin-left: var(--sl-breite); transition: margin-left .25s ease; min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; gap: 12px;
  background: var(--weiss); border-bottom: 1px solid var(--linie); padding: 8px 18px; }
.burger { background: none; border: none; font-size: 20px; color: var(--tinte); cursor: pointer;
  padding: 4px 10px; border-radius: 7px; }
.burger:hover { background: var(--flaeche); }
.topbar-marke { display: none; align-items: center; gap: 8px; color: var(--tinte);
  font-weight: 800; text-decoration: none; }
.topbar-marke img { height: 26px; display: block; }
.klein-r { width: 26px; height: 26px; border-radius: 6px; background: var(--rot); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.topbar-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
main { max-width: 1200px; margin: 24px auto; padding: 0 20px 60px; }

body.sl-zu .seitenleiste { transform: translateX(-100%); }
body.sl-zu .inhalt-bereich { margin-left: 0; }
body.sl-zu .topbar-marke { display: inline-flex; }
.rueckwand { display: none; position: fixed; inset: 0; background: rgba(20,12,14,.5); z-index: 110; }

@media (max-width: 999px) {
  .seitenleiste { transform: translateX(-100%); box-shadow: 8px 0 30px rgba(0,0,0,.35); }
  .inhalt-bereich { margin-left: 0; }
  .topbar-marke { display: inline-flex; }
  body.sl-offen .seitenleiste { transform: translateX(0); }
  body.sl-offen .rueckwand { display: block; }
}

/* ===== Typografie & Grundbausteine ===== */
h1 { font-size: 21px; margin: 8px 0 18px; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 30px 0 8px; text-transform: uppercase; letter-spacing: .05em;
     color: #4c4346; font-weight: 700; }
h2:first-of-type { margin-top: 12px; }
.hinweis { background: #eef4ee; border: 1px solid #c4dbc6; color: #24512a;
           padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.hinweis.fehler { background: #fbecec; border-color: #eec2c0; color: #7d1a15; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
         padding: 16px 18px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
        gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
       padding: 14px; text-align: center; color: var(--grau); font-size: 13px; }
.kpi .zahl { font-size: 26px; font-weight: 700; color: var(--tinte); }
.kpi.warn .zahl { color: var(--warnrot); }
table { width: 100%; border-collapse: collapse; background: var(--weiss);
        border: 1px solid var(--linie); border-radius: 10px; overflow: hidden; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em;
     color: var(--grau); background: #faf8f8; padding: 8px 12px; border-bottom: 1px solid var(--linie);
     font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid #f0ecec; vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:hover td { background: #faf7f7; }
a { color: var(--rot); }
a:hover { color: var(--rot-dunkel); }

/* Status- und Kategorie-Kennzeichen */
.status { display: inline-block; padding: 2px 9px; border-radius: 999px;
          font-size: 12px; font-weight: 600; white-space: nowrap; }
.status.grau { background: #ece8e8; color: #4c4346; }
.status.blau { background: #e2eaf3; color: #274d75; }
.status.tuerkis { background: #ddefed; color: #135c55; }
.status.gelb { background: #f7efd4; color: #6d5304; }
.status.rot { background: #f8dfde; color: #7d1a15; }
.status.gruen { background: #e0eedf; color: #24512a; }
.status.orange { background: #f9e6d2; color: #7d4404; }
.status.blaub { background: #e4e8f2; color: #33436e; }
.kat { font-weight: 700; }
.kat.K5 { color: var(--warnrot); } .kat.K3 { color: #6d3390; } .kat.K4 { color: #8f5300; }
.kat.K1 { color: #274d75; } .kat.K2 { color: #38603c; } .kat.K0 { color: #6d6467; }

/* Formulare */
form.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
label { display: block; font-size: 12px; color: var(--grau); margin-bottom: 3px; font-weight: 600; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid #cfc6c8;
                          border-radius: 7px; background: var(--weiss); width: 100%; color: var(--tinte); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(142,28,36,.25);
                          border-color: var(--rot); }
textarea { min-height: 70px; }
.feld { margin-bottom: 12px; }
.formular-gitter { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 12px; }
button, .aktion { font: inherit; font-weight: 600; background: var(--anthrazit-2); color: #fff;
                  border: none; border-radius: 7px; padding: 8px 16px; cursor: pointer;
                  text-decoration: none; display: inline-block; }
button:hover, .aktion:hover { filter: brightness(1.25); }
button.gruen { background: var(--gruen); } button.rot { background: var(--warnrot); }
button.grau { background: #6d6467; } button.leise { background: transparent;
              color: inherit; font-weight: 400; padding: 4px 8px; opacity: .75; }
button.leise:hover { filter: none; opacity: 1; background: var(--flaeche); }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.aktionen form { display: inline; }
.meta { color: var(--grau); font-size: 13px; }
.ueberfaellig { color: var(--warnrot); font-weight: 700; }
.login-box { max-width: 380px; margin: 8vh auto; }
.protokoll td { font-size: 13px; }
.abschnitt-kopf { display: flex; align-items: baseline; justify-content: space-between; }
details { margin: 10px 0; }
details summary { cursor: pointer; font-weight: 600; color: var(--rot); }
.klein { font-size: 12px; color: var(--grau); }

/* Disposition */
.dispo td, .dispo th { text-align: center; }
.dispo td:first-child, .dispo th:first-child { text-align: left; }
.dispo .d-frei { background: #fff; color: #b4abae; }
.dispo .d-gruen { background: #e0eedf; font-weight: 600; }
.dispo .d-gelb { background: #f7efd4; font-weight: 600; }
.dispo .d-rot { background: #f8dfde; font-weight: 700; color: #7d1a15; }
.dispo .d-abw { background: #ece8e8; color: #8d8184; }

/* Triage */
.triage { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px;
          font-weight: 700; white-space: nowrap; }
.triage.ROT { background: var(--warnrot); color: #fff; }
.triage.ORANGE { background: #cd6a10; color: #fff; }
.triage.GELB { background: #e9c33b; color: #443502; }
.triage.GRUEN { background: var(--gruen); color: #fff; }
.triage.BLAU { background: #46618f; color: #fff; }
.ep-badge { display: inline-block; min-width: 26px; text-align: center; padding: 1px 6px;
            border-radius: 6px; background: var(--anthrazit-2); color: #fff; font-weight: 700; font-size: 12px; }
.score-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; font-size: 11px;
             font-weight: 700; color: #fff; min-width: 200px; }
.score-bar span { display: flex; align-items: center; justify-content: center; }
.score-k { background: #46618f; } .score-a { background: #cd6a10; } .score-s { background: #7c7276; }
.score-e { background: #6d3390; } .score-f { background: var(--warnrot); }
.frog { color: var(--gruen); font-weight: 700; }
.frog5 { color: var(--warnrot); }
.p1 { color: var(--warnrot); font-weight: 700; } .p2 { color: #cd6a10; font-weight: 700; }
.p3 { color: #46618f; } .p4 { color: #7c7276; }

.nav-zaehler { display: inline-block; background: rgba(255,255,255,.16); color: #fff;
               border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px;
               font-family: ui-monospace, Consolas, monospace; flex: none; }
.sl-punkt.aktiv .nav-zaehler { background: var(--rot); color: #fff; }

/* ---------- Benachrichtigungen: Glocke + Pop-up ---------- */
.glocke { position: relative; }
.glocke summary { list-style: none; cursor: pointer; padding: 6px 8px;
                  border-radius: 7px; position: relative; display: inline-flex; color: var(--tinte); }
.glocke summary svg { width: 19px; height: 19px; }
.glocke summary::-webkit-details-marker { display: none; }
.glocke summary:hover { background: var(--flaeche); }
.glocke-zahl { position: absolute; top: -2px; right: -4px; background: var(--rot); color: #fff;
               font-size: 11px; font-weight: 700; border-radius: 999px; min-width: 17px;
               height: 17px; line-height: 17px; text-align: center; padding: 0 4px; }
.glocke-liste { position: absolute; right: 0; top: 36px; width: 340px; max-height: 420px;
                overflow-y: auto; background: var(--weiss); color: var(--tinte); border: 1px solid var(--linie);
                border-radius: 10px; box-shadow: 0 10px 30px rgba(28,23,25,.22); z-index: 100; }
.glocke-eintrag { display: block; padding: 10px 12px; border-bottom: 1px solid #f0ecec;
                  text-decoration: none; color: var(--tinte); font-size: 13px; line-height: 1.4; }
.glocke-eintrag .klein { display: block; margin-top: 2px; }
.glocke-eintrag:hover { background: #faf7f7; }
.glocke-eintrag.neu { background: var(--rot-hell); border-left: 3px solid var(--rot); font-weight: 600; }
.glocke-eintrag.neu:hover { background: #f0dcde; }
.toast { position: fixed; right: 18px; bottom: 18px; max-width: 380px; background: var(--anthrazit);
         color: #fff; padding: 14px 18px; border-radius: 10px; font-size: 14px;
         box-shadow: 0 10px 30px rgba(0,0,0,.35); cursor: pointer; z-index: 200;
         transform: translateY(20px); opacity: 0; transition: all .35s ease;
         border-left: 3px solid var(--rot); }
.toast.sichtbar { transform: translateY(0); opacity: 1; }

/* ---------- Das Eingangstor ---------- */
.tor-buehne { max-width: 720px; margin: 6vh auto 0; text-align: center; }
.tor-marke { margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.tor-marke img { height: 64px; display: block; }
.tor-marke.klein-marke img { height: 44px; }
.tor-frage { font-size: 27px; margin: 0 0 6px; letter-spacing: -.01em; }
.tor-unter { color: var(--grau); margin: 0 auto 22px; max-width: 540px; }
.tor-box { background: var(--weiss); border: 1px solid var(--linie); border-radius: 14px;
           box-shadow: 0 6px 24px rgba(28,23,25,.07); padding: 14px 14px 10px; text-align: left; }
.tor-box textarea { border: none; outline: none; resize: vertical; width: 100%;
                    font-size: 16px; min-height: 64px; padding: 4px 6px; }
.tor-box textarea:focus { box-shadow: none; outline: none; }
.tor-leiste { display: flex; align-items: center; gap: 10px; border-top: 1px solid #f0ecec;
              padding-top: 8px; margin-top: 6px; }
.tor-werkzeug { background: var(--flaeche); border: 1px solid var(--linie); border-radius: 9px;
                padding: 7px 11px; cursor: pointer; font-size: 15px; color: var(--tinte);
                display: inline-flex; align-items: center; }
.tor-werkzeug svg { width: 17px; height: 17px; }
.tor-werkzeug:hover { background: #ece8e8; }
.tor-werkzeug.aufnahme { background: #f8dfde; border-color: var(--warnrot); animation: puls 1.2s infinite; }
@keyframes puls { 50% { opacity: .55; } }
.tor-senden { margin-left: auto; background: var(--rot); border-radius: 9px; padding: 9px 20px;
              font-size: 15px; }
.tor-senden:hover { background: var(--rot-dunkel); filter: none; }
.tor-letzte { margin-top: 34px; text-align: left; }
.tor-letzte h2 { font-size: 13px; color: var(--grau); text-transform: uppercase;
                 letter-spacing: .05em; margin-top: 0; }
.tor-karte { display: flex; gap: 14px; align-items: baseline; background: var(--weiss);
             border: 1px solid var(--linie); border-radius: 10px; padding: 11px 14px;
             margin-bottom: 8px; text-decoration: none; color: inherit; }
.tor-karte:hover { border-color: var(--rot); box-shadow: 0 2px 10px rgba(28,23,25,.07); }
.tor-karte-titel { font-weight: 600; flex: 1; min-width: 0; }
.mono-klein { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--grau); }
.tor-faden { text-align: left; margin: 10px 0 4px; }
.tor-blase { border-radius: 14px; padding: 12px 16px; margin: 10px 0; max-width: 85%;
             line-height: 1.5; white-space: pre-line; }
.tor-blase.nutzer { background: var(--anthrazit-2); color: #fff; margin-left: auto;
                    border-bottom-right-radius: 4px; }
.tor-blase.system { background: var(--weiss); border: 1px solid var(--linie); margin-right: auto;
                    border-bottom-left-radius: 4px; }
.tor-optionen { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start;
                text-align: left; margin: 6px 0; }
.tor-option { background: var(--weiss); color: var(--rot); border: 1.5px solid var(--rot);
              border-radius: 999px; padding: 8px 18px; font-size: 14px; }
.tor-option:hover { background: var(--rot-hell); filter: none; }

/* ---------- Ticketseite: Nächster Schritt + einklappbare Abschnitte ---------- */
.schritt { display: flex; align-items: center; gap: 12px; background: var(--weiss);
           border: 1px solid var(--linie); border-left: 4px solid #8d8184; border-radius: 10px;
           padding: 12px 16px; margin-bottom: 16px; }
.schritt strong { font-size: 14px; }
.schritt .klein { margin-left: auto; white-space: nowrap; }
.schritt.dran { border-left-color: var(--rot); background: #fffbfb; }
.schritt.fertig { border-left-color: var(--gruen); }
.schritt.gestoppt { border-left-color: var(--warnrot); }
details.abschnitt { margin: 12px 0; background: var(--weiss); border: 1px solid var(--linie);
                    border-radius: 10px; }
details.abschnitt > summary { padding: 11px 16px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .05em; color: #4c4346; font-weight: 700; cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px; }
details.abschnitt > summary::-webkit-details-marker { display: none; }
details.abschnitt > summary::before { content: "›"; color: #a99fa2; font-size: 15px;
  transition: transform .15s ease; display: inline-block; }
details.abschnitt[open] > summary::before { transform: rotate(90deg); }
details.abschnitt > summary:hover { color: var(--rot); }
details.abschnitt > .abschnitt-inhalt { padding: 2px 16px 14px; }
details.abschnitt table { border: none; border-top: 1px solid var(--linie); border-radius: 0; }
.zaehl { background: #ece8e8; color: #4c4346; border-radius: 999px; padding: 0 8px;
         font-size: 11.5px; font-weight: 700; }

/* ---------- Diskussion am Ticket (Chat mit @-Erwähnungen) ---------- */
.disk { display: flex; flex-direction: column; gap: 8px; }
.disk-eintrag { background: var(--weiss); border: 1px solid var(--linie); border-radius: 10px;
                padding: 10px 14px; max-width: 85%; }
.disk-eintrag.eigen { margin-left: auto; background: #faf4f4; border-color: #ecd9da; }
.disk-kopf { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px;
             margin-bottom: 3px; }
.disk-kopf .klein { font-weight: 400; margin-left: auto; }
.disk-text { white-space: pre-line; line-height: 1.45; }
.disk-vorschlaege { position: absolute; left: 0; right: 0; top: 100%; z-index: 50;
                    background: var(--weiss); border: 1px solid var(--linie); border-radius: 8px;
                    box-shadow: 0 8px 24px rgba(28,23,25,.15); overflow: hidden; }
.disk-vorschlag { padding: 8px 12px; cursor: pointer; font-size: 14px; }
.disk-vorschlag:hover { background: var(--rot-hell); color: var(--rot-dunkel); }
.disk-eintrag.geloescht { opacity: .6; background: var(--flaeche); }
.disk-kopf form { display: inline; }
