/* ===== CRM – monday-ähnliche Oberfläche ===== */
:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --side: #292f4c;
  --side-2: #3a4166;
  --side-text: #d5d8df;
  --text: #323338;
  --muted: #676879;
  --line: #e6e9ef;
  --line-2: #d0d4e4;
  --primary: #0073ea;
  --primary-h: #0060b9;
  --primary-soft: #cce5ff;
  --danger: #e2445c;
  --ok: #00c875;
  --warn: #fdab3d;
  --row-h: 38px;
  --radius: 8px;
  --shadow: 0 6px 20px rgba(0, 0, 0, .15);
  --panel-2: #fafbfc;
  --hover: #f5f6f8;
  --hover-2: #eef0f5;
  --faint: #b0b3c2;
  --sel-bg: #e8f2ff;
  --sel-bg-2: #dcebff;
  --rel-text: #1f4f8f;
  --rel-border: #c6dcff;
  --danger-soft: #fdecef;
  --warn-bg: #fff4e0;
  --warn-text: #8a5a00;
  --warn-border: #ffe2b0;
  --toast: #323338;
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.4 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.boot-loading { display: grid; place-items: center; height: 100vh; color: var(--muted); }
[hidden] { display: none !important; }

/* ----- Buttons & Inputs ----- */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 6px 12px; cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-h); }
.btn.danger { color: var(--danger); border-color: #f3c0c8; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover-2); }
.btn.sm { padding: 3px 8px; font-size: 13px; }
.btn.big { padding: 10px 18px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 4px; color: var(--muted); line-height: 1; }
.icon-btn:hover { background: var(--hover-2); color: var(--text); }
.input, input.input, select.input, textarea.input { width: 100%; border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 10px; background: var(--panel); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
textarea.input { resize: vertical; min-height: 80px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ----- Layout ----- */
.layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.sidebar { width: 250px; flex: none; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; overflow: hidden; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; font-weight: 700; color: #fff; font-size: 16px; }
.logo-dot { width: 26px; height: 26px; border-radius: 7px; background: url(icon.svg) center/cover; display: inline-block; flex: none; vertical-align: middle; }
.side-search { margin: 6px 12px 10px; }
.side-search input { width: 100%; border: 0; border-radius: 6px; padding: 7px 10px; background: var(--side-2); color: #fff; outline: none; }
.side-search input::placeholder { color: #9aa0b8; }
.side-nav { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 6px; color: var(--side-text); cursor: pointer; text-decoration: none !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-link:hover { background: var(--side-2); color: #fff; }
.side-link.active { background: #4b5384; color: #fff; }
.side-link .ico { width: 20px; text-align: center; flex: none; }
.side-link .lbl { overflow: hidden; text-overflow: ellipsis; flex: 1; }
.side-link .cnt { font-size: 11px; opacity: .7; }
.side-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8f95b2; padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
.side-sec button { color: #c5c9db; }
.side-sec button:hover { background: var(--side-2); color: #fff; }
.side-foot { border-top: 1px solid #3b4268; padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.side-foot .who { flex: 1; overflow: hidden; }
.side-foot .who b { display: block; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .icon-btn { color: #c5c9db; }
.side-foot .icon-btn:hover { background: var(--side-2); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--panel); }
.topbar-mobile { display: none; }
.page { flex: 1; overflow: auto; padding: 24px 32px 60px; }
.page.board-page { padding: 0; display: flex; flex-direction: column; overflow: hidden; }

/* ----- Board-Kopf ----- */
.board-head { padding: 18px 28px 0; border-bottom: 1px solid var(--line); }
.board-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.board-title h1 { font-size: 24px; margin: 0; padding: 2px 6px; border-radius: 6px; cursor: text; border: 1px solid transparent; }
.board-title h1:hover { border-color: var(--line-2); }
.board-icon { font-size: 26px; cursor: pointer; border-radius: 6px; padding: 0 4px; }
.board-icon:hover { background: var(--hover-2); }
.board-desc { color: var(--muted); margin: 4px 6px 0; cursor: text; min-height: 18px; max-width: 900px; white-space: pre-wrap; }
.board-desc:empty::before { content: "Beschreibung hinzufügen …"; color: var(--faint); }
.views { display: flex; gap: 2px; margin-top: 12px; }
.views button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); }
.views button:hover { color: var(--text); }
.views button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 12px 28px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.toolbar .grow { flex: 1; }
.toolbar .search { width: 200px; }
.toolbar select.input { width: auto; padding: 5px 8px; }
.chip-filter { border: 1px solid var(--line-2); border-radius: 16px; padding: 4px 10px; background: var(--panel); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip-filter.on { background: var(--primary-soft); border-color: var(--primary); }
.view-area { flex: 1; overflow: auto; position: relative; }

/* ----- Tabelle ----- */
.tbl-scroll { padding: 18px 28px 80px; min-width: max-content; }
.group { margin-bottom: 30px; --gc: #579bfc; }
.group-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; position: sticky; left: 28px; width: max-content; max-width: calc(100vw - 340px); }
.group-head .toggle { color: var(--gc); font-size: 13px; width: 22px; }
.group-name { color: var(--gc); font-weight: 600; font-size: 17px; padding: 2px 6px; border-radius: 4px; border: 1px solid transparent; cursor: text; white-space: nowrap; }
.group-name:hover { border-color: var(--line-2); }
.group-count { color: var(--muted); font-size: 13px; }
.group.collapsed .tbl { display: none; }
.group.collapsed .group-head { background: var(--hover); border-left: 6px solid var(--gc); border-radius: 6px; padding: 8px 12px 8px 6px; }

table.tbl { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: var(--row-h); padding: 0; font-weight: normal; position: relative; background: var(--panel); overflow: hidden; }
.tbl thead th { height: 34px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--line); cursor: pointer; user-select: none; }
.tbl thead th:hover { background: var(--hover); }
.tbl thead th .th-in { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.tbl thead th.sorted .th-in::after { content: " ↓"; color: var(--primary); }
.tbl thead th.sorted.asc .th-in::after { content: " ↑"; }
.tbl .rz { position: absolute; right: -3px; top: 0; bottom: 0; width: 7px; cursor: col-resize; z-index: 2; }
.tbl .rz:hover { background: var(--primary-soft); }
.tbl .c-handle { width: 30px; min-width: 30px; max-width: 30px; border-left: 6px solid var(--gc); border-right: 0; position: sticky; left: 0; z-index: 2; }
.tbl thead .c-handle { border-top-left-radius: 6px; }
.tbl tbody tr:hover td { background: var(--hover); }
.tbl tbody tr:hover td.c-status-cell { filter: brightness(.97); }
.tbl .c-name { width: 320px; min-width: 320px; max-width: 320px; text-align: left; position: sticky; left: 64px; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.tbl thead .c-name, .tbl thead .c-handle, .tbl thead .c-sel { text-align: left; z-index: 3; }
.tbl .c-sel { width: 34px; min-width: 34px; max-width: 34px; position: sticky; left: 30px; z-index: 2; border-right: 0; text-align: center; }
.tbl thead .c-sel { text-align: center; cursor: default; }
.tbl .c-sel input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary); vertical-align: middle; }
.tbl tbody tr:not(.selected) .c-sel input:not(:checked) { opacity: .35; }
.tbl tbody tr:hover .c-sel input { opacity: 1; }
.tbl tbody tr.selected td { background: var(--sel-bg); }
.tbl tbody tr.selected:hover td { background: var(--sel-bg-2); }
.tbl thead .c-name .th-in { padding-left: 12px; }
.tbl .c-add { width: 44px; min-width: 44px; max-width: 44px; color: var(--muted); font-size: 18px; }
.tbl .c-sum { background: transparent !important; border-bottom: 0; }
.row-handle { display: flex; align-items: center; justify-content: center; height: 100%; color: transparent; cursor: grab; font-size: 14px; }
tr:hover .row-handle { color: var(--faint); }
.row-handle:hover { color: var(--text) !important; }
.name-cell { display: flex; align-items: center; height: 100%; padding: 0 6px 0 12px; gap: 6px; }
.name-cell .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.name-cell .nm:hover { color: var(--primary); }
.name-cell .open { opacity: 0; border: 1px solid var(--line-2); background: var(--panel); border-radius: 4px; font-size: 12px; padding: 1px 6px; cursor: pointer; color: var(--muted); }
tr:hover .name-cell .open { opacity: 1; }
.name-cell .bubble { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; cursor: pointer; flex: none; }
.name-cell .bubble.has { color: var(--primary); }
.name-cell input { width: 100%; border: 1px solid var(--primary); border-radius: 4px; padding: 4px 6px; outline: none; }
.tbl tr.drop-before td { box-shadow: inset 0 2px 0 var(--primary); }
.tbl tr.drop-after td { box-shadow: inset 0 -2px 0 var(--primary); }
.tbl tr.dragging td { opacity: .4; }

.add-row td { height: 36px; }
.add-row input { width: 100%; height: 100%; border: 0; padding: 0 12px; outline: none; background: transparent; }
.add-row input:focus { background: var(--panel); box-shadow: inset 0 0 0 1px var(--primary); }
.add-row td:first-child { border-bottom-left-radius: 6px; }
.sum-row td { border: 0 !important; height: 32px; background: transparent !important; }
.sum-row td.sum { font-size: 12px; color: var(--muted); text-align: center; padding: 0 6px; border: 1px solid var(--line) !important; border-top: 0 !important; background: var(--panel) !important; height: 32px; }
.sum-row .sum b { color: var(--text); font-weight: 600; display: block; font-size: 13px; line-height: 1.1; }
.dist { display: flex; height: 22px; border-radius: 3px; overflow: hidden; margin: 0 4px; }
.dist span { display: block; height: 100%; }

/* Zellen */
.cell { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; padding: 0 8px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; }
.cell.left { justify-content: flex-start; }
.cell .txt { overflow: hidden; text-overflow: ellipsis; }
.cell:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.cell.empty::after { content: ""; }
.cell.status { color: #fff; font-weight: 500; padding: 0 6px; position: relative; }
.cell.status.blank { color: transparent; background: #c4c4c4; }
.cell.status::after { content: ""; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 10px 10px 0; border-color: transparent rgba(0, 0, 0, .12) transparent transparent; opacity: 0; }
.cell.status:hover::after { opacity: 1; }
.cell input.inl { width: 100%; height: 28px; border: 1px solid var(--primary); border-radius: 4px; padding: 0 6px; outline: none; text-align: inherit; background: var(--panel); }
.cell.num { font-variant-numeric: tabular-nums; }
.cell.date.overdue { color: var(--danger); font-weight: 600; }
.cell.date.today { color: #d17c00; font-weight: 600; }
.cell.date.done { text-decoration: line-through; color: var(--muted); }
.chips { display: flex; gap: 4px; overflow: hidden; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; color: #fff; white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.chip.rel { background: var(--sel-bg); color: var(--rel-text); border: 1px solid var(--rel-border); }
.chip.more { background: var(--hover-2); color: var(--muted); }
.avatars { display: flex; }
.avatar { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; border: 2px solid var(--panel); margin-left: -6px; flex: none; }
.avatar:first-child { margin-left: 0; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.avatar.empty { background: var(--panel); color: var(--line-2); border: 1px dashed var(--line-2); }
.stars { color: var(--line-2); letter-spacing: 1px; font-size: 16px; }
.stars i { font-style: normal; cursor: pointer; }
.stars i.on { color: #fdab3d; }
.cbx { width: 20px; height: 20px; border-radius: 4px; border: 2px solid var(--line-2); display: inline-grid; place-items: center; color: #fff; font-size: 13px; }
.cbx.on { background: var(--ok); border-color: var(--ok); }

/* ----- Popover / Menüs ----- */
.pop { position: fixed; z-index: 1000; background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; min-width: 200px; max-width: 340px; max-height: 70vh; overflow: auto; border: 1px solid var(--line); }
.pop .lbl-btn { display: block; width: 100%; border: 0; color: #fff; padding: 7px 10px; margin: 0 0 5px; border-radius: 4px; cursor: pointer; text-align: center; font-weight: 500; }
.pop .lbl-btn:hover { filter: brightness(1.08); }
.pop .lbl-btn.clear { background: var(--panel); color: var(--muted); border: 1px dashed var(--line-2); }
.pop .sep { height: 1px; background: var(--line); margin: 6px -8px; }
.menu-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; cursor: pointer; white-space: nowrap; border: 0; background: none; width: 100%; text-align: left; }
.menu-item:hover { background: var(--hover-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .ico { width: 18px; text-align: center; }
.menu-item.on::after { content: "✓"; margin-left: auto; color: var(--primary); }
.opt-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; }
.opt-row:hover { background: var(--hover-2); }
.opt-row .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.opt-row .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-row.on .nm { font-weight: 600; }
.opt-row .chk { width: 16px; color: var(--primary); }
.pop .input { margin-bottom: 6px; }
.pop-title { font-size: 12px; color: var(--muted); padding: 2px 4px 6px; }

/* ----- Modal ----- */
.modal-back { position: fixed; inset: 0; background: rgba(41, 47, 76, .45); z-index: 900; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--panel); border-radius: 12px; width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal.wide { max-width: 760px; }
.modal-head { padding: 18px 22px 8px; font-size: 18px; font-weight: 600; display: flex; align-items: center; }
.modal-head .icon-btn { margin-left: auto; font-size: 18px; }
.modal-body { padding: 8px 22px; overflow: auto; }
.modal-foot { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tpl { border: 2px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.tpl:hover { border-color: var(--line-2); }
.tpl.on { border-color: var(--primary); background: var(--sel-bg); }
.tpl .t-ico { font-size: 22px; }
.tpl b { display: block; margin: 4px 0 2px; }
.tpl small { color: var(--muted); font-size: 12px; line-height: 1.35; display: block; }
.label-edit { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.label-edit .swatch { width: 28px; height: 28px; border-radius: 6px; border: 0; cursor: pointer; flex: none; }
.label-edit .done-t { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.palette { display: grid; grid-template-columns: repeat(5, 26px); gap: 6px; }
.palette button { width: 26px; height: 26px; border-radius: 5px; border: 0; cursor: pointer; }
.palette button.on { outline: 2px solid var(--text); outline-offset: 1px; }
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

/* ----- Drawer ----- */
.drawer-back { position: fixed; inset: 0; z-index: 800; background: rgba(41, 47, 76, .15); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--panel); z-index: 801; box-shadow: -8px 0 30px rgba(0, 0, 0, .15); display: flex; flex-direction: column; animation: slidein .18s ease-out; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dr-head { padding: 14px 20px 0; }
.dr-top { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dr-top .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-name { font-size: 21px; font-weight: 600; width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; margin: 6px -6px 2px; outline: none; }
.dr-name:hover { border-color: var(--line-2); }
.dr-name:focus { border-color: var(--primary); }
.dr-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 -20px; padding: 0 14px; }
.dr-tabs button { border: 0; background: none; padding: 9px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.dr-tabs button.on { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }
.dr-body { flex: 1; overflow: auto; padding: 16px 20px 40px; }
.fields { display: grid; grid-template-columns: 170px 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.fields > div { border-bottom: 1px solid var(--line); min-height: 40px; display: flex; align-items: center; }
.fields > div:nth-last-child(-n+2) { border-bottom: 0; }
.fields .f-lbl { padding: 0 12px; color: var(--muted); font-size: 13px; background: var(--panel-2); border-right: 1px solid var(--line); gap: 6px; }
.fields .f-val { padding: 0; }
.fields .f-val .cell { justify-content: flex-start; height: 40px; }
.fields .f-val .cell.status { justify-content: center; }
.fields .f-val .cell.longtext { white-space: pre-wrap; height: auto; min-height: 40px; padding: 8px; align-items: flex-start; }
.fields .f-val .chips { flex-wrap: wrap; padding: 4px 0; }
.sec-title { font-weight: 600; margin: 22px 0 8px; font-size: 14px; }
.backlinks a { display: flex; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--text); align-items: center; }
.backlinks a:hover { background: var(--hover-2); text-decoration: none; }
.backlinks small { color: var(--muted); margin-left: auto; }
.upd-new { border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; margin-bottom: 16px; }
.upd-new textarea { border: 0; width: 100%; min-height: 70px; outline: none; resize: vertical; }
.upd-new .row { display: flex; justify-content: space-between; align-items: center; }
.upd { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.upd-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.upd-h b { font-weight: 600; }
.upd-h .t { color: var(--muted); font-size: 12px; margin-left: auto; }
.upd-b { white-space: pre-wrap; word-wrap: break-word; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 10px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 14px; }
.dropzone.over { border-color: var(--primary); background: var(--sel-bg); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-bottom: 1px solid var(--line); }
.file-row .fi { font-size: 22px; }
.file-row .fn { flex: 1; overflow: hidden; }
.file-row .fn a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row img.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.act-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: flex-start; }
.act-row .t { color: var(--muted); white-space: nowrap; font-size: 12px; margin-left: auto; padding-left: 8px; }

/* ----- Kanban ----- */
.kanban { display: flex; gap: 14px; padding: 18px 28px 40px; align-items: flex-start; min-width: max-content; }
.lane { width: 270px; flex: none; background: var(--hover); border-radius: 10px; display: flex; flex-direction: column; max-height: calc(100vh - 230px); }
.lane-head { padding: 10px 12px; color: #fff; font-weight: 600; border-radius: 10px 10px 0 0; display: flex; justify-content: space-between; }
.lane-body { padding: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.lane-body.over { background: var(--sel-bg); }
.card { background: var(--panel); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); cursor: pointer; border-left: 4px solid var(--gc, #ccc); }
.card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, .12); }
.card.dragging { opacity: .4; }
.card .c-name { font-weight: 500; margin-bottom: 6px; word-wrap: break-word; }
.card .c-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.card .c-meta .date.overdue { color: var(--danger); font-weight: 600; }
.lane-add { border: 0; background: none; color: var(--muted); padding: 8px 12px; text-align: left; cursor: pointer; border-radius: 0 0 10px 10px; }
.lane-add:hover { background: var(--hover-2); color: var(--text); }

/* ----- Kalender ----- */
.cal { padding: 16px 28px 40px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { margin: 0 8px; font-size: 19px; min-width: 170px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-dow { padding: 6px 8px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal-day { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; position: relative; overflow: hidden; }
.cal-day.other { background: var(--panel-2); }
.cal-day.other .d { color: var(--faint); }
.cal-day .d { font-size: 12px; color: var(--muted); padding: 2px 4px; display: flex; justify-content: space-between; }
.cal-day.today .d b { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 6px; }
.cal-day .add { opacity: 0; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 4px; }
.cal-day:hover .add { opacity: 1; }
.cal-ev { display: block; font-size: 12px; color: #fff; padding: 2px 6px; border-radius: 4px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-ev.done { opacity: .55; text-decoration: line-through; }

/* ----- Startseite / Listen ----- */
.page h1 { font-size: 26px; margin: 0 0 4px; }
.page h2 { font-size: 17px; margin: 0 0 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 22px 0; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; background: var(--panel); }
.stat:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.red b { color: var(--danger); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 22px; }
.panel { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--panel); margin-bottom: 22px; }
.boards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.board-tile { border: 1px solid var(--line); border-radius: 10px; padding: 14px; cursor: pointer; display: flex; gap: 12px; align-items: center; color: var(--text); }
.board-tile:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, .08); text-decoration: none; }
.board-tile .bi { font-size: 26px; }
.board-tile small { color: var(--muted); display: block; }
.board-tile.new { border-style: dashed; color: var(--muted); justify-content: center; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 4px; }
.list-row:hover { background: var(--hover); }
.list-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .nm small { color: var(--muted); display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.list-row .pill { padding: 2px 8px; border-radius: 10px; color: #fff; font-size: 12px; white-space: nowrap; }
.list-row .dt { font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 70px; text-align: right; }
.list-row .dt.overdue { color: var(--danger); font-weight: 600; }
.bucket-title { font-weight: 600; margin: 22px 0 6px; display: flex; gap: 8px; align-items: center; }
.bucket-title .n { background: var(--hover-2); border-radius: 10px; font-size: 12px; padding: 0 8px; color: var(--muted); }
.empty-state { color: var(--muted); padding: 20px 6px; text-align: center; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; max-width: 1100px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.user-row .nm { flex: 1; min-width: 0; }
.user-row .nm small { color: var(--muted); display: block; }
.warn-bar { background: var(--warn-bg); color: var(--warn-text); padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--warn-border); }

/* ----- Toast ----- */
.toasts { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--toast); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); animation: fadein .15s; max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: #037f4c; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

/* ----- Login ----- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #292f4c, #4b5384); padding: 20px; }
.login-card { background: var(--panel); border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 22px; margin: 0 0 20px; display: flex; align-items: center; gap: 10px; }
.login-card .err { color: var(--danger); margin-bottom: 10px; min-height: 20px; font-size: 13px; }

/* ----- Installation ----- */
body.install { background: linear-gradient(135deg, #292f4c, #4b5384); min-height: 100vh; padding: 30px 16px; }
.install-card { background: var(--panel); max-width: 620px; margin: 0 auto; border-radius: 14px; padding: 28px 32px; box-shadow: var(--shadow); }
.install-card h1 { margin-top: 0; display: flex; align-items: center; gap: 10px; font-size: 22px; }
.install-card fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 0 0 14px; }
.install-card legend { font-weight: 600; padding: 0 6px; }
.install-card label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.install-card label input, .install-card label select { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; color: var(--text); font-size: 14px; }
.install-card label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); margin: 6px 0 18px; }
.install-card label.check input { width: auto; margin: 3px 0 0; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 18px; font-size: 13px; }
.checks .ok { color: #037f4c; }
.checks .bad { color: var(--danger); font-weight: 600; }
.err-box { background: var(--danger-soft); color: #a3162d; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.ok-box { background: #e3f9ee; color: #037f4c; border-radius: 8px; padding: 12px 14px; font-weight: 600; }
code { background: var(--hover-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

/* ----- Mobil ----- */
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 700; transform: translateX(-100%); transition: transform .2s; width: 270px; }
  body.side-open .sidebar { transform: none; box-shadow: var(--shadow); }
  body.side-open .side-shade { display: block; }
  .side-shade { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 650; }
  .topbar-mobile { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--side); color: #fff; font-weight: 600; }
  .topbar-mobile .icon-btn { color: #fff; font-size: 20px; }
  .page { padding: 16px 14px 60px; }
  .board-head { padding: 12px 14px 0; }
  .board-title h1 { font-size: 20px; }
  .toolbar { padding: 10px 14px; }
  .toolbar .search { width: 100%; order: 10; }
  .tbl-scroll { padding: 12px 14px 80px; }
  .tbl .c-name { width: 200px; min-width: 200px; max-width: 200px; }
  .group-head { left: 14px; max-width: calc(100vw - 40px); }
  .kanban { padding: 12px 14px 40px; }
  .lane { width: 250px; }
  .cal { padding: 12px 8px 40px; }
  .cal-day { min-height: 70px; }
  .cal-ev { font-size: 10px; padding: 1px 3px; }
  .home-grid, .settings-grid { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 120px 1fr; }
  .drawer { width: 100vw; }
}

/* ----- Mehrfachauswahl-Leiste ----- */
.bulk-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 750; background: var(--panel); border-radius: 12px; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); display: flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); animation: fadein .15s; max-width: calc(100vw - 20px); }
.bulk-bar .bb-count { background: var(--primary); color: #fff; padding: 10px 16px; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.bulk-bar .bb-count b { font-size: 18px; margin-right: 2px; }
.bulk-bar .bb-btn { border: 0; background: none; padding: 8px 14px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--text); white-space: nowrap; }
.bulk-bar .bb-btn .bi { font-size: 16px; }
.bulk-bar .bb-btn:hover { background: var(--hover-2); }
.bulk-bar .bb-btn.danger { color: var(--danger); }
.bulk-bar .bb-close { border: 0; border-left: 1px solid var(--line); background: none; padding: 0 16px; cursor: pointer; color: var(--muted); font-size: 16px; }
.bulk-bar .bb-close:hover { background: var(--hover-2); color: var(--text); }
.map-tbl { width: 100%; border-collapse: collapse; }
.map-tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.map-tbl td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.map-tbl td:last-child { width: 240px; }
@media (max-width: 860px) {
  .bulk-bar { bottom: 10px; }
  .bulk-bar .bb-count { padding: 8px 10px; font-size: 12px; }
  .bulk-bar .bb-btn { padding: 6px 8px; font-size: 11px; }
  .map-tbl td:nth-child(2) { display: none; }
}

/* ===== Dunkler Modus ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181b2e;
  --panel: #23273d;
  --panel-2: #292e47;
  --side: #12152a;
  --side-2: #262b47;
  --text: #f4f5fa;
  --muted: #b6bbd3;
  --faint: #6b7190;
  --line: #363b57;
  --line-2: #4a5072;
  --hover: #2b3049;
  --hover-2: #343a58;
  --primary: #3d8bfd;
  --primary-h: #5c9dff;
  --primary-soft: #23406e;
  --sel-bg: #213a62;
  --sel-bg-2: #284673;
  --rel-text: #a9c9ff;
  --rel-border: #3a5c96;
  --danger-soft: #4a2230;
  --warn-bg: #3d3216;
  --warn-text: #ffd98a;
  --warn-border: #5e4b1d;
  --toast: #3a4066;
  --shadow: 0 8px 26px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .side-link.active { background: #33395e; }
html[data-theme="dark"] .side-foot { border-top-color: #262b47; }
html[data-theme="dark"] .cell.status.blank { background: #4a5072; }
html[data-theme="dark"] .modal-back { background: rgba(5, 7, 18, .6); }
html[data-theme="dark"] .drawer-back { background: rgba(5, 7, 18, .35); }
html[data-theme="dark"] .tbl tbody tr:hover td.c-status-cell { filter: brightness(1.08); }
html[data-theme="dark"] .card { box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .ok-box { background: #173a2b; color: #6fe3a8; }
html[data-theme="dark"] .err-box { background: var(--danger-soft); color: #ff9aa9; }
html[data-theme="dark"] code { background: var(--hover-2); }
html[data-theme="dark"] .btn.danger { border-color: #6a2a3a; }
html[data-theme="dark"] .board-desc:empty::before { color: var(--faint); }
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.theme-btn { font-size: 15px; }
.dr-name { background: transparent; color: var(--text); }

/* ----- Länderflaggen ----- */
@font-face { font-family: "CRM Flags"; src: url(flags.woff) format("woff"); unicode-range: U+1F1E6-1F1FF; font-display: swap; }
.flag { font-family: "CRM Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; font-size: 1.2em; line-height: 1; margin-right: 6px; flex: none; display: inline-block; width: 1.25em; text-align: center; }
.cell.country { justify-content: flex-start !important; gap: 12px; }
.country-item { display: inline-flex; align-items: center; white-space: nowrap; }
.flag.none { opacity: .35; font-size: 1em; }
.cell.phone { gap: 8px; }
.cell.phone .country-item { min-width: 0; flex: 0 1 auto; }
.cell.phone .country-item .txt { overflow: hidden; text-overflow: ellipsis; }

/* ----- Ziehen & Ablegen ----- */
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none !important; }
.side-link { user-select: none; -webkit-user-drag: none; }
.side-link.dragging { opacity: .35; }
.tbl thead th[data-col] { cursor: grab; }
.tbl thead th.col-dragging { background: var(--sel-bg) !important; opacity: .55; }
.drag-ghost { position: fixed; z-index: 3000; pointer-events: none; background: var(--panel); color: var(--text); border: 1px solid var(--primary); border-radius: 6px; padding: 5px 10px; box-shadow: var(--shadow); font-size: 13px; white-space: nowrap; }
.drop-line { position: fixed; z-index: 2999; pointer-events: none; background: var(--primary); border-radius: 2px; }
.drop-line.h { height: 3px; }
.drop-line.v { width: 3px; }

/* ----- Touch-Geräte (Tablet/Smartphone): flüssiges Scrollen -----
   Fixierte (sticky) Zellen erzeugen auf Touch-Geräten pro Zeile eine eigene Grafikebene
   (bei 150 Einträgen > 600 Ebenen) – das ruckelt. Auf Touch-Geräten daher ohne Fixierung. */
@media (hover: none) and (pointer: coarse) {
  .tbl .c-handle, .tbl .c-sel, .tbl .c-name, .group-head { position: static !important; }
  .tbl .c-name { box-shadow: none; }
  .group-head { max-width: none; }
  .group { content-visibility: auto; contain-intrinsic-size: auto 600px; }
  .view-area, .page, .dr-body, .lane-body, .side-nav { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .tbl tbody tr:hover td { background: var(--panel); }
  .tbl tbody tr.selected:hover td, .tbl tbody tr.selected td { background: var(--sel-bg); }
  .cell:hover { box-shadow: none; }
  .row-handle { color: #a0a4b5; }
  .name-cell .open { opacity: 1; }
  .tbl .c-sel input { opacity: 1 !important; }
  .card:hover, .stat:hover, .board-tile:hover { box-shadow: none; }
  * { -webkit-tap-highlight-color: transparent; }
}

/* ===== Dokumentenablage ===== */
.docs-head { margin-bottom: 16px; }
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; align-items: start; }
.docs-aside { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.side-sec.dark { color: var(--muted); padding: 14px 10px 4px; }
.folder-btn { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--text); }
.folder-btn:hover { background: var(--hover); }
.folder-btn.on { background: var(--sel-bg); color: var(--primary); font-weight: 600; }
.folder-btn .ico { width: 20px; text-align: center; }
.folder-btn .lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-btn .cnt { font-size: 12px; color: var(--muted); }
.folder-btn.add { color: var(--muted); margin-top: 6px; }
.docs-main { min-width: 0; border-radius: 10px; }
.docs-main.over { outline: 2px dashed var(--primary); outline-offset: 6px; background: var(--sel-bg); }
.docs-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.docs-tools input[type=search] { flex: 1; min-width: 180px; width: auto; }
.docs-folder-select { display: none; width: auto; }
.docs-hint { margin: 8px 2px 10px; }
.docs-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.docs-list.compact { margin-top: 12px; }
.docs-list .empty-state { border: 0; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.doc-row:last-child { border-bottom: 0; }
.doc-row:hover { background: var(--hover); }
.doc-thumb { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 6px; background: var(--hover-2); overflow: hidden; }
.doc-thumb img.thumb { width: 46px; height: 46px; object-fit: cover; border: 0; border-radius: 0; }
.doc-thumb .fi { font-size: 24px; }
.doc-main { flex: 1; min-width: 0; }
.doc-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 3px; }
.doc-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.doc-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.chip.folder { background: var(--hover-2); color: var(--text); }
.chip.rel { cursor: pointer; }
.doc-preview { background: var(--hover); border-radius: 8px; display: grid; place-items: center; min-height: 200px; overflow: hidden; }
.doc-preview img { max-width: 100%; max-height: 68vh; display: block; }
.doc-preview iframe { width: 100%; height: 68vh; border: 0; background: #fff; }
.doc-preview.empty { padding: 30px; text-align: center; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.lbl-s { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.picker { margin-bottom: 12px; }
.picker-cur { margin-bottom: 6px; min-height: 22px; }
.picker-res { max-height: 220px; overflow: auto; }
.chip-x { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-size: 11px; }
.file-tools { display: flex; gap: 8px; align-items: stretch; }
.file-tools .dropzone { flex: 1; margin-bottom: 0; }
.file-tools .scan-btn { flex: none; }

/* Scannen */
.scan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.scan-page { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--hover-2); border: 1px solid var(--line); }
.scan-page img { width: 100%; height: 100%; object-fit: cover; }
.scan-no { position: absolute; top: 6px; left: 6px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 7px; }
.scan-act { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.scan-act button { border: 0; background: rgba(255, 255, 255, .92); color: #333; width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 13px; }
.scan-add { aspect-ratio: 3 / 4; border: 2px dashed var(--line-2); border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.scan-add span { font-size: 30px; }
.scan-add:hover { border-color: var(--primary); color: var(--primary); }

/* ===== E-Mails im Eintrag ===== */
.mail-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.mail-terms { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.mail-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.mail-row { border-bottom: 1px solid var(--line); }
.mail-row:last-child { border-bottom: 0; }
.mail-sum { display: flex; gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer; }
.mail-sum:hover { background: var(--hover); }
.mail-row.open .mail-sum { background: var(--hover); }
.mail-dir { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex: none; color: #fff; background: #00c875; }
.mail-row.out .mail-dir { background: #579bfc; }
.mail-main { flex: 1; min-width: 0; }
.mail-who { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subj { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-date { font-size: 12px; color: var(--muted); white-space: nowrap; flex: none; }
.mail-body { padding: 4px 14px 14px 46px; }
.mail-hdr { color: var(--muted); padding: 6px 0 10px; border-bottom: 1px dashed var(--line); margin-bottom: 10px; line-height: 1.6; word-break: break-word; }
.mail-hdr b { color: var(--text); font-weight: 600; }
.mail-text { white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; max-height: 420px; overflow: auto; }
.mail-atts { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.mail-att { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.mail-att > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hint-box { background: var(--sel-bg); border-radius: 8px; padding: 8px 12px; margin: -4px 0 12px; color: var(--text); }
details.adv { margin-bottom: 12px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.err-box.small, .ok-box.small { font-size: 13px; font-weight: normal; padding: 8px 12px; margin-bottom: 8px; }

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-aside { display: none; }
  .docs-folder-select { display: block; }
  .docs-tools input[type=search] { flex-basis: 100%; }
  .doc-actions .icon-btn:not(:last-child) { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .file-tools { flex-direction: column; }
  .mail-body { padding-left: 14px; }
}
.dr-tabs { overflow-x: auto; scrollbar-width: none; }
.dr-tabs::-webkit-scrollbar { display: none; }
.dr-tabs button { white-space: nowrap; flex: none; }
