/* ============================================================
   DOKUMENTE — Oberfläche, Bereich Tools der CRM Suite.
   Vorlage: previews/dokumente.html

   KEIN FENSTER: Seitenkopf, Navigation und Scrollen gehören der
   Suite. Hier steht nur das Blatt und das Blatt von rechts.

   .crs-eigen ist ein Flex-Kasten in ZEILENrichtung und scrollt
   nicht selbst (overflow:hidden). Also: .dok wächst mit
   (flex:1 1 auto), scrollt in .dok-raum, und das Blatt daneben
   bekommt feste Breite.

   Hell, ohne theme-light — der Inhalt der Suite ist immer hell.
   ============================================================ */

.dok{
  flex:1 1 auto; min-width:0; width:100%;
  display:flex; flex-direction:column; min-height:0; height:100%;
  color:#12233a; font-size:14px; line-height:1.5;
}
.dok *{ box-sizing:border-box; }
.dok .material-symbols-rounded{ vertical-align:middle; line-height:1; user-select:none; }
/* Eine Datei schwebt über dem Blatt. */
.dok.drueber{ outline:2px dashed rgb(var(--accent-rgb,26,155,219)); outline-offset:-6px; border-radius:12px; }

/* ---------- Kopfleiste ---------- */
.dok-leiste{ flex:none; display:flex; align-items:center; gap:10px; margin-bottom:12px; }

