:root {
  --bg: #f6f7f9; --surface: #fff; --text: #1d2330; --muted: #667085; --line: #e3e6eb;
  --accent: #2563eb; --accent-text: #fff; --danger: #c0352b; --warn-bg: #fff4e5;
  --radius: 8px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14171c; --surface: #1d2129; --text: #e7e9ee; --muted: #9aa3b2; --line: #2e3440;
          --accent: #5b8cff; --danger: #ff6b5e; --warn-bg: #3a2c15; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
.topbar { display: flex; gap: 2rem; align-items: center; padding: .75rem 1.5rem;
          background: var(--header-bg, var(--surface)); color: var(--header-text, var(--text));
          border-bottom: 1px solid var(--line);
          /* eigene Ebene über der mitlaufenden Suchleiste der Listen, damit das Benutzermenü davor liegt */
          position: relative; z-index: 40; }
.topbar a, .topbar button.link { color: var(--header-link, var(--accent)); }
.topbar .brand { font-weight: 700; font-size: 1.1rem; color: var(--header-text, var(--text));
                 display: flex; align-items: center; gap: .6rem; }
.brand .logo { height: 32px; max-width: 200px; object-fit: contain; display: block; }
/* Auf der Anmeldeseite steht das Logo auf der Kopfzeilenfarbe, damit helle Logos lesbar bleiben. */
.auth .brand { justify-content: center; background: var(--header-bg, transparent); color: var(--header-text, var(--text));
               padding: .75rem 1rem; border-radius: var(--radius); }
.auth .brand .logo { height: 56px; max-width: 260px; }
.topbar nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }
/* Persönliche Einstellung „Seitenbreite: Volle Bildschirmbreite“ */
.container.wide { max-width: none; padding-left: 2rem; padding-right: 2rem; }
.pagehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sub { color: var(--muted); margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.25rem; margin: 1rem 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem;
        display: flex; flex-direction: column; color: var(--text); }
