/* ============================================================
   Dateimanager-Modul — Styles (Cockpit-Design-Tokens)
   ============================================================ */

.dm-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.dm-head .dm-title h1 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.dm-head .dm-title h1 .icon { width: 22px; height: 22px; color: var(--brand); }
.dm-head .dm-title p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.dm-head-actions { margin-left: auto; display: flex; gap: 8px; }

/* Buttons */
.dm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s;
}
.dm-btn:hover { background: var(--bg); }
.dm-btn .icon { width: 16px; height: 16px; }
.dm-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.dm-btn-primary:hover { background: var(--brand-dark); }
.dm-btn-sm { padding: 7px 9px; }
.dm-btn-link { border: none; background: none; color: var(--text-muted); padding: 6px 8px; margin-top: 6px; font-size: 12px; text-decoration: underline; }
.dm-btn-link:hover { color: var(--brand); background: none; }

/* Karten (Intro / Loading / Error) */
.dm-card {
  max-width: 520px; margin: 40px auto; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 28px;
}
.dm-card-icon { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 14px;
  background: var(--brand-soft); display: flex; align-items: center; justify-content: center; }
.dm-card-icon .icon, .dm-card-icon [data-lucide] { width: 28px; height: 28px; color: var(--brand); }
.dm-card h2 { margin: 0 0 8px; font-size: 17px; }
.dm-card p { margin: 0 0 18px; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.dm-card-error .dm-card-icon { background: #fdecec; }
.dm-card-error .dm-card-icon .icon { color: #d9534f; }
.dm-err { color: #b3261e; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-word; }

/* Drei-Pane-Layout (Standalone-Dateimanager): A | B | Vorschau */
.dm-three { display: flex; gap: 0; height: calc(100vh - 170px); }

/* Ziehgriff zwischen den Panes (Breite verstellbar) */
.dm-gutter { flex: 0 0 14px; align-self: stretch; cursor: col-resize; position: relative; touch-action: none; }
.dm-gutter::before { content: ''; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 3px; height: 40px; border-radius: 3px; background: var(--border-strong); transition: background .12s, height .12s; }
.dm-gutter:hover::before { background: var(--brand); height: 72px; }
.dm-gutter.dm-gutter-off { cursor: default; }
.dm-gutter.dm-gutter-off::before { display: none; }
body.dm-resizing { cursor: col-resize; user-select: none; }
body.dm-resizing iframe { pointer-events: none; }
.dm-panewrap { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dm-paneside { display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); border-bottom: 1px solid var(--border); background: var(--bg); flex-shrink: 0; }
.dm-paneside-lbl { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-pane-collapse { border: none; background: none; cursor: pointer; color: var(--text-dim); padding: 2px; border-radius: 4px; display: flex; flex-shrink: 0; }
.dm-pane-collapse .icon { width: 15px; height: 15px; }
.dm-pane-collapse:hover { color: var(--brand); background: var(--surface); }
.dm-panebody { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; container-type: inline-size; }

/* Kollabierter Pane: schmaler Streifen mit vertikaler Beschriftung */
.dm-pane-expandbar { display: none; }
.dm-panewrap.dm-collapsed { flex: 0 0 42px; min-width: 42px; cursor: pointer; }
.dm-panewrap.dm-collapsed > .dm-paneside,
.dm-panewrap.dm-collapsed > .dm-panebody,
.dm-panewrap.dm-collapsed > .dm-preview-body { display: none; }
.dm-panewrap.dm-collapsed > .dm-pane-expandbar { display: flex; flex-direction: column; align-items: center; gap: 12px;
  height: 100%; padding: 12px 0; color: var(--text-muted); }
.dm-panewrap.dm-collapsed > .dm-pane-expandbar:hover { color: var(--brand); background: var(--bg); }
.dm-pane-expandbar .icon { width: 16px; height: 16px; flex-shrink: 0; }
.dm-pane-vlabel { writing-mode: vertical-rl; text-orientation: mixed; font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }

/* Vorschau-Pane */
.dm-pane-preview .dm-preview-side .dm-preview-title { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.dm-pane-preview .dm-preview-actions { display: flex; gap: 6px; flex-shrink: 0; margin: 0; }
.dm-pane-preview .dm-preview-body { flex: 1; min-height: 0; background: var(--bg); display: flex; overflow: auto; }
.dm-preview-empty { margin: auto; max-width: 240px; text-align: center; color: var(--text-dim); font-size: 12.5px; padding: 24px; }
.dm-preview-empty .icon { width: 26px; height: 26px; margin-bottom: 10px; color: var(--text-dim); }
.dm-modes { display: flex; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; overflow-x: auto; }
.dm-modetab { display: inline-flex; align-items: center; gap: 5px; flex: 1 1 auto; min-width: 0; justify-content: center;
  padding: 6px 8px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  font-size: 11.5px; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.dm-modetab:hover { background: var(--bg); }
.dm-modetab.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.dm-modetab .icon { width: 14px; height: 14px; flex-shrink: 0; }
.dm-modetab-lbl { overflow: hidden; text-overflow: ellipsis; }
.dm-modes + .dm-picker, .dm-modes + .dm-crumb { border-top: none; }
/* Schmale Pane (Laptop, zwei Fenster): nur Icons + Tooltip, damit alle Modi reinpassen */
@container (max-width: 560px) {
  .dm-modetab-lbl { display: none; }
  .dm-modetab { flex: 0 0 auto; padding: 7px 9px; }
}

/* Mail-Liste */
.dm-mailrow { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--radius-sm); cursor: grab; }
.dm-mailrow:hover { background: var(--bg); }
.dm-mailrow.dm-dragging { opacity: .45; }
.dm-mailrow > .dm-ic { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
.dm-mailtext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-mailprev { cursor: pointer; }
.dm-mailprev:hover .dm-mailsubj { color: var(--brand); }
.dm-mailsubj { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-mailfrom { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-clip { width: 14px; height: 14px; color: var(--text-dim); flex-shrink: 0; }
/* Entwurf-Zeile (Ordner „Entwürfe") */
.dm-draftrow { cursor: pointer; }
.dm-draftrow > .dm-ic { color: #d97706; }
.dm-draft-badge { flex-shrink: 0; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  background: #fef3c7; color: #92400e; }
/* Gelesen/Ungelesen */
.dm-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; }
.dm-mailrow.dm-unread .dm-unread-dot { background: var(--brand); }
.dm-mailrow.dm-unread .dm-mailsubj { font-weight: 700; }
.dm-mailrow.dm-unread .dm-mailfrom { color: var(--text); }
.dm-mailrow:not(.dm-unread) .dm-mailsubj { font-weight: 400; }
.dm-mailrow:not(.dm-unread) > .dm-ic { color: var(--text-dim); }
.dm-mailtree, .dm-mailatts { list-style: none; margin: 0; padding: 0; }
.dm-mailatts { padding-left: 22px; }
/* Thread-Verlauf: Nachrichten als Zeilen, Anhänge als Pillen-Block (visuell getrennt) */
.dm-threadmsgs { list-style: none; margin: 2px 0 6px; padding: 0 0 0 22px; }
.dm-threadmsgrow { cursor: pointer; }
.dm-threadmsgrow:hover { background: var(--bg); }
.dm-thread-atts { margin: 4px 8px 6px 22px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dm-thread-atts-lbl { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }
.dm-thread-atts-lbl .icon { width: 13px; height: 13px; }
.dm-mailrow .dm-caret { width: 15px; height: 15px; color: var(--text-dim); cursor: pointer; flex-shrink: 0; transition: transform .15s; }
.dm-mailrow .dm-act { opacity: 0; }
.dm-mailrow:hover .dm-act { opacity: 1; }
.dm-attrow .dm-ic { color: var(--text-dim); }

/* Vorschau-Fenster */
.dm-preview-dlg { background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 48px rgba(0,0,0,.3);
  width: 90vw; max-width: 1100px; height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.dm-preview-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dm-preview-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-preview-actions { margin-left: auto; display: flex; gap: 8px; }
.dm-preview-body { flex: 1; min-height: 0; background: var(--bg); display: flex; }
.dm-preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
/* Mail-Vorschau: Kopf (An/Cc/Betreff) + Anhang-Pillen über dem Body */
.dm-mailview { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
/* Aktions-Header der Mail-Vorschau: Antworten/Weiterleiten klar getrennt von Ablegen/Archivieren */
.dm-mailbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--bg); }
.dm-mailbar-grp { display: flex; align-items: center; gap: 6px; }
.dm-mailbar-grp + .dm-mailbar-grp { border-left: 1px solid var(--border-strong); padding-left: 12px; }
.dm-mb-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 5px 9px; font-size: 12.5px; cursor: pointer; }
.dm-mb-btn:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.dm-mb-btn .icon { width: 15px; height: 15px; }
/* dezenter „Anzeigen"-Pfeil rechts in der Thread-Zeile (Aktionen sind im Vorschau-Header) */
.dm-rowgo { width: 15px; height: 15px; color: var(--text-dim); flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.dm-mailrow:hover .dm-rowgo { opacity: .7; }
.dm-mailhdr { flex-shrink: 0; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.dm-mh-row { display: flex; gap: 8px; padding: 1px 0; font-size: 13px; }
.dm-mh-lbl { flex: 0 0 52px; color: var(--text-dim); font-size: 12px; }
.dm-mh-val { color: var(--text); min-width: 0; word-break: break-word; }
.dm-mh-subj { font-weight: 600; }
.dm-mh-atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dm-att-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); color: var(--text); cursor: grab; }
.dm-att-pill:hover { border-color: var(--brand); color: var(--brand-dark); background: var(--brand-soft); }
.dm-att-pill.dm-dragging { opacity: .45; }
.dm-att-pill .icon { width: 13px; height: 13px; color: var(--brand); }
.dm-att-sz { color: var(--text-dim); }
.dm-preview-img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.dm-picker { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dm-picker .dm-liblist { flex: 1; overflow-y: auto; padding: 6px; }
.dm-paneswitch { padding: 8px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dm-treehost { flex: 1; min-height: 0; overflow: auto; }

/* Baum-Suche (rekursiv in der aktuellen Bibliothek) */
.dm-treesearchbar { background: var(--surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.dm-search.dm-ts { padding: 8px 12px; }
.dm-ts-clear { border: none; background: none; cursor: pointer; color: var(--text-dim); padding: 2px; border-radius: 4px; display: flex; flex-shrink: 0; }
.dm-ts-clear .icon { width: 15px; height: 15px; }
.dm-ts-clear:hover { color: var(--brand); background: var(--bg); }
.dm-tree.dm-results { padding-top: 4px; }
.dm-rescount { list-style: none; padding: 6px 10px 8px; font-size: 11px; color: var(--text-dim); }
.dm-resrow .dm-restext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dm-resrow .dm-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-respath { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-respath-root { font-style: italic; }
.dm-resrow .dm-open-sp { flex-shrink: 0; margin-left: 4px; }

/* Breadcrumb (Site / Bibliothek) */
.dm-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; font-size: 12px; background: var(--bg); }
.dm-crumb-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border-strong);
  background: var(--surface); border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer; color: var(--text); font-size: 12px; flex-shrink: 0; }
.dm-crumb-btn:hover { background: var(--bg); color: var(--brand); }
.dm-crumb-btn.active { background: var(--brand-soft); color: var(--brand-dark); border-color: var(--brand); }
.dm-out { color: var(--brand); font-weight: 700; }
.dm-wv-date { color: var(--brand-dark); font-weight: 600; }
.dm-mailrow.dm-wv-due { background: #fff7ed; }
.dm-mailrow.dm-wv-due .dm-wv-date { color: #c2410c; }
/* Wiedervorlage-Dialog: Wochenleiste + Uhr */
.dm-wv-days { display: flex; gap: 4px; margin: 4px 0 2px; }
.dm-wv-day { flex: 1; padding: 7px 0; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; color: var(--text-muted); }
.dm-wv-day:hover { background: var(--bg); }
.dm-wv-day.sel { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); font-weight: 600; }
.dm-wv-clockrow { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.dm-wv-clocksvg { width: 124px; height: 124px; flex-shrink: 0; }
.dm-wv-face { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2; }
.dm-wv-hand { stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
.dm-wv-center { fill: var(--brand); }
.dm-wv-hr { fill: transparent; cursor: pointer; }
.dm-wv-hr:hover { fill: var(--bg); }
.dm-wv-hr.sel { fill: var(--brand-soft); stroke: var(--brand); }
.dm-wv-hrt { font-size: 11px; fill: var(--text); cursor: pointer; user-select: none; }
.dm-wv-time { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dm-wv-time #dm-wv-timelbl { font-size: 22px; font-weight: 700; color: var(--text); }
.dm-crumb-btn .icon { width: 13px; height: 13px; }
.dm-crumb-cur { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-lib .icon { width: 16px; height: 16px; color: var(--g-objekt-bd); flex-shrink: 0; }

/* Body: Sidebar + Pane (Legacy-Single-Pane, ungenutzt) */
.dm-body { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 170px); }
.dm-side { display: flex; flex-direction: column; min-height: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.dm-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dm-search .icon { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.dm-search input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: var(--text); }
.dm-libcount { padding: 6px 12px; font-size: 11px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.dm-liblist { overflow-y: auto; flex: 1; padding: 6px; }
.dm-lib {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 9px; border: none; background: none; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--text); font-size: 13px;
}
.dm-lib:hover { background: var(--bg); }
.dm-lib.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.dm-lib .icon { width: 16px; height: 16px; color: var(--g-objekt-bd); flex-shrink: 0; }
.dm-lib-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-lib.has-sub { align-items: flex-start; }
.dm-lib-text { display: flex; flex-direction: column; min-width: 0; }
.dm-lib-sub { font-size: 10.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); cursor: pointer; user-select: none; }
.dm-toggle input { accent-color: var(--brand); }

/* Site-Baum (Subsites genested) */
.dm-stree, .dm-schildren { list-style: none; margin: 0; padding: 0; }
.dm-schildren { padding-left: 18px; }
.dm-srow { display: flex; align-items: center; gap: 2px; }
.dm-srow .dm-caret { width: 15px; height: 15px; color: var(--text-dim); cursor: pointer; flex-shrink: 0; transition: transform .15s; }
.dm-srow .dm-caret-spacer { width: 15px; flex-shrink: 0; }
.dm-srow .dm-lib { flex: 1; }
.dm-lib.dm-virtual { cursor: default; color: var(--text-dim); }
.dm-lib.dm-virtual:hover { background: none; }
/* Bibliotheks-Knoten im Site-Baum (Sites → Bibliotheken → Ordner inline) */
.dm-libnode > .dm-srow > .dm-lib .icon { color: var(--brand); }
.dm-libchildren { padding-left: 16px; }
.dm-srow .dm-open-sp { opacity: 0; padding: 2px; border-radius: 4px; flex-shrink: 0; transition: opacity .12s; }
.dm-srow:hover .dm-open-sp { opacity: 1; }
.dm-srow .dm-open-sp .icon { width: 14px; height: 14px; }

/* Projektmanager: Objektliste (Anlehnung an Objekte-Modul) */
.dm-objrow { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 7px 9px; border: none; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--text); }
.dm-objrow:hover { background: var(--bg); }
.dm-obj-nr { flex-shrink: 0; font-weight: 600; font-size: 12px; padding: 2px 7px; border-radius: 5px;
  background: var(--bg); color: var(--text-muted); border-left: 3px solid var(--border-strong); }
.dm-obj-nr.st-submission { border-left-color: #9aa7b4; }
.dm-obj-nr.st-offerte { border-left-color: #e0a800; }
.dm-obj-nr.st-auftrag { border-left-color: var(--brand); }
.dm-obj-nr.st-abgeschlossen { border-left-color: #5cb85c; }
.dm-obj-nr.st-archiv { border-left-color: #b0b8c0; }
.dm-obj-nr.st-inv { border-left-color: #6366f1; }
.dm-emp-av { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  background: var(--brand-soft); color: var(--brand-dark); }
.dm-pers-bar { display: flex; gap: 6px; align-items: stretch; }
.dm-pers-bar .dm-search { flex: 1; min-width: 0; }
.dm-pers-status { flex-shrink: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 12px; padding: 0 6px; cursor: pointer; }
.dm-pers-former { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; vertical-align: middle; background: #fdecea; color: #b3261e; }
.dm-obj-text { display: flex; flex-direction: column; min-width: 0; }
.dm-obj-title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-obj-sub { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pane */
.dm-pane { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; min-height: 0; }
.dm-pane-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim); gap: 10px; }
.dm-pane-empty [data-lucide] { width: 34px; height: 34px; }
.dm-pane-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--surface); border-bottom: 1px solid var(--border); }
.dm-pane-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.dm-pane-title .icon { width: 18px; height: 18px; color: var(--g-objekt-bd); }
.dm-pane-title { margin-right: auto; }
.dm-up { border: none; background: none; cursor: pointer; color: var(--text-muted); display: flex; padding: 4px; border-radius: var(--radius-sm); }
.dm-up .icon { width: 16px; height: 16px; }
.dm-up:hover { color: var(--brand); background: var(--bg); }
.dm-open-sp { color: var(--text-muted); display: flex; }
.dm-open-sp .icon { width: 16px; height: 16px; }
.dm-open-sp:hover { color: var(--brand); }

/* Tree */
.dm-tree, .dm-children { list-style: none; margin: 0; padding: 0; }
.dm-tree { padding: 8px 6px 16px; }
.dm-children { padding-left: 20px; }
.dm-row { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: var(--radius-sm);
  font-size: 13px; cursor: default; }
.dm-folder > .dm-row { cursor: pointer; }
.dm-row:hover { background: var(--bg); }
.dm-caret { width: 15px; height: 15px; color: var(--text-dim); transition: transform .15s; flex-shrink: 0; }
.dm-caret-spacer { width: 15px; flex-shrink: 0; }
.dm-ic { width: 16px; height: 16px; flex-shrink: 0; }
.dm-folder > .dm-row .dm-ic { color: var(--g-objekt-bd); }
.dm-file .dm-ic { color: var(--text-dim); }
/* Typ-spezifische Datei-Icons (gleiche Spezifität wie .dm-file .dm-ic / .dm-attrow .dm-ic → später platziert gewinnt) */
.dm-ic.dm-fi-pdf { color: #dc2626; }
.dm-ic.dm-fi-word { color: #2563eb; }
.dm-ic.dm-fi-excel { color: #16a34a; }
.dm-ic.dm-fi-ppt { color: #ea580c; }
.dm-ic.dm-fi-img { color: #7c3aed; }
.dm-ic.dm-fi-zip { color: #b45309; }
.dm-ic.dm-fi-media { color: #db2777; }
.dm-ic.dm-fi-cad { color: #0891b2; }
.dm-ic.dm-fi-skp { color: #4f46e5; }
.dm-ic.dm-fi-geo { color: #059669; }
.dm-ic.dm-fi-visio { color: #4338ca; }
.dm-ic.dm-fi-project { color: #0ea5e9; }
.dm-ic.dm-fi-design { color: #c026d3; }
.dm-ic.dm-fi-data { color: #0f766e; }
.dm-ic.dm-fi-cert { color: #ca8a04; }
.dm-ic.dm-fi-font { color: #334155; }
.dm-ic.dm-fi-disk { color: #6b7280; }
.dm-ic.dm-fi-exec { color: #334155; }
.dm-ic.dm-fi-cal { color: #0d9488; }
.dm-ic.dm-fi-contact { color: #0891b2; }
.dm-ic.dm-fi-book { color: #b45309; }
.dm-ic.dm-fi-code { color: #475569; }
.dm-ic.dm-fi-txt { color: #64748b; }
.dm-ic.dm-fi-mail { color: #0099cc; }
.dm-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-filelink { color: var(--text); text-decoration: none; }
.dm-filelink:hover { color: var(--brand); text-decoration: underline; }
.dm-count { font-size: 10px; color: var(--text-dim); background: var(--bg); padding: 1px 6px; border-radius: 8px; }
.dm-meta { margin-left: auto; font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.dm-dl { color: var(--text-muted); display: flex; flex-shrink: 0; }
.dm-dl .icon { width: 15px; height: 15px; }
.dm-dl:hover { color: var(--brand); }

/* Zeilen-Aktionen (Umbenennen / Löschen) — erst bei Hover sichtbar */
.dm-actions { display: inline-flex; gap: 2px; flex-shrink: 0; opacity: 0; transition: opacity .12s; }
.dm-row:hover .dm-actions { opacity: 1; }
.dm-act { border: none; background: none; cursor: pointer; color: var(--text-dim); display: flex; padding: 3px; border-radius: 4px; }
.dm-act .icon { width: 14px; height: 14px; }
.dm-act:hover { color: var(--brand); background: var(--surface); }
.dm-file .dm-act:hover, .dm-folder .dm-act:hover { background: rgba(0,0,0,.05); }

/* Eingabefeld im Dialog */
.dm-input { width: 100%; box-sizing: border-box; padding: 9px 11px; font-size: 14px; margin: 4px 0 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); outline: none; }
.dm-input:focus { border-color: var(--brand); }
.dm-btn-danger { background: #d9534f; border-color: #d9534f; color: #fff; }
.dm-btn-danger:hover { background: #c33; }
.dm-empty, .dm-loading-row, .dm-err { padding: 6px 10px; font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.dm-err { color: #b3261e; }

/* Eingebettet im Objekt-Detail */
.dm-embed { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  max-height: 420px; overflow: auto; }
.dm-embed .dm-pane-head { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.dm-embed-loading, .dm-embed-empty, .dm-embed-login { display: flex; align-items: center; gap: 10px;
  padding: 18px 16px; color: var(--text-muted); font-size: 13px; }
.dm-embed-empty { color: var(--text-dim); }
.dm-embed-empty .icon { width: 18px; height: 18px; flex-shrink: 0; }
.dm-embed-login { flex-direction: column; align-items: flex-start; gap: 10px; }
.dm-embed-login p { margin: 0; }

/* Drag & Drop */
.dm-row[draggable="true"] { cursor: grab; }
.dm-row.dm-dragging { opacity: .45; }
.dm-row.dm-drop-hover, .dm-pane-head.dm-drop-hover, .dm-mailrow.dm-drop-hover { background: var(--brand-soft); outline: 2px dashed var(--brand); outline-offset: -2px; border-radius: var(--radius-sm); }
.dm-tree.dm-drop-hover { outline: 2px dashed var(--brand); outline-offset: -4px; border-radius: var(--radius-sm); background: var(--brand-soft); }
.dm-row.dm-selected { background: var(--brand-soft); box-shadow: inset 2px 0 0 var(--brand); }

/* Transfer-Dialog */
/* align-items:flex-start + overflow-y:auto + margin:auto am Dialog: kleine Dialoge bleiben zentriert,
   zu hohe Dialoge sind vollständig scrollbar (kein abgeschnittener Kopf mehr). */
.dm-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(20,30,40,.35);
  display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow-y: auto; }
.dm-dialog { background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,.22);
  width: 100%; max-width: 440px; padding: 22px 24px; margin: auto; }
.dm-dialog h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.dm-dialog h3 .icon { width: 18px; height: 18px; color: var(--brand); }
.dm-dlg-target { margin: 0 0 6px; font-size: 14px; color: var(--text); }
.dm-dlg-note { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-muted);
  background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px; margin: 8px 0 0; }
.dm-dlg-note .icon { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.dm-dlg-note.dm-dedup { background: #fef3c7; color: #92400e; }
.dm-dlg-note.dm-dedup .icon { color: #d97706; }
.dm-fmt { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.dm-fmt label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.dm-attsel { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 4px; }
.dm-fmt-hint { font-size: 11px; color: var(--text-muted); }
.dm-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 4px 0 2px; }
.dm-dlg-actions { display: flex; gap: 8px; align-items: center; margin-top: 18px; }
.dm-dlg-actions .dm-btn-link { margin-left: auto; margin-top: 0; }

/* Mail-Composer */
.dm-composer { max-width: 560px; }
/* Empfänger-Autovervollständigung */
.dm-ac-wrap { position: relative; }
.dm-ac { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 5;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.16); max-height: 260px; overflow-y: auto; }
.dm-ac-item { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; cursor: pointer; }
.dm-ac-item:hover, .dm-ac-item.sel { background: var(--brand-soft); }
.dm-ac-name { font-size: 13px; color: var(--text); }
.dm-ac-mail { font-size: 11px; color: var(--text-dim); }
.dm-comp-lbl { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin: 10px 0 0; }
.dm-comp-body { resize: vertical; min-height: 120px; font-family: inherit; line-height: 1.45; }
.dm-comp-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.dm-comp-att { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 4px 9px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); }
.dm-comp-att .icon { width: 13px; height: 13px; color: var(--brand); }

/* Entwurf-Pane-Modus */
.dm-entw { display: flex; flex-direction: column; gap: 2px; padding: 12px; overflow: auto; flex: 1; }
.dm-entw .dm-comp-lbl { margin-top: 8px; }
.dm-entw-attbar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.dm-entw-dropzone { min-height: 46px; align-items: center; padding: 8px; margin-top: 6px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.dm-entw-dropzone.dm-drop-hover { border-color: var(--brand); background: var(--bg); }
.dm-entw.dm-drop-hover { outline: 2px dashed var(--brand); outline-offset: -6px; }
.dm-entw-hint { font-size: 12px; color: var(--text-muted); }
.dm-entw-replyhint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--brand);
  background: var(--bg); border-radius: var(--radius-sm); padding: 7px 10px; margin-bottom: 4px; }
.dm-entw-replyhint .icon { width: 14px; height: 14px; }
.dm-sig-preview { margin-top: 6px; padding: 8px 10px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: #fff; max-height: 220px; overflow: auto; }
.dm-sig-preview img { max-width: 100%; height: auto; }
.dm-sig-box { transform-origin: top left; }
.dm-att-x { display: inline-flex; align-items: center; border: none; background: none; cursor: pointer;
  padding: 0; margin-left: 2px; color: var(--text-muted); }
.dm-att-x:hover { color: var(--danger, #c0392b); }
.dm-att-x .icon { width: 12px; height: 12px; }

/* Spinner */
.dm-spinner { width: 28px; height: 28px; margin: 0 auto 14px; border: 3px solid var(--border);
  border-top-color: var(--brand); border-radius: 50%; animation: dm-spin .8s linear infinite; }
.dm-spinner.sm { width: 14px; height: 14px; margin: 0; border-width: 2px; display: inline-block; }
@keyframes dm-spin { to { transform: rotate(360deg); } }

/* Serienmail-Dialog (Mailcreator) */
.dm-dialog.dm-serial { width: 560px; max-width: 92vw; text-align: left; }
.dm-serial-l { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-muted); margin: 10px 0; }
.dm-serial-l textarea.dm-input { resize: vertical; min-height: 120px; font-family: inherit; }