.dok-suche{
  flex:1; min-width:0; display:flex; align-items:center; gap:10px; height:44px;
  padding:0 8px 0 14px; border-radius:22px; background:#fff;
  border:1px solid #d9e4f0; transition:border-color .12s, box-shadow .12s;
}
.dok-suche:focus-within{
  border-color:rgb(var(--accent-rgb,26,155,219));
  box-shadow:0 0 0 3px rgba(var(--accent-rgb,26,155,219),.13);
}
.dok-suche > .material-symbols-rounded{ color:#93a5b8; font-size:21px; flex:none; }
.dok-suche input{ flex:1; min-width:0; border:0; outline:0; background:transparent;
  font:inherit; font-size:14px; color:#12233a; }
.dok-suche input::placeholder{ color:#93a5b8; }
/* Fragen sieht anders aus als Suchen — sonst merkt niemand, dass
   die Eingabetaste jetzt Geld kostet. */
.dok-suche.ki{ border-color:#7b5cd6; background:#fcfbff; }
.dok-suche.ki > .material-symbols-rounded{ color:#7b5cd6; }

.dok-sweg{
  all:unset; cursor:pointer; width:28px; height:28px; border-radius:50%; flex:none;
  display:grid; place-items:center; color:#93a5b8;
}
.dok-sweg:hover{ background:#eef3f8; color:#12233a; }

.dok-kischalt{
  all:unset; cursor:pointer; flex:none; display:flex; align-items:center; gap:7px;
  height:44px; padding:0 15px; border-radius:22px; font-size:13px; font-weight:600;
  color:#6b7f96; background:#fff; border:1px solid #d9e4f0; white-space:nowrap;
}
.dok-kischalt:hover{ color:#12233a; border-color:#93a5b8; }
.dok-kischalt[aria-pressed="true"]{ background:#f0ecfc; border-color:#7b5cd6; color:#5a3fb8; }
.dok-kischalt .material-symbols-rounded{ font-size:19px; }

.dok-knopf{
  all:unset; cursor:pointer; flex:none; display:flex; align-items:center; gap:7px;
  height:44px; padding:0 18px; border-radius:22px; font-size:13.5px; font-weight:600;
  background:rgb(var(--accent-rgb,26,155,219)); color:#fff; white-space:nowrap;
}
.dok-knopf:hover{ filter:brightness(1.06); }
.dok-knopf .material-symbols-rounded{ font-size:20px; }

.dok-ansicht{ flex:none; display:flex; gap:2px; padding:3px; background:#f7fafd;
  border:1px solid #d9e4f0; border-radius:12px; }
.dok-ansicht button{
  all:unset; cursor:pointer; width:38px; height:36px; border-radius:9px;
  display:grid; place-items:center; color:#6b7f96;
}
.dok-ansicht button:hover{ background:#eef3f8; color:#12233a; }
.dok-ansicht button[aria-pressed="true"]{ background:#fff; color:#0f6e9e;
  box-shadow:0 1px 2px rgba(18,35,58,.1); }

/* ---------- Filter ---------- */
.dok-filter{ flex:none; display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:12px; }
.dok-chip{
  all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:7px;
  height:32px; padding:0 13px; border-radius:16px; font-size:12.5px; font-weight:600;
  color:#6b7f96; background:#fff; border:1px solid #d9e4f0; white-space:nowrap;
}
.dok-chip:hover{ color:#12233a; border-color:#93a5b8; }
.dok-chip[aria-pressed="true"]{
  background:rgba(var(--accent-rgb,26,155,219),.12);
  border-color:rgb(var(--accent-rgb,26,155,219)); color:#0f6e9e;
}
.dok-chip .material-symbols-rounded{ font-size:17px; }
.dok-chip .z{
  font-size:11px; font-weight:700; padding:1px 6px; border-radius:9px;
  background:#eef3f8; color:#6b7f96; font-variant-numeric:tabular-nums;
}
.dok-chip[aria-pressed="true"] .z{ background:rgba(var(--accent-rgb,26,155,219),.2); color:#0f6e9e; }
.dok-trenn{ width:1px; height:22px; background:#e4eaf2; margin:0 4px; }
.dok-sort{
  height:32px; padding:0 10px; border-radius:16px; font-size:12.5px; font-weight:600;
  color:#6b7f96; background:#fff; border:1px solid #d9e4f0; cursor:pointer;
}

/* Was gerade gelesen wird. Steht in der Filterzeile, nicht als
   Balken über allem: es ist ein Nebenlauf, keine Sperre. */
.dok-stand{ display:flex; align-items:center; gap:6px; font-size:12px; color:#5a3fb8; margin-left:auto; }
.dok-punkt{ width:6px; height:6px; border-radius:50%; background:#7b5cd6; animation:dokPuls 1.1s infinite; }
.dok-punkt:nth-child(2){ animation-delay:.18s; }
.dok-punkt:nth-child(3){ animation-delay:.36s; }
@keyframes dokPuls{ 0%,60%,100%{ opacity:.25; } 30%{ opacity:1; } }
@media (prefers-reduced-motion: reduce){ .dok-punkt{ animation:none; opacity:.7; } }

/* ---------- Die KI-Antwort ---------- */
.dok-kiantwort{
  flex:none; margin-bottom:12px; border-radius:12px; overflow:hidden;
  background:#f0ecfc; border:1px solid rgba(123,92,214,.3);
}
.dok-kikopf{ display:flex; align-items:center; gap:9px; padding:11px 14px;
  font-size:13px; font-weight:700; color:#5a3fb8; }
.dok-kikopf .material-symbols-rounded{ font-size:19px; }
.dok-kisp{ margin-left:auto; font-weight:500; font-size:11.5px; color:#7b6aa8; }
.dok-kitext{ padding:0 14px 13px; font-size:13px; line-height:1.6; color:#3f3463; }
.dok-kitext b{ color:#2b2247; }
.dok-kilaedt{ display:flex; align-items:center; gap:9px; padding:13px 14px; font-size:13px; color:#5a3fb8; }

/* ---------- Ablegefläche ---------- */
.dok-zone{
  flex:none; margin-bottom:12px; border:1.5px dashed #d9e4f0; border-radius:12px;
  padding:20px; text-align:center; color:#6b7f96; background:#f7fafd;
  font-size:13px; cursor:pointer;
}
.dok-zone:hover{ border-color:rgb(var(--accent-rgb,26,155,219)); background:#f2f9fe; color:#0f6e9e; }
.dok-zone .material-symbols-rounded{ font-size:28px; display:block; margin-bottom:5px; }
.dok-zone b{ display:block; font-size:13.5px; color:#12233a; }
.dok-zone:hover b{ color:#0f6e9e; }
.dok-zone small{ display:block; font-size:11.5px; color:#93a5b8; margin-top:3px; }

/* ---------- Die Liste ---------- */
.dok-raum{ flex:1; min-height:0; overflow:auto; }

.dok-tab{ width:100%; border-collapse:collapse; }
.dok-tab th{
  position:sticky; top:0; z-index:1; background:#fff;
  text-align:left; font-size:10.5px; font-weight:700; letter-spacing:.07em;
  text-transform:uppercase; color:#93a5b8; padding:0 12px 9px; white-space:nowrap;
  border-bottom:1px solid #e4eaf2;
}
.dok-tab td{ padding:0 12px; border-bottom:1px solid #eef3f8; height:56px; vertical-align:middle; }
.dok-tab tbody tr{ cursor:pointer; }
.dok-tab tbody tr:hover td{ background:#f7fafd; }
.dok-tab tbody tr[aria-selected="true"] td{ background:rgba(var(--accent-rgb,26,155,219),.1); }

.dok-name{ display:flex; align-items:center; gap:11px; min-width:0; }
.dok-sym{ width:36px; height:36px; border-radius:9px; flex:none; display:grid; place-items:center; }
.dok-sym .material-symbols-rounded{ font-size:20px; }
.dok-sym.pdf{ background:#fdecea; color:#d4453c; }
.dok-sym.bild{ background:#e7f6ef; color:#1e9e6a; }
.dok-sym.office{ background:rgba(var(--accent-rgb,26,155,219),.14); color:#0f6e9e; }
.dok-sym.text{ background:#eef3f8; color:#6b7f96; }
.dok-sym.zip{ background:#fcf4e4; color:#c98a1e; }
.dok-sym.sonst{ background:#eef3f8; color:#93a5b8; }

.dok-nt{ min-width:0; }
.dok-nt b{ display:block; font-size:13.5px; font-weight:600; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.dok-nt small{ display:block; font-size:11.5px; color:#6b7f96; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; max-width:52ch; }
.dok-nt mark{ background:rgba(var(--accent-rgb,26,155,219),.26); color:inherit;
  border-radius:2px; padding:0 1px; }
.dok-warum{ color:#5a3fb8 !important; }
.dok-fehler{ color:#c98a1e !important; }
.dok-wartet{ color:#93a5b8 !important; font-style:italic; }

.dok-her{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:#6b7f96;
  max-width:30ch; }
.dok-her .material-symbols-rounded{ font-size:16px; flex:none; }
.dok-her b{ color:#12233a; font-weight:500; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; }
.dok-zahl{ font-size:12.5px; color:#6b7f96; font-variant-numeric:tabular-nums; white-space:nowrap; }

.dok-worte{ display:flex; gap:4px; flex-wrap:wrap; }
.dok-wort{
  font-size:11px; font-weight:600; padding:2px 8px; border-radius:9px;
  background:#f7fafd; color:#6b7f96; border:1px solid #e4eaf2; white-space:nowrap;
}

/* ---------- Kacheln ---------- */
.dok-kacheln{ display:grid; grid-template-columns:repeat(auto-fill,minmax(196px,1fr)); gap:12px; }
.dok-ka{
  background:#fff; border:1px solid #e4eaf2; border-radius:12px;
  overflow:hidden; cursor:pointer; display:flex; flex-direction:column;
}
.dok-ka:hover{ border-color:rgb(var(--accent-rgb,26,155,219)); }
.dok-ka[aria-selected="true"]{ border-color:rgb(var(--accent-rgb,26,155,219));
  box-shadow:0 0 0 2px rgba(var(--accent-rgb,26,155,219),.2); }
.dok-kabild{ height:112px; display:grid; place-items:center; background:#f7fafd;
  border-bottom:1px solid #eef3f8; }
.dok-kabild .material-symbols-rounded{ font-size:40px; color:#93a5b8; }
.dok-kabild.pdf .material-symbols-rounded{ color:#d4453c; }
.dok-kabild.bild .material-symbols-rounded{ color:#1e9e6a; }
.dok-kabild.office .material-symbols-rounded{ color:#0f6e9e; }
.dok-kabild.zip .material-symbols-rounded{ color:#c98a1e; }
.dok-kaleib{ padding:10px 11px; flex:1; min-width:0; }
.dok-kaleib b{ display:block; font-size:12.5px; font-weight:600; line-height:1.35;
  overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.dok-kaleib small{ display:block; font-size:11px; color:#6b7f96; margin-top:5px; }

/* ---------- Nichts da ---------- */
.dok-leer{ padding:56px 20px; text-align:center; color:#6b7f96; }
.dok-leer .material-symbols-rounded{ font-size:40px; display:block; margin-bottom:9px; color:#93a5b8; }
.dok-leer b{ display:block; font-size:14.5px; color:#12233a; margin-bottom:4px; }

/* ============================================================
   Das Blatt von rechts
   ============================================================ */
.dok-blatt{
  flex:none; width:0; border-left:1px solid #e4eaf2; background:#fff;
  display:flex; flex-direction:column; min-height:0; overflow:hidden;
  transition:width .16s ease;
}
.dok-blatt.auf{ width:360px; }
@media (prefers-reduced-motion: reduce){ .dok-blatt{ transition:none; } }

.dok-bkopf{
  flex:none; display:flex; align-items:flex-start; gap:10px; padding:14px 14px 12px;
  border-bottom:1px solid #e4eaf2;
}
.dok-bkopf .dok-nt{ flex:1; }
.dok-bkopf .dok-nt b{ white-space:normal; font-size:14px; line-height:1.35; }
.dok-bzu{
  all:unset; cursor:pointer; width:30px; height:30px; border-radius:50%; flex:none;
  display:grid; place-items:center; color:#6b7f96;
}
.dok-bzu:hover{ background:#eef3f8; color:#12233a; }
.dok-bleib{ flex:1; min-height:0; overflow:auto; padding:14px; }

.dok-nameein{
  width:100%; font:inherit; font-size:14px; font-weight:600; color:#12233a;
  border:1px solid rgb(var(--accent-rgb,26,155,219)); border-radius:7px;
  padding:3px 7px; outline:none;
}

.dok-abschnitt{ margin-bottom:16px; }
.dok-ak{
  display:flex; align-items:center; gap:7px; font-size:10.5px; font-weight:700;
  letter-spacing:.07em; text-transform:uppercase; color:#93a5b8; margin-bottom:8px;
}
.dok-ak .material-symbols-rounded{ font-size:16px; color:rgb(var(--accent-rgb,26,155,219)); }
.dok-ak.ki .material-symbols-rounded{ color:#7b5cd6; }

.dok-fazit{
  padding:11px 13px; border-radius:10px; background:#f0ecfc;
  border:1px solid rgba(123,92,214,.26); font-size:12.5px; line-height:1.6; color:#3f3463;
}
.dok-fazit .q{ display:block; margin-top:7px; font-size:11px; color:#7b6aa8; }
.dok-fazit.nein{ background:#fcf4e4; border-color:rgba(201,138,30,.3); color:#7a5512; }
.dok-fazit.wartet{ background:#f7fafd; border-color:#e4eaf2; color:#93a5b8; font-style:italic; }

.dok-zeile{ display:flex; gap:10px; padding:7px 0; font-size:12.5px; border-bottom:1px solid #eef3f8; }
.dok-zeile:last-child{ border-bottom:0; }
.dok-zeile > span:first-child{ width:104px; flex:none; color:#6b7f96; }
.dok-zeile > span:last-child{ min-width:0; word-break:break-word; }

.dok-herkunft{
  all:unset; cursor:pointer; box-sizing:border-box;
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  background:#f7fafd; border:1px solid #e4eaf2; width:100%;
}
.dok-herkunft:hover{ border-color:rgb(var(--accent-rgb,26,155,219)); background:#f2f9fe; }
.dok-herkunft .material-symbols-rounded{ font-size:20px; color:rgb(var(--accent-rgb,26,155,219)); flex:none; }
.dok-herkunft div{ min-width:0; flex:1; }
.dok-herkunft b{ display:block; font-size:12.5px; font-weight:600; }
.dok-herkunft small{ display:block; font-size:11px; color:#6b7f96; }

.dok-btn{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.dok-btn button{
  all:unset; cursor:pointer; box-sizing:border-box;
  display:flex; align-items:center; justify-content:center; gap:7px;
  padding:10px; border-radius:9px; font-size:12.5px; font-weight:600;
  background:#fff; border:1px solid #d9e4f0; color:#12233a;
}
.dok-btn button:hover{ border-color:rgb(var(--accent-rgb,26,155,219)); color:#0f6e9e; background:#f2f9fe; }
.dok-btn button.weit{ grid-column:1/-1; }
.dok-btn button.weg:hover{ border-color:#d4453c; color:#d4453c; background:#fdecea; }
/* Zweistufig löschen: der erste Klick färbt, der zweite löscht. */
.dok-btn button.scharf{ background:#d4453c; border-color:#d4453c; color:#fff; }
.dok-btn button.scharf:hover{ background:#b3362e; border-color:#b3362e; color:#fff; }
.dok-btn .material-symbols-rounded{ font-size:18px; }
.dok-btn button:focus-visible, .dok-chip:focus-visible, .dok-knopf:focus-visible,
.dok-kischalt:focus-visible, .dok-herkunft:focus-visible{
  outline:2px solid rgb(var(--accent-rgb,26,155,219)); outline-offset:2px;
}

/* Schmales Fenster: das Blatt nimmt dann die halbe Breite, sonst
   bleibt von der Liste nichts übrig. */
@media (max-width:1100px){
  .dok-blatt.auf{ width:300px; }
  .dok-nt small{ max-width:34ch; }
}

/* ============================================================
   DIE DATEIKARTE an Kontakt, Firma, Aufgabe und Webinar
   (dok-karte.js). Sie steht in fremden Blättern, darum eigene
   Klassen mit eigenem Präfix — und keine Regel, die über die
   Karte hinausgreift.
   ============================================================ */
.dkk{
  background:#fff; border:1px solid #e4eaf2; border-radius:12px;
  margin-bottom:14px; overflow:hidden; font-size:13px; color:#12233a;
}
.dkk.drueber{ border-color:rgb(var(--accent-rgb,26,155,219));
  box-shadow:0 0 0 3px rgba(var(--accent-rgb,26,155,219),.14); }
.dkk.laedt{ opacity:.6; pointer-events:none; }
.dkk *{ box-sizing:border-box; }

.dkk-kopf{ display:flex; align-items:center; gap:8px; padding:11px 13px;
  border-bottom:1px solid #eef3f8; }
.dkk-kopf .material-symbols-rounded{ font-size:19px; color:rgb(var(--accent-rgb,26,155,219)); }
.dkk-kopf b{ font-size:13px; font-weight:700; }
.dkk-z{ font-size:11px; font-weight:700; padding:1px 7px; border-radius:9px;
  background:#eef3f8; color:#6b7f96; font-variant-numeric:tabular-nums; }
.dkk-mehr{ all:unset; cursor:pointer; margin-left:auto; font-size:11.5px; font-weight:600;
  color:#6b7f96; }
.dkk-mehr:hover{ color:#0f6e9e; text-decoration:underline; }

.dkk-liste{ max-height:220px; overflow:auto; }
.dkk-leer{ padding:14px 13px; font-size:12.5px; color:#93a5b8; }
.dkk-zeile{ display:flex; align-items:center; gap:10px; padding:8px 13px;
  border-bottom:1px solid #f4f7fa; }
.dkk-zeile:last-child{ border-bottom:0; }
.dkk-zeile:hover{ background:#f7fafd; }
.dkk-sym{ width:30px; height:30px; border-radius:8px; flex:none; display:grid; place-items:center; }
.dkk-sym .material-symbols-rounded{ font-size:17px; }
.dkk-sym.pdf{ background:#fdecea; color:#d4453c; }
.dkk-sym.bild{ background:#e7f6ef; color:#1e9e6a; }
.dkk-sym.office{ background:rgba(var(--accent-rgb,26,155,219),.14); color:#0f6e9e; }
.dkk-sym.text{ background:#eef3f8; color:#6b7f96; }
.dkk-sym.zip{ background:#fcf4e4; color:#c98a1e; }
.dkk-sym.sonst{ background:#eef3f8; color:#93a5b8; }
.dkk-nt{ min-width:0; flex:1; }
.dkk-nt b{ display:block; font-size:12.5px; font-weight:600; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.dkk-nt small{ display:block; font-size:11px; color:#6b7f96; white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis; }
.dkk-lad{ all:unset; cursor:pointer; width:30px; height:30px; border-radius:50%; flex:none;
  display:grid; place-items:center; color:#93a5b8; }
.dkk-lad:hover{ background:#eef3f8; color:#0f6e9e; }
.dkk-lad .material-symbols-rounded{ font-size:18px; }

.dkk-zone{ display:flex; align-items:center; justify-content:center; gap:8px;
  padding:11px; border-top:1px dashed #e4eaf2; font-size:12.5px; color:#6b7f96; cursor:pointer; }
.dkk-zone:hover{ background:#f2f9fe; color:#0f6e9e; }
.dkk-zone .material-symbols-rounded{ font-size:18px; }
.dkk-zone:focus-visible{ outline:2px solid rgb(var(--accent-rgb,26,155,219)); outline-offset:-2px; }

/* Ohne KI-Schlüssel wird nichts gelesen — der Hinweis ist dann
   eine Feststellung und kein Fortschritt. Also ruhig statt lila,
   und ohne die pulsenden Punkte, die Arbeit versprechen. */
.dok-stand.ohne{ color:#93a5b8; }
.dok-stand.ohne .material-symbols-rounded{ font-size:17px; }