.stat strong { font-size: 1.5rem; }
.stat span { color: var(--muted); }
.badge { display: inline-block; padding: 0 .5rem; border-radius: 999px; background: var(--bg);
         border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
input, select, textarea, button, .button { font: inherit; }
input, select, textarea { width: 100%; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 6px;
                          background: var(--surface); color: var(--text); }
input[type=search] { margin: 1rem 0; }
button, .button { display: inline-block; padding: .45rem .9rem; border-radius: 6px; border: 1px solid var(--accent);
                  background: var(--accent); color: var(--accent-text); cursor: pointer; }
.button.secondary { background: transparent; color: var(--accent); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.link { background: none; border: none; color: var(--accent); padding: 0; }
form.inline { display: inline; }
.form .fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem 1rem; margin-bottom: .75rem; }
.form label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; }
.actions { display: flex; gap: .75rem; align-items: center; margin-top: .75rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.list th, table.list td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; }
dl { display: grid; grid-template-columns: 9rem 1fr; gap: .35rem 1rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }
.notes { white-space: pre-wrap; border-top: 1px solid var(--line); padding-top: .75rem; }
ul.plain { list-style: none; padding: 0; margin: 0 0 1rem; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.timeline { list-style: none; padding: 0; margin: 1rem 0; }
.activity { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem; margin-bottom: .5rem; }
.activity .meta { color: var(--muted); font-size: .85rem; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.activity .subject { font-weight: 600; }
.activity .body { white-space: pre-wrap; }
.activity.done .subject { text-decoration: line-through; color: var(--muted); }
.activity.overdue { background: var(--warn-bg); }
.activity-form .row { display: grid; grid-template-columns: 9rem 1fr 14rem; gap: .5rem; margin-bottom: .5rem; }
.activity-form textarea { margin-bottom: .5rem; }
.empty { color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: .75rem; overflow-x: auto; }
.column h2 { font-size: 1rem; }
.card.deal { display: flex; flex-direction: column; gap: .15rem; margin-bottom: .5rem; color: var(--text); padding: .6rem .8rem; }
@media (max-width: 700px) {
  .activity-form .row { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 220px); }
  dl { grid-template-columns: 1fr; }
}
.card > h2:first-child, .card > .pagehead:first-child h2 { margin-top: 0; }
.usermenu { margin-left: auto; position: relative; }
.usermenu summary { list-style: none; cursor: pointer; color: var(--header-link, var(--accent)); display: flex; align-items: center; gap: .35rem; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary::after { content: ""; border: 5px solid transparent; border-top-color: currentColor; margin-top: 5px; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + .6rem); z-index: 20; width: 280px; background: var(--surface);
                  color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem;
                  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; gap: .6rem; }
.usermenu .menu a, .usermenu .menu button.link { color: var(--accent); }
.usermenu .who { margin: 0; font-weight: 600; display: flex; flex-direction: column; }
.usermenu .who .sub { font-weight: 400; font-size: .85rem; }
.usermenu .version { font-size: .8rem; }
.usermenu .form label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .85rem; margin-bottom: .4rem; }
.usermenu form { margin: 0; }
.usermenu .menu > a, .usermenu .menu > form:last-child { border-top: 1px solid var(--line); padding-top: .6rem; }
.auth { max-width: 400px; margin: 10vh auto; padding: 0 16px; }
.auth .brand { font-weight: 700; font-size: 1.3rem; text-align: center; display: flex; align-items: center; gap: .6rem; }
.auth .form label, .form.narrow label { margin-bottom: .75rem; }
.form.narrow { max-width: 480px; }
.alert { background: var(--warn-bg); border: 1px solid var(--danger); color: var(--text); padding: .5rem .75rem; border-radius: 6px; }
.success { border: 1px solid var(--line); background: var(--bg); padding: .5rem .75rem; border-radius: 6px; }
.checks { display: flex; gap: 1.5rem; margin: .5rem 0 1rem; }
.checks label { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); }
.checks input { width: auto; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: .75rem 0 1rem; flex-wrap: wrap; }
.tabs a { padding: .5rem .9rem; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.badge.ok { border-color: var(--accent); color: var(--accent); }
.inline-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form label { flex: 1 1 220px; display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; }
.card + .card, .card + form, form + .card { margin-top: 1rem; }
.modules td { vertical-align: middle; }
.modules .switch { display: flex; align-items: center; gap: .4rem; }
.modules .switch input, .checks input { width: auto; }
.planned { opacity: .65; }
.mfa-setup ol { padding-left: 1.25rem; }
.mfa-setup li { margin-bottom: 1rem; }
.qr { background: #fff; display: inline-block; padding: 8px; border-radius: 6px; margin: .5rem 0; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.1rem; }
.codes li { padding: .25rem 0; }
.langs { text-align: center; display: flex; gap: 1rem; justify-content: center; }
.langs a.active { font-weight: 600; color: var(--text); }
button.secondary { background: transparent; color: var(--accent); }
.modules .switch { white-space: nowrap; flex-direction: row; color: var(--text); }
.mfa-setup .qr { display: block; width: fit-content; }
.mfa-setup .inline-form label { max-width: 240px; }
.design-logo .logo-row { display: flex; gap: 1.5rem; align-items: flex-start; flex-wrap: wrap; }
.logo-preview { min-width: 200px; min-height: 80px; padding: 1rem; border: 1px dashed var(--line); border-radius: var(--radius);
                display: flex; align-items: center; justify-content: center; background: var(--header-bg, var(--surface)); }
.logo-preview img { max-height: 64px; max-width: 240px; }
.colors input[type=color] { width: 100%; height: 2.4rem; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.design-logo form.inline { display: inline-block; margin-top: .5rem; }
.form label.switch { flex-direction: row; align-items: center; gap: .5rem; color: var(--text); margin: .25rem 0 .5rem; }
.form label.switch { justify-content: flex-start; } .form label.switch input { width: auto; flex: none; margin: 0; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem 1.5rem; align-items: start; }
.field-rights h4 { margin: .25rem 0 .4rem; }
.field-rights td { padding: .25rem .4rem; }
.field-rights select { padding: .2rem .4rem; width: 100%; }
.rights td:not(:first-child), .rights th:not(:first-child) { text-align: center; }
fieldset.groups { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; }
fieldset.groups legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
button.danger-link { color: var(--danger); }
/* Dashboards: Raster mit vier Spalten, Kacheln 1, 2 oder 4 Spalten breit */
.dash { margin: .5rem 0 1.5rem; }
.dash-bar { display: flex; justify-content: flex-end; margin-bottom: .25rem; }
.dash-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem; min-width: 0; }
.widget.size-s { grid-column: span 1; }
.widget.size-m { grid-column: span 2; }
.widget.size-l { grid-column: 1 / -1; }
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.size-m { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .widget.size-s { grid-column: 1 / -1; }
}
.widget header { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem; }
.widget h2 { margin: 0 0 .5rem; font-size: 1rem; }
.widget.size-s h2 { font-size: .85rem; color: var(--muted); font-weight: 600; }
.widget-body { max-height: 28rem; overflow: auto; }
.widget .timeline { margin: 0; }
.widget .activity { margin-bottom: .4rem; }
.widget-tools, .dash-editor, .dash.editing [data-dash=edit] { display: none; }
.dash.editing .widget-tools { display: flex; gap: .25rem; align-items: center; flex-shrink: 0; }
.dash.editing .dash-editor { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: 1rem; }
.dash-editor label { display: flex; flex-direction: column; gap: .25rem; color: var(--muted); font-size: .9rem; min-width: 14rem; }
.dash-editor .grow { flex: 1; }
.dash-editor .hint { flex-basis: 100%; }
.dash.editing .widget { cursor: grab; outline: 2px dashed var(--line); outline-offset: 2px; }
.widget.dragging { opacity: .4; }
.widget-tools button { background: none; border: 1px solid var(--line); color: var(--text); padding: 0 .4rem; line-height: 1.6; }
.widget-tools select { width: auto; padding: .1rem .3rem; font-size: .85rem; }
.kpi { display: flex; flex-direction: column; color: var(--text); }
.kpi:hover { text-decoration: none; }
.kpi strong { font-size: 1.6rem; }
.kpi span { color: var(--muted); font-size: .85rem; }
.bars, .rows { list-style: none; padding: 0; margin: 0; }
.bars a { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr auto; gap: .6rem; align-items: center; color: var(--text); padding: .25rem 0; }
.bar-track { background: var(--bg); border-radius: 4px; height: .75rem; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; min-width: 2px; }
.bar-num { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rows li { display: flex; justify-content: space-between; gap: .75rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.rows li:last-child { border-bottom: 0; }
.rows .detail { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.rows li.highlight .detail { color: var(--danger); font-weight: 600; }
.bars .empty, .rows .empty { color: var(--muted); }
p.filter { margin: 0 0 .75rem; }

/* Eigene Felder im Formular und auf der Detailseite */
.cf-section { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; }
.cf-section legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
.cf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem 1rem; }
.cf-grid .cf, .cf-grid .fe-field { grid-column: span 3; display: flex; flex-direction: column; gap: .25rem; }
.cf-grid.cols-1 .cf, .cf-grid.cols-1 .fe-field, .cf-grid .w-full { grid-column: 1 / -1; }
.cf-grid.cols-3 .w-third { grid-column: span 2; }
.cf-grid.cols-3 .w-half, .cf-grid.cols-2 .w-third { grid-column: span 3; }
.cf-deco h3 { margin: .5rem 0 0; }
.cf-deco hr { border: 0; border-top: 1px solid var(--line); width: 100%; }
.cf-note { margin: 0; color: var(--muted); }
.cf-label { color: var(--muted); font-size: .9rem; }
.cf-checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.cf-checks label, label.check { flex-direction: row; align-items: center; gap: .4rem; color: var(--text); }
label.check input { width: auto; }
.cf-social { display: grid; grid-template-columns: 9rem 1fr; gap: .5rem; }
.cf-unit { display: flex; align-items: center; gap: .4rem; }
.cf-unit input { flex: 1; }
.cf-full { grid-column: 1 / -1; }
.cf-show h3 { margin: .25rem 0; font-size: 1rem; }
.notes-inline { white-space: pre-wrap; }
dt[data-field] { cursor: pointer; }
dt[data-field]:hover { text-decoration: underline dotted; }
fieldset.privacy { border: 1px solid var(--line); border-radius: var(--radius); margin: .75rem 0; padding: .5rem 1rem .75rem; display: flex; flex-direction: column; gap: .4rem; }
fieldset.privacy legend { color: var(--muted); font-size: .9rem; padding: 0 .3rem; }
.lock { font-size: .9em; }
.checks.column { flex-direction: column; gap: .4rem; }
@media (max-width: 720px) {
  .cf-grid .cf, .cf-grid .fe-field { grid-column: 1 / -1 !important; }
  .cf-social { grid-template-columns: 1fr; }
}

/* Verlauf */
.history-filter { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: .75rem; }
.history-filter label { min-width: 12rem; }
table.history .old { color: var(--muted); text-decoration: line-through; }
table.history td { vertical-align: top; }

/* Formular-Editor */
.subtabs { margin-top: -.5rem; }
.fe { display: grid; grid-template-columns: 13rem 1fr 22rem; gap: 1rem; align-items: start; margin: 1rem 0; }
.fe-palette ul { display: flex; flex-direction: column; gap: .25rem; }
.fe-type { display: block; padding: .3rem .5rem; border: 1px dashed var(--line); border-radius: var(--radius); cursor: grab; text-decoration: none; }
.fe-section { margin-bottom: 1rem; }
.fe-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.fe-section-form { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.fe-section-form input { flex: 1; min-width: 8rem; }
.fe-section-form select { width: auto; }
.fe-field { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .6rem; background: var(--bg, transparent); cursor: grab; flex-direction: row !important; justify-content: space-between; align-items: flex-start; }
.fe-field a { text-decoration: none; display: flex; flex-direction: column; color: inherit; }
.fe-field.selected { border-color: var(--accent, #2563eb); box-shadow: 0 0 0 2px var(--accent, #2563eb) inset; }
.fe-field.dragging { opacity: .5; }
.fe-move { display: inline-flex; gap: .2rem; }
.fe-drop { grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--radius); padding: .4rem; text-align: center; color: var(--muted); text-decoration: none; }
.fe-props-form h4 { margin: 1rem 0 .25rem; }
.fe-props { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
button.small { padding: .2rem .5rem; font-size: .85rem; }
button.linklike { background: none; border: 0; color: var(--accent, #2563eb); padding: 0; cursor: pointer; text-decoration: underline; }
.social-net .pagehead { margin-bottom: .5rem; }
@media (max-width: 1100px) { .fe { grid-template-columns: 1fr; } .fe-props { position: static; max-height: none; } }

/* Formatierte Felder (rich.js) */
.rich { white-space: normal; overflow-wrap: anywhere; }
.rich img, .rich-area img { max-width: 100%; height: auto; border-radius: 4px; }
.rich p, .rich div { margin: 0 0 .4rem; }
.rich blockquote { margin: .5rem 0; padding-left: .75rem; border-left: 3px solid var(--line); color: var(--muted); }
.rich ul, .rich ol, .rich-area ul, .rich-area ol { margin: .25rem 0 .5rem; padding-left: 1.4rem; }
.rich-label { display: flex; flex-direction: column; gap: .25rem; }
.rich-editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rich-editor:focus-within { border-color: var(--accent); }
.rich-toolbar { display: flex; gap: .15rem; flex-wrap: wrap; padding: .25rem; border-bottom: 1px solid var(--line); }
.rich-btn { min-width: 2rem; padding: .2rem .45rem; background: transparent; color: var(--text); border: 1px solid transparent;
            border-radius: 4px; cursor: pointer; font: inherit; }
.rich-btn:hover { border-color: var(--line); background: var(--bg); }
.rich-area { min-height: 5.5rem; max-height: 32rem; overflow: auto; padding: .5rem .65rem; outline: none; }
.rich-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
.rich-area.busy, .photo-field.busy { opacity: .6; cursor: progress; }
.rich-editor.readonly { background: var(--bg); }

/* Kontaktfoto */
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center;
          background: var(--bg); border: 1px solid var(--line); color: var(--muted); flex: none; }
.avatar.large { width: 96px; height: 96px; font-size: 2.5rem; }
.avatar.small { width: 28px; height: 28px; font-size: .9rem; vertical-align: middle; margin-right: .45rem; }
.avatar[hidden] { display: none; }
.photo-field { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.photo-field label.button { cursor: pointer; }
.pagehead .grow { flex: 1; }

/* Suche und Aktivitäten */
.globalsearch { margin-left: auto; }
.globalsearch input { width: 14rem; max-width: 40vw; }
.search-page { margin-bottom: 1rem; }
.search-row { display: flex; gap: .5rem; }
.search-row input { flex: 1; }
.search-group .hits { list-style: none; padding: 0; margin: 0 0 .5rem; }
.search-group .hits li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
.search-group .count { color: var(--muted); font-weight: normal; font-size: .9rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1; min-width: 12rem; }
.edited { font-size: .85rem; color: var(--muted); white-space: nowrap; }
.edited:hover { color: var(--accent); }
table.activities tr.done td { color: var(--muted); }
h2.small { font-size: 1rem; }
@media (max-width: 720px) { .globalsearch { margin-left: 0; width: 100%; } .globalsearch input { width: 100%; max-width: none; } }
.globalsearch + .usermenu { margin-left: 0; }
.filters select, .filters input[type=search] { width: auto; margin: 0; }
.filters select { flex: 0 1 auto; }
.photo-field label.button { display: inline-block; width: auto; margin: 0 0 .25rem; }

/* Kategorien */
.cat-chip { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; line-height: 1.4;
            font-weight: 600; margin: 0 .2rem .15rem 0; white-space: nowrap; vertical-align: middle; }
h1 + .cats, .cats { margin: -.25rem 0 .75rem; }
.cat-filter { display: flex; flex-wrap: wrap; gap: .25rem; margin: .5rem 0 0; }
.cat-option { display: inline-flex; align-items: center; gap: .2rem; cursor: pointer; border-radius: 999px;
              padding: .1rem .25rem; border: 1px solid transparent; opacity: .55; }
.cat-option input { width: auto; margin: 0; }
.cat-option.on, .cat-option:has(input:checked) { opacity: 1; border-color: var(--line); }
.cat-option .cat-chip { margin: 0; }
.cat-select { border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem .75rem; margin: .75rem 0;
              display: flex; flex-wrap: wrap; gap: .3rem; }
.cat-select legend { color: var(--muted); font-size: .9rem; padding: 0 .25rem; }
.cat-select .cat-option { opacity: .6; }
.cat-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.cat-row input[name=name] { flex: 1 1 14rem; width: auto; }
.cat-row input[type=color] { width: 3rem; height: 2.1rem; padding: .1rem; flex: 0 0 auto; }
.cat-row input[type=file] { flex: 1 1 14rem; width: auto; }
.cat-row button, .cat-row .button { width: auto; }
/* .list-filter: siehe „Listen“ unten */
.export, .more { color: var(--muted); font-size: .9rem; margin: .5rem 0 0; }
.form label.cat-option { flex-direction: row; color: inherit; font-size: inherit; gap: .2rem; }

/* Reiter mit zuletzt geöffneten Datensätzen */
.tabbar { display: flex; gap: .3rem; align-items: center; padding: .35rem 1.5rem 0; overflow-x: auto;
          background: var(--surface); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tabbar[hidden] { display: none; }
.tabbar .tab { display: flex; align-items: center; flex: 0 0 auto; max-width: 15rem; border: 1px solid var(--line);
               border-bottom: none; border-radius: 6px 6px 0 0; background: var(--bg); font-size: .85rem; }
.tabbar .tab.current { background: var(--surface); border-color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
.tabbar .tab a { display: flex; align-items: center; gap: .35rem; padding: .3rem .2rem .3rem .55rem; min-width: 0;
                 color: var(--text); text-decoration: none; }
.tabbar .tab.current a { font-weight: 600; }
.tabbar .tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .tab-icon { font-size: .85rem; }
.tabbar .avatar.tiny { width: 18px; height: 18px; flex: 0 0 auto; }
.tabbar form { display: contents; }
.tabbar .tab-btn { background: none; border: none; padding: .25rem .3rem; color: var(--muted); cursor: pointer;
                   line-height: 1; font-size: .85rem; width: auto; }
.tabbar .tab-btn:hover { color: var(--text); }
.tabbar .tab-btn.pin { filter: grayscale(1); opacity: .35; font-size: .7rem; }
.tabbar .tab-btn.pin:hover, .tabbar .tab.pinned .tab-btn.pin { filter: none; opacity: 1; }
.tabbar .tab.pinned { border-top: 2px solid var(--accent); }
.tabbar .tab-all { display: block; margin-left: auto; flex: 0 0 auto; padding: .2rem .25rem .2rem .75rem;
                   position: sticky; right: 0; background: linear-gradient(to right, transparent, var(--surface) .6rem); }
.tabbar .tab-all button { font-size: .8rem; white-space: nowrap; }
@media (max-width: 720px) { .tabbar { padding: .35rem .75rem 0; } .tabbar .tab { max-width: 11rem; } }

/* Listen: Suche oben, zuklappbares Dashboard, Ergebnisse als Kachel */
.list-filter { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 0 -1.5rem .75rem; padding: .6rem 1.5rem;
               border-bottom: 1px solid var(--line); }
.list-filter .search-row { display: flex; gap: .5rem; align-items: center; }
.list-filter .search-row input[type=search] { margin: 0; }
.list-filter .cat-filter:empty { display: none; }
.icon { display: block; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0;
            border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer;
            text-decoration: none; flex: 0 0 auto; }
.icon-btn:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.icon-btn.active { color: var(--accent); border-color: var(--accent); background: var(--bg); }
.view-switch, .export-icons { display: inline-flex; gap: .3rem; align-items: center; }
.more .export-icons { vertical-align: middle; margin-left: .3rem; }
.more .icon-btn { width: 1.9rem; height: 1.9rem; }
.dash-wrap { margin: 0 0 1rem; }
.dash-wrap > summary { cursor: pointer; padding: .45rem .75rem; border: 1px solid var(--line); border-radius: var(--radius);
                       background: var(--surface); color: var(--muted); font-size: .92rem; user-select: none; }
.dash-wrap > summary:hover { color: var(--text); }
.dash-wrap > summary .dash-label { font-weight: 600; color: var(--text); }
.dash-wrap[open] > summary { margin-bottom: .75rem; }
#list-count { font-variant-numeric: tabular-nums; }
.list-tile { padding-top: .6rem; }
.tile-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tile-head h2 { margin: 0; font-size: 1rem; }
.tile-head .grow { flex: 1; }
.table-wrap { overflow-x: auto; }
.more-cell { text-align: center; padding: .75rem 0; }
.vcards .more-cell { grid-column: 1 / -1; }
.col-editor { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem; margin-bottom: .75rem; background: var(--bg); }
.col-list { list-style: none; padding: 0; margin: .5rem 0; max-width: 28rem; }
.col-list li { display: flex; align-items: center; gap: .3rem; padding: .25rem .4rem; border: 1px solid var(--line);
               border-radius: 6px; background: var(--surface); margin-bottom: .25rem; cursor: grab; }
.col-list li.dragging { opacity: .5; }
.col-list label { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.col-list input[type=checkbox] { width: auto; margin: 0; }
.col-list .grow { flex: 1; }
.col-list .tab-btn { background: none; border: none; padding: .2rem .35rem; color: var(--muted); cursor: pointer; width: auto; font-size: .8rem; }
.col-list .tab-btn:hover { color: var(--text); }
.col-editor .actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.list-tile table.list th, .list-tile table.list td a[href^="tel:"] { white-space: nowrap; }
/* Lange Werte (E-Mail, Webseite) dürfen umbrechen, statt die Tabelle zu verbreitern */
.list-tile table.list td a[href^="mailto:"], .list-tile table.list td a[href^="http"] { overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .list-filter { padding-top: .5rem; padding-bottom: .5rem; }
  /* Auf dem Handy bleiben die Kategorien eine wischbare Zeile, damit die feste Suche wenig Platz braucht. */
  .list-filter .cat-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .list-filter .cat-option { flex: 0 0 auto; }
}

/* Kontakte: A–Z-Leiste und Visitenkarten */
.az { display: flex; flex-wrap: wrap; gap: .15rem; margin: 0 0 .75rem; font-size: .88rem; }
.az a, .az span { min-width: 1.7rem; text-align: center; padding: .15rem .3rem; border-radius: 5px; }
.az a:hover { background: var(--surface); text-decoration: none; }
.az a.active { background: var(--accent); color: var(--accent-text); }
.az .off { color: var(--muted); opacity: .4; }
.vcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .75rem; }
.vcard { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; background: var(--surface);
         display: flex; flex-direction: column; gap: .2rem; min-width: 0; border-top: 3px solid var(--accent); }
.vcard-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.vcard-head .avatar { width: 44px; height: 44px; font-size: 1.3rem; }
.vcard-name { font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.vline { display: flex; gap: .4rem; align-items: baseline; font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.vicon { color: var(--muted); font-size: .85rem; width: 1rem; flex: 0 0 auto; }
.cat-dots { display: flex; gap: .3rem; margin-top: .35rem; flex-wrap: wrap; }
.cat-dot { position: relative; display: inline-block; width: .8rem; height: .8rem; border-radius: 50%;
           border: 1px solid rgba(0,0,0,.15); cursor: help; }
.cat-dot:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.cat-dot:focus::after { content: attr(data-name); position: absolute; left: 50%; bottom: 140%; transform: translateX(-50%);
                        background: var(--text); color: var(--surface); padding: .15rem .45rem; border-radius: 4px;
                        font-size: .75rem; white-space: nowrap; z-index: 5; }
.card-admin { display: grid; grid-template-columns: minmax(16rem, 26rem) 1fr; gap: 1rem; align-items: start; }
.card-admin .card + .card { margin-top: 0; }
.card-admin h2 { margin-top: 0; }
@media (max-width: 720px) { .vcards { grid-template-columns: 1fr; } .card-admin { grid-template-columns: 1fr; } }

/* Aktivitätsarten: Icon als farbiges Quadrat */
.kind-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
           color: #fff; flex: 0 0 auto; vertical-align: middle; }
.kind-ic svg { width: 17px; height: 17px; }
.kind-ic.small, .activity .meta .kind-ic { width: 22px; height: 22px; border-radius: 6px; }
.kind-ic.small svg, .activity .meta .kind-ic svg { width: 13px; height: 13px; }
.kind-cell { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.kind-title { display: flex; align-items: center; gap: .5rem; }

/* Detailseiten: Kopfkarte, zugeklappt mit den wichtigsten Angaben */
.chead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.chead > summary { list-style: none; display: flex; gap: .9rem; align-items: center; padding: .8rem 1rem; cursor: pointer; flex-wrap: wrap; }
.chead > summary::-webkit-details-marker { display: none; }
.chead h1 { margin: 0; font-size: 1.45rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ch-main { flex: 1 1 18rem; min-width: 0; }
.ch-line span + span::before { content: " · "; color: var(--muted); }
.ch-toggle { color: var(--accent); font-size: .88rem; white-space: nowrap; }
.chead .open-txt, .chead[open] .closed-txt { display: none; }
.chead[open] .open-txt { display: inline; }
.chead > summary .actions { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.avatar.head { width: 56px; height: 56px; font-size: 1.6rem; }
.avatar.deal-ic { font-size: 1.5rem; }
.ch-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0 1.25rem; padding: 0 1rem 1rem;
           border-top: 1px solid var(--line); }
.ch-body > .card, .ch-body > .card + .card { border: none; padding: 0; background: none; margin: 0; }
.ch-body h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .9rem 0 .4rem; }
.cat-dots.inline { display: inline-flex; margin: 0; vertical-align: middle; }

/* Aktivitäten auf Detailseiten: Formular | Einträge | Timeline */
.act3 { display: flex; gap: 1rem; align-items: flex-start; }
.act3 .pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.act3 .pane-body { padding: .8rem 1rem; }
.act3 .pane h3 { margin: 0 0 .6rem; font-size: 1rem; display: flex; align-items: center; gap: .35rem; }
.pane-form { flex: 0 0 310px; }
.pane-list { flex: 1 1 auto; }
.pane-tl { flex: 0 0 270px; }
.act3 .fold { border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; width: 28px; height: 28px;
              padding: 0; font-size: .8rem; cursor: pointer; flex: 0 0 auto; }
.act3 .fold:hover { color: var(--text); }
.act3 h3 .fold:first-of-type { margin-left: auto; }
.pane-strip { display: none; flex-direction: column; align-items: center; gap: .5rem; padding: .6rem .3rem; min-height: 14rem; }
.pane-strip .vert { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--muted); font-size: .85rem; white-space: nowrap; }
.act3 .pane.is-closed, .act3.big .pane-list, .act3.big .pane-tl { flex: 0 0 46px; }
.act3 .pane.is-closed .pane-strip, .act3.big .pane-list .pane-strip, .act3.big .pane-tl .pane-strip { display: flex; }
.act3 .pane.is-closed .pane-body, .act3.big .pane-list .pane-body, .act3.big .pane-tl .pane-body { display: none; }
.act3.big .pane-form { flex: 1 1 auto; }
.act3.big .pane-form .rich-area, .act3.big .pane-form textarea { min-height: 300px; }
.act-form label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.act-form input, .act-form textarea { margin: 0; }
.act-dates { display: grid; grid-template-columns: 1fr; gap: 0 .8rem; }
.act3.big .act-dates { grid-template-columns: 1fr 1fr; }
.kind-pick { border: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.kind-pick legend { color: var(--muted); font-size: .88rem; padding: 0; margin-bottom: .25rem; }
.kind-pick label { display: inline-flex; margin: 0; cursor: pointer; border-radius: 9px; padding: 2px; border: 2px solid transparent; }
.kind-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kind-pick label .kind-ic { opacity: .45; filter: saturate(.6); }
.kind-pick label:hover .kind-ic { opacity: .8; }
.kind-pick label:has(input:checked) { border-color: var(--accent); }
.kind-pick label:has(input:checked) .kind-ic { opacity: 1; filter: none; }
.kind-pick label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.kind-name { font-size: .85rem; color: var(--text); margin-left: .3rem; }
.feed-filter { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .4rem; }
.feed-filter input[type=search] { flex: 1 1 12rem; width: auto; margin: 0; }
.kind-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem;
        font-size: .8rem; background: var(--bg); color: var(--text); cursor: pointer; text-decoration: none; }
.chip:hover { text-decoration: none; border-color: var(--muted); }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip.on, .chip:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; }
.related-chk { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--muted); cursor: pointer; }
.related-chk input { width: auto; margin: 0; }
.feed .sect { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: .7rem 0 .25rem; }
.act { display: grid; grid-template-columns: auto 1fr auto; gap: .65rem; align-items: start; padding: .6rem .4rem;
       border-bottom: 1px solid var(--line); }
.act:last-child { border-bottom: none; }
.act.task { background: var(--warn-bg); border: 1px solid #f3d9b1; border-radius: 6px; margin-bottom: .35rem; }
.act.task.overdue { background: #fdecea; border-color: #e8a29c; }
.act.hl { outline: 2px solid var(--accent); border-radius: 6px; }
.act.done .act-subj a { text-decoration: line-through; color: var(--muted); }
.act-subj { font-weight: 600; overflow-wrap: anywhere; }
.act-subj a { color: var(--text); }
.act .meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.act .overdue-label { color: var(--danger); }
.act .tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; background: var(--bg); }
.act .body { font-size: .9rem; margin-top: .25rem; overflow-wrap: anywhere; }
.act .body.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.act .body.clamp.open { display: block; }
.act .more-btn { font-size: .82rem; padding: 0; }
.act .more-btn[hidden] { display: none; }
.act-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-size: .88rem; white-space: nowrap; }
.act-actions .link, .act-actions button.link { font-size: .88rem; }
@media (prefers-color-scheme: dark) {
  .act.task { border-color: #6b5226; }
  .act.task.overdue { background: #3b1d1a; border-color: #7a3a33; }
}
.tl-wrap .kind-chips { margin-bottom: .4rem; }
.tl { max-height: 34rem; overflow-y: auto; padding-right: .3rem; scrollbar-width: thin; }
.tl-month { font-weight: 700; font-size: .82rem; margin: .6rem 0 .3rem; position: sticky; top: 0; background: var(--surface); padding: .15rem 0; z-index: 1; }
.tl ul { list-style: none; margin: 0 0 0 .55rem; padding: 0 0 0 .9rem; border-left: 2px solid var(--line); }
.tl li { position: relative; margin: 0 0 .1rem; }
.tl li a { display: block; padding: .2rem .35rem; border-radius: 5px; color: var(--text); font-size: .82rem; line-height: 1.25; }
.tl li a:hover { background: var(--bg); text-decoration: none; }
.tl li.cur a { background: var(--bg); box-shadow: inset 2px 0 0 var(--accent); }
.tl li.done .tl-subj { color: var(--muted); text-decoration: line-through; }
.tl li small { display: block; color: var(--muted); font-size: .74rem; }
.tl .tl-dot { position: absolute; left: -1.38rem; top: .3rem; width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--surface); }
.tl .tl-dot svg { width: 8px; height: 8px; }
@media (max-width: 900px) {
  .act3 { flex-direction: column; align-items: stretch; }
  .act3 .pane, .act3 .pane.is-closed, .act3.big .pane-list, .act3.big .pane-tl { flex: 1 1 auto; }
  .act3 .pane-strip { display: flex; flex-direction: row; min-height: 0; padding: .45rem .6rem; }
  .act3 .pane-strip .vert { writing-mode: horizontal-tb; transform: none; }
  .act3 .pane-list .pane-strip { display: none !important; }
  .act3 .pane-list .pane-body { display: block !important; }
  .act3 .pane-form:not(.m-open) .pane-body, .act3 .pane-tl:not(.m-open) .pane-body { display: none; }
  .act3 .pane-form.m-open .pane-strip, .act3 .pane-tl.m-open .pane-strip { display: none; }
  .act3 .pane-form.m-open .pane-body, .act3 .pane-tl.m-open .pane-body { display: block; }
  .act3 .pane-tl { order: 3; }
  .act3 [data-act=big] { display: none; }
}

/* Adminpunkt Aktivitätsarten */
.kinds-admin { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; align-items: start; }
.kinds-admin .card + .card { margin-top: 0; }
.kinds-admin h2 { margin-top: 0; }
.kinds-table tr.sel td { background: var(--bg); }
.kinds-table tr.off td { color: var(--muted); }
.kinds-table tr.off .kind-ic { opacity: .45; }
.kinds-table .tab-btn { background: none; border: none; padding: .15rem .3rem; color: var(--muted); cursor: pointer; width: auto; font-size: .78rem; }
.kinds-table .nowrap, .nowrap { white-space: nowrap; }
.small { font-size: .8rem; }
.icon-pick, .color-pick { border: none; padding: 0; margin: .5rem 0; }
.icon-pick legend, .color-pick legend { color: var(--muted); font-size: .9rem; padding: 0; margin-bottom: .3rem; }
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: .35rem; }
.icon-pick label { display: flex; align-items: center; justify-content: center; height: 40px; border: 1px solid var(--line);
                   border-radius: 7px; background: var(--bg); cursor: pointer; color: var(--text); }
.icon-pick label svg { width: 20px; height: 20px; }
.icon-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.icon-pick label:has(input:checked) { border: 2px solid var(--accent); color: var(--accent); }
.color-pick { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.color-pick .swatch { width: 28px; height: 28px; border-radius: 50%; padding: 0; border: 2px solid var(--surface); cursor: pointer; }
.color-pick .swatch.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.color-pick input[type=color] { width: 3rem; height: 30px; padding: 1px; margin: 0; }
.kind-preview { display: flex; align-items: center; gap: .6rem; background: var(--bg); border-radius: 8px; padding: .55rem .8rem; margin: .6rem 0; }
.kind-form .actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.kind-form .actions .grow { flex: 1; }
@media (max-width: 900px) { .kinds-admin { grid-template-columns: 1fr; } .icon-pick { grid-template-columns: repeat(6, 1fr); } }

/* ---------- Datenschutz ---------- */
:root { --ds-green: #1f8a4c; --ds-amber: #b26a00; --ds-red: #c0352b; --ds-info: #667085; }
@media (prefers-color-scheme: dark) { :root { --ds-green: #4cc27e; --ds-amber: #f0a43a; --ds-red: #ff6b5e; } }
.ds-amber { color: var(--ds-amber); }
.ds-red { color: var(--ds-red); }
.ds-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .35rem;
          background: var(--ds-info); vertical-align: middle; }
.ds-dot.ds-green, .ds-dot.ds-ok { background: var(--ds-green); }
.ds-dot.ds-amber, .ds-dot.ds-warn { background: var(--ds-amber); }
.ds-dot.ds-red { background: var(--ds-red); }
.ds-dot.ds-info { background: var(--ds-info); }
.badge.warn { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.ds-status-new { border-color: var(--accent); color: var(--accent); }
.badge.ds-status-in_progress { border-color: var(--ds-amber); color: var(--ds-amber); }
.badge.ds-status-done { border-color: var(--ds-green); color: var(--ds-green); }
.badge.ds-status-rejected { color: var(--muted); }
.secondary-btn { background: transparent; color: var(--accent); }
.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.danger-solid:disabled { opacity: .5; cursor: not-allowed; }
a.danger-link { color: var(--danger); }
.danger-card { border-color: var(--danger); }
.erase-dialog { border-color: var(--danger); max-width: 720px; }
.filter-chips { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.filter-chips a { padding: .15rem .7rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.filter-chips a.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pre { white-space: pre-wrap; }
.paper { background: #fff; color: #1d2330; max-width: 820px; margin: 1rem auto; padding: 2rem 2.5rem;
         border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.paper a { color: #2563eb; }
.paper .sub { color: #667085; }
.paper-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid #1d2330;
              padding-bottom: .5rem; margin-bottom: 1rem; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th, .paper td { text-align: left; border-bottom: 1px solid #e3e6eb; padding: .3rem .4rem; vertical-align: top; }
.ds-bar { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; margin: .75rem 0; padding: .5rem .9rem;
          border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); font-size: .9rem; }
.consent-add { margin-top: .75rem; }
.consent-add summary { cursor: pointer; color: var(--accent); }
.objection-form { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: .3rem 0; }
.export-purpose { position: relative; display: inline-block; }
.export-purpose summary { list-style: none; cursor: pointer; }
.export-purpose summary::-webkit-details-marker { display: none; }
.export-purpose .menu-items { position: absolute; right: 0; top: calc(100% + .3rem); z-index: 20; width: 260px;
                              display: flex; flex-direction: column; gap: .4rem; padding: .75rem; background: var(--surface);
                              border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,.12); }
/* ---------- Administration → Systeminformation ---------- */
.sysinfo { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1rem; }
.sys-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sys-head h2 { margin: 0; }
.sys-head .actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.sys-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.sys-tiles .card, .sys-cards .card, .sysinfo > .card { margin: 0; }
.sys-tile { display: flex; flex-direction: column; gap: .2rem; min-height: 150px; }
.sys-tile .big { font-size: 1.7rem; font-weight: 700; margin: 0; }
.sys-tile .bar { margin-top: auto; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.sys-tile .bar span { display: block; height: 100%; background: var(--accent); }
.sys-tile .bar.high span { background: var(--ds-amber); }
.sys-tile .bar.full span { background: var(--ds-red); }
.spark { width: 100%; height: 40px; margin-top: auto; display: block; }
.spark polyline { stroke: var(--accent); stroke-width: 2; }
.spark-req { margin-top: auto; }
.spark-req .spark polyline { stroke: var(--ds-green); }
.sys-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.sys-cards h2, .sysinfo > .card h2 { margin-top: 0; }
.sys-dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.sys-dl dt { color: var(--muted); }
.sys-dl dd { margin: 0; }
.sys-data { width: 100%; border-collapse: collapse; }
.sys-data th, .sys-data td { padding: .45rem .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.sys-data th { color: var(--muted); font-weight: 500; }
.sys-data .num { text-align: right; font-variant-numeric: tabular-nums; }
.sys-data .total td { font-weight: 700; }
.sys-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.sys-tasks .detail { display: block; margin-left: 1.1rem; }
.dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; background: var(--line); vertical-align: baseline; }
.dot.ok { background: var(--ds-green); }
.dot.warn { background: var(--ds-amber); }
.logrows { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; padding: .25rem 0;
           overflow-x: auto; }
.card.logrows { padding: .25rem 0; max-height: 70vh; overflow-y: auto; }
.logrow { display: grid; grid-template-columns: 9.5rem 4.5rem 1fr; gap: .75rem; padding: .35rem 1.25rem;
          border-bottom: 1px solid var(--line); }
.logrow:last-child { border-bottom: 0; }
.logrow .time { color: var(--muted); white-space: nowrap; }
.logrow .level { font-weight: 700; color: var(--ds-green); }
.logrow.warn .level { color: var(--ds-amber); }
.logrow.error .level { color: var(--ds-red); }
.logrow.debug .level { color: var(--muted); }
.logrow .msg { white-space: pre-wrap; word-break: break-word; }
.logrows .empty { padding: .5rem 1.25rem; }
.sys-logbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.sys-logbar .chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.sys-logbar input[type=search] { flex: 1 1 240px; min-width: 200px; }
.sys-logbar .check { display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.note { border-left: 3px solid var(--accent); background: var(--surface); padding: .75rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; }
@media (max-width: 640px) {
  .logrow { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Einrichtungsassistent ---------- */
.wizard-page { padding: 2rem 1rem; }
.wizard { max-width: 860px; margin: 0 auto; padding: 1.6rem 2rem; border-radius: 12px; }
.wz-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.wz-head img { height: 64px; max-width: 160px; object-fit: contain; }
.wz-head h1 { font-size: 1.35rem; margin: 0; }
.wz-logout { margin-left: auto; }
.wz-steps { list-style: none; display: flex; padding: 0; margin: 0 0 1.4rem; }
.wz-steps li { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); position: relative; padding-top: 2.1rem; }
.wz-steps li a { color: inherit; }
.wz-steps .n { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%;
               background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 700; z-index: 1; }
.wz-steps li + li::after { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.wz-steps li.done, .wz-steps li.cur { color: var(--text); }
.wz-steps li.cur { font-weight: 600; }
.wz-steps li.done .n { background: var(--ds-green); color: #fff; }
.wz-steps li.cur .n { background: var(--accent); color: var(--accent-text); }
.wz-steps li.done::after, .wz-steps li.cur::after { background: var(--ds-green); }
.wizard h2 { margin-top: 0; font-size: 1.2rem; }
.wizard > .sub { margin-bottom: 1rem; }
.wz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.wz-grid.one { grid-template-columns: 1fr; align-content: start; }
.wz-grid .wide { grid-column: 1 / -1; margin-top: -.4rem; font-size: .88rem; }
.wz-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.wz-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
           margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.wz-mfa { display: flex; gap: 1.6rem; align-items: flex-start; flex-wrap: wrap; }
.wz-mfa img { border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.wz-mfa form { flex: 1; min-width: 240px; }
.wz-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: .3rem 1rem; background: var(--bg); border-radius: 6px;
            padding: .7rem 1rem; margin-bottom: .6rem; }
.wz-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.wz-option { border: 1.5px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.wz-option.on { border-color: var(--accent); }
.wz-option.off { opacity: .6; }
.wz-option .badge { align-self: flex-start; }
.wz-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.wz-two h3 { margin-top: 0; }
.wz-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.wz-checks li::before { content: "ℹ "; color: var(--muted); }
.wz-checks li.ok::before { content: "✓ "; color: var(--ds-green); font-weight: 700; }
.wz-checks li.warn::before { content: "! "; color: var(--ds-amber); font-weight: 700; }
.wz-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: .8rem; margin: 1rem 0; }
.wz-section { border: 1px solid var(--line); border-radius: 8px; padding: .7rem 1rem; }
.wz-section h3 { margin: 0 0 .5rem; font-size: .98rem; display: flex; justify-content: space-between; }
.wz-section h3 a { font-weight: 400; font-size: .85rem; }
.wz-section dl { display: grid; grid-template-columns: minmax(7rem, 42%) 1fr; gap: .3rem 1rem; margin: 0; font-size: .92rem; }
.wz-section dt { color: var(--muted); }
.wz-section dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .wizard { padding: 1rem; }
  .wz-grid, .wz-two { grid-template-columns: 1fr; }
  .wz-steps li { font-size: 0; }
}
@media print {
  .noprint, .wz-steps, .wz-logout { display: none !important; }
  .wizard-page { padding: 0; }
}

@media print {
  .topbar, .tabs, .noprint, .ds-bar, nav { display: none !important; }
  body { background: #fff; }
  .container { padding: 0; max-width: none; }
  .paper { border: 0; box-shadow: none; margin: 0; padding: 0; max-width: none; }
}

/* Active Directory (0.20) */
.wz-option:has(input:checked) { border-color: var(--accent); }
.wz-checks li.bad::before { content: "✗ "; color: var(--danger); font-weight: 700; }
.ad-test { margin-top: .8rem; }
.ad-test li { overflow-wrap: anywhere; }
.ad-map input, .ad-map select { width: 100%; }
.ad-map td { padding: .3rem .4rem; }
textarea.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
details summary { cursor: pointer; margin: .6rem 0; }

/* Karte „Kategorien“ rechts neben den Listen (0.21.2): zugeklappt schmal, aufgeklappt 16rem */
.list-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; }
.list-layout:has(> .cat-card) { grid-template-columns: minmax(0, 1fr) auto; }
.list-main { min-width: 0; }
.cat-card { padding: .6rem .8rem; margin: 0; position: sticky; top: .75rem; }
.cat-card[open] { width: 16rem; }
.cat-card > summary { cursor: pointer; font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: .4rem; }
.cat-card .badge.empty { opacity: .5; }
.cat-card .cat-filter { flex-direction: column; flex-wrap: nowrap; gap: .2rem; margin: .6rem 0; max-height: 60vh; overflow-y: auto; }
.cat-card .cat-option { width: 100%; }
.cat-card .cat-chip { white-space: normal; max-width: 100%; border-radius: .6rem; }
.cat-card .cat-filter.colors .cat-option { gap: .45rem; padding: .1rem .25rem; }
.cat-card .cat-name { font-size: .85rem; }
.cat-display { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.cat-display .seg { padding: .15rem .55rem; font-size: .8rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); cursor: pointer; width: auto; margin: 0; }
.cat-display .seg.active { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 900px) {
  .list-layout, .list-layout:has(> .cat-card) { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .list-main { display: contents; }
  .list-main > form { order: 0; }
  .list-layout > .cat-card { order: 1; position: static; width: auto; margin: .5rem 0; }
  .list-main > :not(form) { order: 2; }
}

/* E-Mail: Posteingang, Mail mit Formular „Ablegen“, Dateien an Aktivitäten */
.mail-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: 1rem; align-items: start; }
.mail-layout > .card { margin-top: 0; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.mail-body .notes { margin-top: .75rem; }
.mail-file .checks label { align-items: flex-start; }
.mail-list td.nowrap, .list td.nowrap { white-space: nowrap; }
.mail-filter { flex-wrap: wrap; }
ul.files { list-style: none; padding: 0; margin: .4rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; }
ul.files li { overflow-wrap: anywhere; }
.mail-side { display: flex; flex-direction: column; gap: 1rem; }
.mail-side > .card { margin: 0; }

/* Seitenbereich des Outlook-Add-ins */
body.taskpane { padding: .75rem; font-size: 14px; }
.tp-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.tp-head .logo { max-height: 24px; }
.tp-user { margin: 0 0 .5rem; }
.tp-subject { margin: .25rem 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.tp-toggle { display: flex; margin: .75rem 0; }
.tp-toggle button { flex: 1; border-radius: 0; }
.tp-toggle button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.tp-toggle button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.tp-option { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .5rem; margin: .35rem 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.tp-option.active { border-color: var(--accent); }
.tp-option span { display: flex; flex-direction: column; min-width: 0; }
.tp-option small { color: var(--muted); overflow-wrap: anywhere; }
.tp-new { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: .25rem 0 .5rem; }
.tp-new label { display: flex; flex-direction: column; gap: .2rem; }
.tp-new .tp-company { grid-column: 1 / -1; margin: 0; }
body.taskpane h3 { font-size: .9rem; margin: 1rem 0 .25rem; color: var(--muted); font-weight: 600; }
body.taskpane #file { width: 100%; }
.key-value { width: 100%; font-family: ui-monospace, monospace; }
.tp-option input { width: auto; flex: none; margin: .2rem 0 0; }

/* Lebenslauf der Kandidaten */
.card.cv { margin-top: 1rem; }
.cv-block + .cv-block { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.cv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cv-head h3 { margin: 0 0 .4rem; font-size: 1rem; }
.cv-entry { display: flex; gap: .75rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.cv-dot { width: .7rem; height: .7rem; border-radius: 50%; border: 2px solid var(--muted); margin-top: .35rem; flex: none; }
.cv-dot.on { background: var(--ok, #16a34a); border-color: var(--ok, #16a34a); }
.cv-main { flex: 1; min-width: 0; }
.cv-pill { display: inline-block; font-size: .78rem; padding: 0 .5rem; border-radius: 999px; background: color-mix(in srgb, var(--ok, #16a34a) 15%, transparent); color: var(--ok, #16a34a); }
.cv-desc { margin-top: .2rem; white-space: pre-line; }
.cv-edit summary, .cv-add summary { color: var(--accent); font-size: .9rem; margin: .3rem 0; }
.cv-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem .75rem; margin: .4rem 0 .6rem; max-width: 760px; }
.cv-form label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; }
.cv-form label.check { flex-direction: row; align-items: center; gap: .4rem; }
.cv-form .w, .cv-form .cv-actions { grid-column: 1 / -1; }
.cv-skills { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .6rem; }
.cv-skill { display: inline-flex; align-items: center; gap: .25rem; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .6rem; font-size: .9rem; }
.cv-x { background: none; border: 0; padding: 0 .1rem; color: var(--muted); cursor: pointer; line-height: 1; }
.cv-x:hover { color: var(--danger); }
.cv-skill-add { max-width: 560px; }
.cv-filter { margin-top: .5rem; }
.cv-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .5rem .75rem; margin-top: .4rem; }
.cv-filter-grid label { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); font-size: .88rem; }
/* 0.25.1: Originalansicht abgelegter Mails (HTML ohne Bilder und Links) */
.mail-tabs { display: flex; border-bottom: 1px solid var(--line); margin: .75rem 0 .5rem; }
.mail-tabs button { background: none; border: none; border-bottom: 2px solid transparent; border-radius: 0;
                    color: var(--muted); padding: .35rem .9rem; }
.mail-tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.mail-note { font-size: .85rem; margin: .25rem 0 .5rem; }
.mail-frame { display: block; width: 100%; min-height: 12rem; border: 1px solid var(--line); border-radius: 6px;
              background: #fff; }
.mail-views .notes { border-top: none; padding-top: 0; }
